Quick fix for regeneration of region overview pages after report entry (ticket #39)
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 28 Dec 2008 09:00:03 +0000 (09:00 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Sun, 28 Dec 2008 09:00:03 +0000 (09:00 +0000)
git-svn-id: http://www.winterrodeln.org/svn/servermediawiki/trunk/extensions/wrreport@366 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrreport.body.php

index a8c063f66ff289bbb42feb6b2af2e1ab6182552c..204ed31652f8ac7d38f02b4c8741508397cf74c6 100644 (file)
@@ -51,6 +51,20 @@ function wrReportAfterTidy(&$parser, &$text) {
 }
 
 
+/// Forces a regeneration of region overview pages
+function wrRecacheRegions() {
+       // TODO: Better implementation - it's a "quick fix" now.
+       $title = Title::newFromText('Tirol');
+       $title->invalidateCache();
+       
+       $title = Title::newFromText('Vorarlberg');
+       $title->invalidateCache();
+
+       $title = Title::newFromText('Steiermark');
+       $title->invalidateCache();
+}
+
+
 
 // Render Functions
 // ----------------
@@ -496,6 +510,8 @@ class WrReport extends SpecialPage {
 
                                // Purge cache
                                $title->invalidateCache();
+                               wrRecacheRegions();                             
+
                                // Show success message
                                global $wrShowReportsSection;
                                $wgOut->addWikiText(utf8_encode('<div class="successbox">Der Bahnbericht für [[') . $row['page_title'] . '#' . $wrShowReportsSection . '|' . $row['page_title'] . utf8_encode("]] wurde erfolgreich gelöscht.</div>\n"));
@@ -598,6 +614,8 @@ class WrReport extends SpecialPage {
 
                                // Purge cache
                                $title->invalidateCache();
+                               wrRecacheRegions();                             
+
                                // Show success message
                                global $wrShowReportsSection;
                                $wgOut->addWikiText(utf8_encode('<div class="successbox">Der Bahnbericht für [[') . $page_title . '#' . $wrShowReportsSection . '|' . $page_title . utf8_encode("]] wurde erfolgreich gespeichert.</div>\n"));