-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestopiaReports.php
85 lines (75 loc) · 3.04 KB
/
TestopiaReports.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/**
* See README for installation and usage
*/
/**
* Copyright (C) 2009 - Andreas Müller
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, see <http://www.gnu.org/licenses>.
*/
if ( !defined( 'MEDIAWIKI' ) and !defined('TESTOPIAREPORTS') ) {
die('This file is a MediaWiki extension, it is not a valid entry point' );
}
$wgTestopiaReportsIncludes = dirname(__FILE__) . '/';
/**
* Set up autoloading
*/
$wgAutoloadClasses['TestopiaReport'] = $wgTestopiaReportsIncludes."TestopiaReport.php";
$wgAutoloadClasses['TestopiaParameters'] = $wgTestopiaReportsIncludes."TestopiaParameters.php";
$wgAutoloadClasses['TR_MysqlConnector'] = $wgTestopiaReportsIncludes."TR_MysqlConnector.php";
$wgAutoloadClasses['TR_PGConnector'] = $wgTestopiaReportsIncludes."TR_PGConnector.php";
$wgAutoloadClasses['TR_Colors'] = $wgTestopiaReportsIncludes."TR_Colors.php";
$wgAutoloadClasses['TR_Template'] = $wgTestopiaReportsIncludes."TR_Template.php";
$wgAutoloadClasses['GoogleChart'] = $wgTestopiaReportsIncludes."GoogleChart.php";
$wgAutoloadClasses['TestopiaDebug'] = $wgTestopiaReportsIncludes."TestopiaDebug.php";
$wgAutoloadClasses['TR_SQL'] = $wgTestopiaReportsIncludes."TR_SQL.php";
/**
* Extension setup
*/
$wgExtensionCredits['parserhook'][] = array(
'name' => 'TestopiaReports',
'version' => '0.4',
'url' => 'http://www.mediawiki.org/wiki/Extension:Testopia_Reports',
'author' => 'Andreas Mueller',
'description' => 'Providing of [http://www.mozilla.org/projects/testopia/ Testopia] reports and charts'
);
$wgExtensionFunctions[] = 'efTestopiaReportsSetup';
$wgExtensionMessagesFiles['TestopiaReports'] = $wgTestopiaReportsIncludes.
'/TestopiaReports.i18n.php';
$wgHooks['LanguageGetMagic'][] = 'efTestopiaReportsMagic';
/**
* Register the function hook
*/
function efTestopiaReportsSetup() {
global $wgParser;
$wgParser->setFunctionHook( 'testopia', 'efTestopiaReportsRender' );
}
/**
* Register the magic word
*/
function efTestopiaReportsMagic( &$magicWords, $langCode ) {
$magicWords['testopia'] = array( 0, 'testopia' );
return true;
}
/**
* Call to render the testopia report
*/
function efTestopiaReportsRender( &$parser) {
$output="";
$args = func_get_args();
$testopiaReport = new TestopiaReport( $parser, $args );
$output = $testopiaReport->render();
return $parser->insertStripItem( $output , $parser->mStripState );
}
?>