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