+++ /dev/null
-<?php
-// File encoding: utf-8
-// This extension does not depend on other extensions.
-//
-// The following tags are supported:
-// <bahnentabelle/>
-// Creates an overview table of all sledruns specified (one per line) in the tag.
-//
-// <bahnenregiontabelle/>
-// Like <bahnentabelle> but includes all sledruns that are in the region of the current page
-// or in the region specified by one of the following parameters:
-// <bahnenregiontabelle wiki="Innsbruck" /> (refers to region represented by the MediaWiki Title name)
-// <bahnenregiontabelle region_id="3" /> (refers to id in the wrregion table)
-// <bahnenregiontabelle region_name="Innsbruck" /> (refers to name in the wrregion table)
-// This tag does not accept any contents.
-//
-// <bahnberichte/>
-// Shows an overview of the sledrun reports of the current page.
-//
-// <bahnberichtformular/>
-// Creates the form that is used to enter sledrun reports.
-//
-// <rodelbahntabelle/>
-// Generates a list of sledrun entries in a flexible way.
-// Each line (entry) either add sledruns or removes sledruns.
-// Without entries, the table contains no sledruns.
-//
-// Examples:
-// Empty list:
-// <rodelbahntabelle/>
-//
-// Sledrun "Rumer Alm" and sledrun "Juifenalm"
-// <rodelbahntabelle>
-// <rodelbahn>Juifenalm</rodelbahn>
-// <rodelbahn>Rumer Alm</rodelbahn>
-// </rodelbahntabelle>
-//
-// All sledruns in region Innsbruck thats entries are not "under construction".
-// The name of the region has to correspond to a name (column name)
-// in the table wrregion.
-// <rodelbahntabelle>
-// <region>Innsbruck</region>
-// </rodelbahntabelle>
-//
-// Same as above but excluding the sledrun "Rumer Alm":
-// <rodelbahntabelle>
-// <region>Innsbruck</region>
-// <rodelbahn operation="-">Rumer Alm</rodelbahn>
-// </rodelbahntabelle>
-//
-// All sledruns thats entries are "under construction"
-// <rodelbahntabelle>
-// <rodelbahnen in_arbeit="ja"/>
-// </rodelbahntabelle>
-//
-// Attributes:
-// * in_arbeit: values "ja", "nein" (default for <region> and <rodelbahnen>), "*" (default for <rodelbahn>)
-// Just include the sledrun(s) if the condition is fulfilled.
-// * operation: values "+" (add the sledrun(s) to the set, default), "-" (subtract the sledrun(s) from the set)
-// Attributes that may be implemented later
-// * beleuchtungstage: values "0", "unknown" (is null), ">0" (excludes null), "7", "*" (includes null)
-// Just include the sledrun(s) if the condition is fulfilled.
-//
-
-# Alert the user that this is not a valid entry point to MediaWiki if they try to access the special pages file directly.
-if (!defined('MEDIAWIKI')) {
- echo "To install the wrreport extension, put the following line in LocalSettings.php:\n";
- echo 'require_once "$IP/extensions/wrreport/wrreport.php"';
- exit(1);
-}
-
-
-$wgExtensionCredits['parserhook'][] = array(
- 'path' => __FILE__,
- 'name' => 'Winterrodeln Report',
- 'description' => 'Interprets the <report/> tag in sledrun pages and creates report summaries',
- 'descriptionmsg' => 'wrreport-description',
- 'version' => '2.9.4',
- 'author' =>'Philipp Spitzer',
- 'url' => 'http://www.winterrodeln.org/trac/wiki/WrReport',
-);
-
-
-// Variables that can be changed in LocalSettings.php
-$wgWrReportMode = 'allow'; // 'summer', 'allow', 'loggedin', 'deny'
-$wgWrReportBlackListAll = array(); // array of page names where reports disallowed for all users. Example: array('Birgitzer Alm (vom Adelshof)');
-$wgWrReportBlackListStrangers = array(); // array of page names where reports are disallowed for not logged in users
-$wgWrReportDeleteMode = 'loggedin'; // 'allow', 'loggedin', 'deny'
-$wgWrReportFeedRoot = 'http://www.winterrodeln.org/feed'; // root URL of the Winterrodeln feed without trailing slash
-
-
-
-// Resources
-$wgResourceModules['ext.wrreport'] = array(
- 'styles' => array('wrreport.css'),
- 'localBasePath' => dirname( __FILE__ ),
- 'remoteExtPath' => 'wrreport',
- 'position' => 'top'
-);
-
-
-// Init
-$wgAutoloadClasses['SpecialWrReport'] = dirname(__FILE__) . '/wrreport_body.php';
-$wgAutoloadClasses['WrReport'] = dirname(__FILE__) . '/wrreport_body.php';
-$wgAutoloadClasses['Services_Libravatar'] = dirname(__FILE__) . '/libravatar.php'; // from http://pear.php.net/package/Services_Libravatar
-$wgMessagesDirs['wrreport'] = __DIR__ . '/i18n';
-$wgSpecialPages['wrreport'] = 'SpecialWrReport';
-$wgHooks['LanguageGetSpecialPageAliases'][] = 'WrReportLanguageGetSpecialPageAliasesHook';
-$wgHooks['ParserFirstCallInit'][] = 'WrReportParserFirstCallInitHook';
-
-
-function WrReportLanguageGetSpecialPageAliasesHook(&$specialPageArray, $languageCode) {
- $text = wfMessage('wrreport')->text(); // 'Bahnberichte'
- $title = Title::newFromText($text); // 'Bahnberichte'
- $specialPageArray['wrreport'][] = $title->getDBKey(); // 'Bahnberichte'
- return true;
-}
-
-
-function WrReportParserFirstCallInitHook(&$parser) {
- $parser->setHook('bahnberichtformular', 'WrReport::bahnberichtformularParserHook');
- $parser->setHook('bahnberichte', 'WrReport::bahnberichteParserHook');
- $parser->setHook('bahnentabelle', 'WrReport::bahnentabelleParserHook');
- $parser->setHook('bahnenregiontabelle', 'WrReport::bahnenregiontabelleParserHook');
- $parser->setHook('rodelbahntabelle', 'WrReport::rodelbahntabelleParserHook');
- $parser->setHook('avatar', 'WrReport::avatarParserHook');
- return true;
-}
-
-
-?>
<?php
// File encoding: utf-8
-// Classes for the wrreport extension.
+// This extension does not depend on other extensions.
+//
+// Variables that can be changed in LocalSettings.php:
+// $wgWrReportMode = 'allow'; // 'summer', 'allow', 'loggedin', 'deny'
+// $wgWrReportBlackListAll = array(); // array of page names where reports disallowed for all users. Example: array('Birgitzer Alm (vom Adelshof)');
+// $wgWrReportBlackListStrangers = array(); // array of page names where reports are disallowed for not logged in users
+// $wgWrReportDeleteMode = 'loggedin'; // 'allow', 'loggedin', 'deny'
+// $wgWrReportFeedRoot = 'http://www.winterrodeln.org/feed'; // root URL of the Winterrodeln feed without trailing slash
+//
+//
+// The following tags are supported:
+// <bahnentabelle/>
+// Creates an overview table of all sledruns specified (one per line) in the tag.
+//
+// <bahnenregiontabelle/>
+// Like <bahnentabelle> but includes all sledruns that are in the region of the current page
+// or in the region specified by one of the following parameters:
+// <bahnenregiontabelle wiki="Innsbruck" /> (refers to region represented by the MediaWiki Title name)
+// <bahnenregiontabelle region_id="3" /> (refers to id in the wrregion table)
+// <bahnenregiontabelle region_name="Innsbruck" /> (refers to name in the wrregion table)
+// This tag does not accept any contents.
+//
+// <bahnberichte/>
+// Shows an overview of the sledrun reports of the current page.
+//
+// <bahnberichtformular/>
+// Creates the form that is used to enter sledrun reports.
+//
+// <rodelbahntabelle/>
+// Generates a list of sledrun entries in a flexible way.
+// Each line (entry) either add sledruns or removes sledruns.
+// Without entries, the table contains no sledruns.
+//
+// Examples:
+// Empty list:
+// <rodelbahntabelle/>
+//
+// Sledrun "Rumer Alm" and sledrun "Juifenalm"
+// <rodelbahntabelle>
+// <rodelbahn>Juifenalm</rodelbahn>
+// <rodelbahn>Rumer Alm</rodelbahn>
+// </rodelbahntabelle>
+//
+// All sledruns in region Innsbruck thats entries are not "under construction".
+// The name of the region has to correspond to a name (column name)
+// in the table wrregion.
+// <rodelbahntabelle>
+// <region>Innsbruck</region>
+// </rodelbahntabelle>
+//
+// Same as above but excluding the sledrun "Rumer Alm":
+// <rodelbahntabelle>
+// <region>Innsbruck</region>
+// <rodelbahn operation="-">Rumer Alm</rodelbahn>
+// </rodelbahntabelle>
+//
+// All sledruns thats entries are "under construction"
+// <rodelbahntabelle>
+// <rodelbahnen in_arbeit="ja"/>
+// </rodelbahntabelle>
+//
+// Attributes:
+// * in_arbeit: values "ja", "nein" (default for <region> and <rodelbahnen>), "*" (default for <rodelbahn>)
+// Just include the sledrun(s) if the condition is fulfilled.
+// * operation: values "+" (add the sledrun(s) to the set, default), "-" (subtract the sledrun(s) from the set)
+// Attributes that may be implemented later
+// * beleuchtungstage: values "0", "unknown" (is null), ">0" (excludes null), "7", "*" (includes null)
+// Just include the sledrun(s) if the condition is fulfilled.
+//
// Constants
// Parser Hook Functions
// ---------------------
+ public static function ParserFirstCallInitHook(&$parser) {
+ $parser->setHook('bahnberichtformular', 'WrReport::bahnberichtformularParserHook');
+ $parser->setHook('bahnberichte', 'WrReport::bahnberichteParserHook');
+ $parser->setHook('bahnentabelle', 'WrReport::bahnentabelleParserHook');
+ $parser->setHook('bahnenregiontabelle', 'WrReport::bahnenregiontabelleParserHook');
+ $parser->setHook('rodelbahntabelle', 'WrReport::rodelbahntabelleParserHook');
+ $parser->setHook('avatar', 'WrReport::avatarParserHook');
+ return true;
+ }
+
/// \brief Is called when the tag <bahnberichtformular/> is encountered.
///
/// The current page name is taken.
}
+ function LanguageGetSpecialPageAliasesHook(&$specialPageArray, $languageCode) {
+ $text = wfMessage('wrreport')->text(); // 'Bahnberichte'
+ $title = Title::newFromText($text); // 'Bahnberichte'
+ $specialPageArray['wrreport'][] = $title->getDBKey(); // 'Bahnberichte'
+ return true;
+ }
+
+
+
/// \param $par Possibilities:
/// - action == 'view' (default)
/// - action == 'preview': Preview new report