2 // This extension depends on
5 # Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
6 if (!defined('MEDIAWIKI')) {
7 echo "To install the wrreport extension, put the following line in LocalSettings.php:\n";
8 echo 'require_once "$IP/extensions/wrreport/wrreport.php"';
13 $dir = dirname(__FILE__) . '/';
14 $wgAutoloadClasses['WrReport'] = $dir . 'wrreport.body.php';
15 $wgExtensionMessagesFiles['WrReport'] = $dir . 'wrreport.i18n.php';
16 $wgSpecialPages['WrReport'] = 'WrReport';
17 $wgHooks['LanguageGetSpecialPageAliases'][] = 'wrReportLocalizedPageName';
18 $wgHooks['ParserAfterTidy'][] = 'wrCommonMarkerAfterTidy';
19 $wgHooks['ParserFirstCallInit'][] = 'wrReportParserInit';
22 function wrReportLocalizedPageName(&$specialPageArray, $code) {
23 # The localized title of the special page is among the messages of the extension:
24 wfLoadExtensionMessages('WrReport');
25 $text = wfMsg('wrreport');
27 # Convert from title in text form to DBKey and put it into the alias array:
28 $title = Title::newFromText($text); // 'Bahnberichte'
29 $specialPageArray['WrReport'][] = $title->getDBKey(); // 'Bahnberichte'
36 $wgExtensionCredits['parserhook'][] = array(
37 'name' => 'Winterrodeln Report',
39 'author' =>'Philipp Spitzer',
40 'url' => 'http://www.winterrodeln.org',
41 'description' => 'This extension interprets the <report/> tag in sledding pages and creates report summaries'
46 $wrConditions = array(1 => 'Sehr gut', 2 => 'Gut', 3 => utf8_encode('Mittelmäßig'), 4 => 'Schlecht', 5 => 'Geht nicht');
47 $wrNewReportSection = utf8_encode('Eintragen');
48 $wrShowReportsSection = utf8_encode('Einträge');
52 require_once dirname(__FILE__) . '/wrreport.body.php';