}
- /// Creates the HTML of the <bahnentabelle> and <bahnenregiontabelle> tags.
+ /// Creates the HTML of the <bahnentabelle>, <bahnenregiontabelle> and <rodelbahntabelle> tags.
private static function createBahnentabelle($page_titles) {
$dbr = wfGetDB(DB_SLAVE);
/// Description: See description of wrreport.php
public static function rodelbahntabelleParserHook($input, $args, $parser) {
$parser->getOutput()->addModules('ext.wrreport');
- $dbr = wfGetDB(DB_SLAVE);
+ // Add feed
+ // Note: As (of MediaWiki 1.19), only one feed can be added and each feed added replaces the previous one, the following is possible without risk of having duplicated feed entries.
+ WrReport::addRegionFeedLink($parser->getTitle());
+
+ $dbr = wfGetDB(DB_SLAVE);
try {
libxml_use_internal_errors(true); // without that, we get PHP Warnings if the $input is not well-formed
$xml = new SimpleXMLElement('<rodelbahntabelle>' . $input . '</rodelbahntabelle>'); // input
// <rodelbahn>
if ($tagname == 'rodelbahn') {
+ $page_title = Title::newFromText(trim($entry));
+ if ($page_title && $page_title->exists()) $page_ids[] = $page_title->getArticleID();
}
// <region>
// page_titles that are going to be returned
$page_titles = array();
- foreach ($page_id as $page_ids) {
+ foreach ($page_ids as $page_id) {
$page_titles[] = Title::newFromId($page_id);
}
$html = WrReport::createBahnentabelle($page_titles);