Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -94,11 +94,17 @@ |
95 | 95 | 'scripts' => 'bannerstats.js', |
96 | 96 | ); |
97 | 97 | |
| 98 | +/** |
| 99 | + * UnitTestsList hook handler |
| 100 | + */ |
98 | 101 | function efCentralNoticeUnitTests( &$files ) { |
99 | 102 | $files[] = dirname( __FILE__ ) . '/tests/CentralNoticeTest.php'; |
100 | 103 | return true; |
101 | 104 | } |
102 | 105 | |
| 106 | +/** |
| 107 | + * Called through wgExtensionFunctions |
| 108 | + */ |
103 | 109 | function efCentralNoticeSetup() { |
104 | 110 | global $wgHooks, $wgNoticeInfrastructure, $wgAutoloadClasses, $wgSpecialPages; |
105 | 111 | global $wgCentralNoticeLoader, $wgSpecialPageGroups; |
— | — | @@ -151,6 +157,9 @@ |
152 | 158 | } |
153 | 159 | } |
154 | 160 | |
| 161 | +/** |
| 162 | + * LoadExtensionSchemaUpdates hook handler |
| 163 | + */ |
155 | 164 | function efCentralNoticeSchema( $updater = null ) { |
156 | 165 | $base = dirname( __FILE__ ); |
157 | 166 | if ( $updater === null ) { |
— | — | @@ -205,6 +214,9 @@ |
206 | 215 | return true; |
207 | 216 | } |
208 | 217 | |
| 218 | +/** |
| 219 | + * BeforePageDisplay hook handler |
| 220 | + */ |
209 | 221 | function efCentralNoticeLoader( $out, $skin ) { |
210 | 222 | global $wgOut; |
211 | 223 | |
— | — | @@ -217,12 +229,19 @@ |
218 | 230 | return true; |
219 | 231 | } |
220 | 232 | |
| 233 | +/** |
| 234 | + * SkinAfterBottomScripts hook handler |
| 235 | + */ |
221 | 236 | function efCentralNoticeGeoLoader( $skin, &$text ) { |
222 | 237 | // Insert the geo IP lookup |
223 | 238 | $text .= Html::linkedScript( "//geoiplookup.wikimedia.org/" ); |
224 | 239 | return true; |
225 | 240 | } |
226 | 241 | |
| 242 | + |
| 243 | +/** |
| 244 | + * MakeGlobalVariablesScript hook handler |
| 245 | + */ |
227 | 246 | function efCentralNoticeDefaults( &$vars ) { |
228 | 247 | global $wgNoticeProject; |
229 | 248 | // Initialize global Javascript variables. We initialize Geo with empty values so if the geo |
— | — | @@ -235,6 +254,9 @@ |
236 | 255 | return true; |
237 | 256 | } |
238 | 257 | |
| 258 | +/** |
| 259 | + * SiteNoticeAfter hook handler |
| 260 | + */ |
239 | 261 | function efCentralNoticeDisplay( &$notice ) { |
240 | 262 | // setup siteNotice div |
241 | 263 | $notice = |