r29585 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r29584‎ | r29585 | r29586 >
Date:12:12, 11 January 2008
Author:midom
Status:old
Tags:
Comment:
allow disabling the loader with infrastructure still on
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -19,6 +19,11 @@
2020 /// All remaining options apply only to the infrastructure wiki.
2121 $wgNoticeInfrastructure = false;
2222
 23+/// Enable the loader itself
 24+/// Allows to control the loader visibility, without destroying infrastructure
 25+/// for cached content
 26+$wgCentralNoticeLoader = true;
 27+
2328 /// URL prefix to the raw-text loader special.
2429 /// Project/language and timestamp epoch keys get appended to this
2530 /// via the loader stub.
@@ -55,7 +60,12 @@
5661 function efCentralNoticeSetup() {
5762 global $wgHooks, $wgNoticeInfrastructure;
5863 global $wgAutoloadClasses, $wgSpecialPages;
59 - $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeLoader';
 64+
 65+ global $wgCentralNoticeLoader;
 66+
 67+ if ($wgCentralNoticeLoader) {
 68+ $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeLoader';
 69+ }
6070
6171 $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeLocalSaveHook';
6272 $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeLocalDeleteHook';

Status & tagging log