Index: trunk/extensions/CentralNotice/SpecialBannerLoader.php |
— | — | @@ -157,10 +157,10 @@ |
158 | 158 | } |
159 | 159 | |
160 | 160 | private function fetchUrl($url) { |
161 | | - $ctx = stream_context_create('http' => array( |
| 161 | + $ctx = stream_context_create(array('http' => array( |
162 | 162 | 'method' => "GET", |
163 | 163 | 'header' => "User-Agent: CentralNotice/1.0 (+http://www.mediawiki.org/wiki/Extension:CentralNotice)\r\n") |
164 | | - ); |
| 164 | + )); |
165 | 165 | wfSuppressWarnings(); |
166 | 166 | $content = file_get_contents( $url, false, $ctx); |
167 | 167 | wfRestoreWarnings(); |
Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php |
— | — | @@ -17,13 +17,13 @@ |
18 | 18 | * Handle different types of page requests |
19 | 19 | */ |
20 | 20 | function execute( $sub ) { |
21 | | - global $wgOut, $wgUser, $wgRequest, $wgScriptPath; |
| 21 | + global $wgOut, $wgUser, $wgRequest, $wgExtensionAssetsPath; |
22 | 22 | |
23 | 23 | // Begin output |
24 | 24 | $this->setHeaders(); |
25 | 25 | |
26 | 26 | // Add style file to the output headers |
27 | | - $wgOut->addExtensionStyle( "$wgScriptPath/extensions/CentralNotice/centralnotice.css" ); |
| 27 | + $wgOut->addExtensionStyle( "$wgExtensionAssetsPath/CentralNotice/centralnotice.css" ); |
28 | 28 | |
29 | 29 | // Add localized script error messages |
30 | 30 | $scriptVars = array( |
— | — | @@ -32,7 +32,7 @@ |
33 | 33 | $wgOut->addScript( Skin::makeVariablesScript( $scriptVars ) ); |
34 | 34 | |
35 | 35 | // Add script file to the output headers |
36 | | - $wgOut->addScriptFile( "$wgScriptPath/extensions/CentralNotice/centralnotice.js" ); |
| 36 | + $wgOut->addScriptFile( "$wgExtensionAssetsPath/CentralNotice/centralnotice.js" ); |
37 | 37 | |
38 | 38 | // Check permissions |
39 | 39 | $this->editable = $wgUser->isAllowed( 'centralnotice-admin' ); |
— | — | @@ -216,8 +216,8 @@ |
217 | 217 | * Show "Add a banner" interface |
218 | 218 | */ |
219 | 219 | function showAdd() { |
220 | | - global $wgOut, $wgUser, $wgScriptPath, $wgLang, $wgRequest; |
221 | | - $scriptPath = "$wgScriptPath/extensions/CentralNotice"; |
| 220 | + global $wgOut, $wgUser, $wgExtensionAssetsPath, $wgLang, $wgRequest; |
| 221 | + $scriptPath = "$wgExtensionAssetsPath/CentralNotice"; |
222 | 222 | |
223 | 223 | // Build HTML |
224 | 224 | $htmlOut = ''; |
— | — | @@ -291,9 +291,9 @@ |
292 | 292 | * View or edit an individual banner |
293 | 293 | */ |
294 | 294 | private function showView() { |
295 | | - global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgScriptPath, $wgLang; |
| 295 | + global $wgOut, $wgUser, $wgRequest, $wgLanguageCode, $wgExtensionAssetsPath, $wgLang; |
296 | 296 | |
297 | | - $scriptPath = "$wgScriptPath/extensions/CentralNotice"; |
| 297 | + $scriptPath = "$wgExtensionAssetsPath/CentralNotice"; |
298 | 298 | $sk = $wgUser->getSkin(); |
299 | 299 | |
300 | 300 | if ( $this->editable ) { |