Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -119,11 +119,18 @@ |
120 | 120 | global $wgCentralNoticeLoader, $wgSpecialPageGroups; |
121 | 121 | |
122 | 122 | $dir = dirname( __FILE__ ) . '/'; |
123 | | - |
| 123 | + |
| 124 | + // Update the database schema if necessary |
| 125 | + $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCentralNoticeSchema'; |
| 126 | + |
| 127 | + // If CentralNotice banners should be shown on this wiki, load the components we need for |
| 128 | + // showing banners. For discussion of banner loading strategies, see |
| 129 | + // http://wikitech.wikimedia.org/view/CentralNotice/Optimizing_banner_loading |
124 | 130 | if ( $wgCentralNoticeLoader ) { |
125 | | - $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCentralNoticeSchema'; |
| 131 | + $wgHooks['MakeGlobalVariablesScript'][] = 'efCentralNoticeDefaults'; |
| 132 | + // NOTE: We might want to change efCentralNoticeLoader to use the SkinAfterBottomScripts |
| 133 | + // hook instead of BeforePageDisplay. See bug 34572. |
126 | 134 | $wgHooks['BeforePageDisplay'][] = 'efCentralNoticeLoader'; |
127 | | - $wgHooks['MakeGlobalVariablesScript'][] = 'efCentralNoticeDefaults'; |
128 | 135 | $wgHooks['SiteNoticeAfter'][] = 'efCentralNoticeDisplay'; |
129 | 136 | $wgHooks['SkinAfterBottomScripts'][] = 'efCentralNoticeGeoLoader'; |
130 | 137 | } |