Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -65,6 +65,11 @@ |
66 | 66 | // All remaining options apply only to the infrastructure wiki. |
67 | 67 | $wgNoticeInfrastructure = true; |
68 | 68 | |
| 69 | +// Enable the loader itself |
| 70 | +// Allows to control the loader visibility, without destroying infrastructure |
| 71 | +// for cached content |
| 72 | +$wgCentralNoticeLoader = true; |
| 73 | + |
69 | 74 | // If true, notice only displays if 'sitenotice=yes' is in the query string |
70 | 75 | $wgNoticeTestMode = false; |
71 | 76 | |
— | — | @@ -99,23 +104,16 @@ |
100 | 105 | $dir = dirname( __FILE__ ) . '/'; |
101 | 106 | |
102 | 107 | $wgExtensionMessagesFiles['CentralNotice'] = $dir . 'CentralNotice.i18n.php'; |
103 | | -$wgAutoloadClasses['CentralNotice'] = $dir . 'SpecialCentralNotice.php'; |
104 | 108 | |
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 | | - |
113 | 109 | function efCentralNoticeSetup() { |
114 | 110 | global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages; |
115 | 111 | global $wgCentralNoticeLoader; |
116 | 112 | |
117 | 113 | $dir = dirname( __FILE__ ) . '/'; |
118 | 114 | |
119 | | - $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeLoader'; |
| 115 | + if( $wgCentralNoticeLoader ) { |
| 116 | + $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeLoader'; |
| 117 | + } |
120 | 118 | |
121 | 119 | $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeLocalSaveHook'; |
122 | 120 | $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeLocalDeleteHook'; |
— | — | @@ -129,6 +127,15 @@ |
130 | 128 | $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeSaveHook'; |
131 | 129 | $wgHooks['ArticleSaveComplete'][] = 'efCentralNoticeDeleteHook'; |
132 | 130 | |
| 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 | + |
133 | 140 | $wgSpecialPages['NoticeLoader'] = 'SpecialNoticeLoader'; |
134 | 141 | $wgAutoloadClasses['SpecialNoticeLoader'] = $dir . 'SpecialNoticeLoader.php'; |
135 | 142 | |