Index: trunk/extensions/Collection/Collection.php |
— | — | @@ -370,10 +370,8 @@ |
371 | 371 | $wgAjaxExportList[] = 'wfAjaxCollectionClear'; |
372 | 372 | |
373 | 373 | function wfAjaxCollectionGetPopupData( $title ) { |
374 | | - global $wgScriptPath; |
375 | | - |
376 | 374 | $result = array(); |
377 | | - $imagePath = "$wgScriptPath/extensions/Collection/images"; |
| 375 | + $imagePath = SpecialCollection::getMediaPath(); |
378 | 376 | $t = Title::newFromText( $title ); |
379 | 377 | if ( $t && $t->isRedirect() ) { |
380 | 378 | $a = new Article( $t, 0 ); |
Index: trunk/extensions/Collection/Collection.hooks.php |
— | — | @@ -234,10 +234,9 @@ |
235 | 235 | static function renderBookCreatorBox( $title, $mode = '' ) { |
236 | 236 | global $wgCollectionStyleVersion; |
237 | 237 | global $wgOut; |
238 | | - global $wgScriptPath; |
239 | 238 | global $wgRequest; |
240 | 239 | |
241 | | - $imagePath = "$wgScriptPath/extensions/Collection/images"; |
| 240 | + $imagePath = SpecialCollection::getMediaPath(); |
242 | 241 | $ptext = $title->getPrefixedText(); |
243 | 242 | $oldid = $wgRequest->getVal( 'oldid', 0 ); |
244 | 243 | if ( $oldid == $title->getLatestRevID() ) { |
— | — | @@ -318,10 +317,8 @@ |
319 | 318 | } |
320 | 319 | |
321 | 320 | static function getBookCreatorBoxContent( $title, $ajaxHint = null, $oldid = null ) { |
322 | | - global $wgScriptPath; |
| 321 | + $imagePath = SpecialCollection::getMediaPath(); |
323 | 322 | |
324 | | - $imagePath = "$wgScriptPath/extensions/Collection/images"; |
325 | | - |
326 | 323 | return self::getBookCreatorBoxAddRemoveLink( $imagePath, $ajaxHint, $title, $oldid ) |
327 | 324 | . self::getBookCreatorBoxShowBookLink( $imagePath, $ajaxHint ) |
328 | 325 | . self::getBookCreatorBoxSuggestLink( $imagePath, $ajaxHint ); |
Index: trunk/extensions/Collection/Collection.body.php |
— | — | @@ -1255,4 +1255,16 @@ |
1256 | 1256 | return $json_response; |
1257 | 1257 | } |
1258 | 1258 | |
| 1259 | + /** |
| 1260 | + * @return string URL prefix to images |
| 1261 | + */ |
| 1262 | + static function getMediaPath() { |
| 1263 | + if ( isset ( $GLOBALS['wgExtensionAssetsPath'] ) ) { |
| 1264 | + return $GLOBALS['wgExtensionAssetsPath'] . '/Collection/images/'; |
| 1265 | + } else { |
| 1266 | + return $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/'; |
| 1267 | + } |
| 1268 | + |
| 1269 | + } |
| 1270 | + |
1259 | 1271 | } |
Index: trunk/extensions/Collection/Collection.templates.php |
— | — | @@ -12,7 +12,7 @@ |
13 | 13 | */ |
14 | 14 | class CollectionPageTemplate extends QuickTemplate { |
15 | 15 | function execute() { |
16 | | - $mediapath = $GLOBALS['wgExtensionAssetsPath'] . '/Collection/images/'; |
| 16 | + $mediapath = SpecialCollection::getMediaPath(); |
17 | 17 | ?> |
18 | 18 | |
19 | 19 | <div class="collection-column collection-column-left"> |
— | — | @@ -202,7 +202,7 @@ |
203 | 203 | */ |
204 | 204 | class CollectionListTemplate extends QuickTemplate { |
205 | 205 | function execute() { |
206 | | - $mediapath = $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/'; |
| 206 | + $mediapath = SpecialCollection::getMediaPath(); |
207 | 207 | ?> |
208 | 208 | |
209 | 209 | <div class="collection-create-chapter-links"> |
— | — | @@ -453,9 +453,9 @@ |
454 | 454 | |
455 | 455 | // needed for Ajax functions |
456 | 456 | function getProposalList () { |
457 | | - global $wgScript, $wgScriptPath; |
| 457 | + global $wgScript; |
458 | 458 | |
459 | | - $mediapath = $wgScriptPath . '/extensions/Collection/images/'; |
| 459 | + $mediapath = SpecialCollection::getMediaPath(); |
460 | 460 | $baseUrl = $wgScript . "/"; |
461 | 461 | |
462 | 462 | $prop = $this->data['proposals']; |
— | — | @@ -492,7 +492,7 @@ |
493 | 493 | |
494 | 494 | // needed for Ajax functions |
495 | 495 | function getMemberList() { |
496 | | - $mediapath = $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/'; |
| 496 | + $mediapath = SpecialCollection::getMediaPath(); |
497 | 497 | $coll = $this->data['collection']; |
498 | 498 | $out = ''; |
499 | 499 | |