r43020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43019‎ | r43020 | r43021 >
Date:20:19, 1 November 2008
Author:brion
Status:old
Tags:
Comment:
restore $wgCentralNoticeLoader option to disable client-end loading stuff
make $wgNoticeInfrastructure work properly w/ new classes
Modified paths:
  • /trunk/extensions/CentralNotice/CentralNotice.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/CentralNotice.php
@@ -65,6 +65,11 @@
6666 // All remaining options apply only to the infrastructure wiki.
6767 $wgNoticeInfrastructure = true;
6868
 69+// Enable the loader itself
 70+// Allows to control the loader visibility, without destroying infrastructure
 71+// for cached content
 72+$wgCentralNoticeLoader = true;
 73+
6974 // If true, notice only displays if 'sitenotice=yes' is in the query string
7075 $wgNoticeTestMode = false;
7176
@@ -99,23 +104,16 @@
100105 $dir = dirname( __FILE__ ) . '/';
101106
102107 $wgExtensionMessagesFiles['CentralNotice'] = $dir . 'CentralNotice.i18n.php';
103 -$wgAutoloadClasses['CentralNotice'] = $dir . 'SpecialCentralNotice.php';
104108
105 -$wgAvailableRights[] = 'centralnotice_admin_rights';
106 -$wgGroupPermissions['sysop']['centralnotice_admin_rights'] = true; // Only sysops can make change
107 -$wgGroupPermissions['sysop']['centralnotice_translate_rights'] = true; // Only sysops can make change
108 -
109 -$wgSpecialPages['CentralNotice'] = 'CentralNotice';
110 -$wgSpecialPages['NoticeTemplate'] = 'SpecialNoticeTemplate';
111 -$wgSpecialPageGroups['CentralNotice'] = 'wiki'; // Wiki data and tools"
112 -
113109 function efCentralNoticeSetup() {
114110 global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages;
115111 global $wgCentralNoticeLoader;
116112
117113 $dir = dirname( __FILE__ ) . '/';
118114
119 - $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeLoader';
 115+ if( $wgCentralNoticeLoader ) {
 116+ $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeLoader';
 117+ }
120118
121119 $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeLocalSaveHook';
122120 $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeLocalDeleteHook';
@@ -129,6 +127,15 @@
130128 $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeSaveHook';
131129 $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeDeleteHook';
132130
 131+ $wgAvailableRights[] = 'centralnotice_admin_rights';
 132+ $wgGroupPermissions['sysop']['centralnotice_admin_rights'] = true; // Only sysops can make change
 133+ $wgGroupPermissions['sysop']['centralnotice_translate_rights'] = true; // Only sysops can make change
 134+
 135+ $wgSpecialPages['CentralNotice'] = 'CentralNotice';
 136+ $wgSpecialPages['NoticeTemplate'] = 'SpecialNoticeTemplate';
 137+ $wgSpecialPageGroups['CentralNotice'] = 'wiki'; // Wiki data and tools"
 138+ $wgAutoloadClasses['CentralNotice'] = $dir . 'SpecialCentralNotice.php';
 139+
133140 $wgSpecialPages['NoticeLoader'] = 'SpecialNoticeLoader';
134141 $wgAutoloadClasses['SpecialNoticeLoader'] = $dir . 'SpecialNoticeLoader.php';
135142

Status & tagging log