Basic support for displaying individual sledruns now.
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 15 Jan 2014 20:24:41 +0000 (20:24 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Wed, 15 Jan 2014 20:24:41 +0000 (20:24 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/mediawiki_extensions/wrreport/trunk@1878 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrreport.body.php

index 5b1eb43ab162db2deaae567302b563182b0fb560..c09d795944bb61c69a5d86ae06fa6a85e659b613 100644 (file)
@@ -665,7 +665,7 @@ class WrReport {
        }
 
 
-       /// 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);
 
@@ -880,8 +880,12 @@ class WrReport {
        /// 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
@@ -925,6 +929,8 @@ class WrReport {
 
                                // <rodelbahn>
                                if ($tagname == 'rodelbahn') {
+                                       $page_title = Title::newFromText(trim($entry));
+                                       if ($page_title && $page_title->exists()) $page_ids[] = $page_title->getArticleID();
                                }
 
                                // <region>
@@ -949,7 +955,7 @@ class WrReport {
 
                        // 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);