r113785 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113784‎ | r113785 | r113786 >
Date:23:20, 13 March 2012
Author:saper
Status:reverted (Comments)
Tags:gerritmigration 
Comment:
Followup-To: r113740 $wgScriptPath/extensions/ => $wgExtensionAssetsPath

Per code review
Modified paths:
  • /trunk/extensions/Collection/Collection.body.php (modified) (history)
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)
  • /trunk/extensions/Collection/Collection.php (modified) (history)
  • /trunk/extensions/Collection/Collection.templates.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.php
@@ -370,10 +370,8 @@
371371 $wgAjaxExportList[] = 'wfAjaxCollectionClear';
372372
373373 function wfAjaxCollectionGetPopupData( $title ) {
374 - global $wgScriptPath;
375 -
376374 $result = array();
377 - $imagePath = "$wgScriptPath/extensions/Collection/images";
 375+ $imagePath = SpecialCollection::getMediaPath();
378376 $t = Title::newFromText( $title );
379377 if ( $t && $t->isRedirect() ) {
380378 $a = new Article( $t, 0 );
Index: trunk/extensions/Collection/Collection.hooks.php
@@ -234,10 +234,9 @@
235235 static function renderBookCreatorBox( $title, $mode = '' ) {
236236 global $wgCollectionStyleVersion;
237237 global $wgOut;
238 - global $wgScriptPath;
239238 global $wgRequest;
240239
241 - $imagePath = "$wgScriptPath/extensions/Collection/images";
 240+ $imagePath = SpecialCollection::getMediaPath();
242241 $ptext = $title->getPrefixedText();
243242 $oldid = $wgRequest->getVal( 'oldid', 0 );
244243 if ( $oldid == $title->getLatestRevID() ) {
@@ -318,10 +317,8 @@
319318 }
320319
321320 static function getBookCreatorBoxContent( $title, $ajaxHint = null, $oldid = null ) {
322 - global $wgScriptPath;
 321+ $imagePath = SpecialCollection::getMediaPath();
323322
324 - $imagePath = "$wgScriptPath/extensions/Collection/images";
325 -
326323 return self::getBookCreatorBoxAddRemoveLink( $imagePath, $ajaxHint, $title, $oldid )
327324 . self::getBookCreatorBoxShowBookLink( $imagePath, $ajaxHint )
328325 . self::getBookCreatorBoxSuggestLink( $imagePath, $ajaxHint );
Index: trunk/extensions/Collection/Collection.body.php
@@ -1255,4 +1255,16 @@
12561256 return $json_response;
12571257 }
12581258
 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+
12591271 }
Index: trunk/extensions/Collection/Collection.templates.php
@@ -12,7 +12,7 @@
1313 */
1414 class CollectionPageTemplate extends QuickTemplate {
1515 function execute() {
16 - $mediapath = $GLOBALS['wgExtensionAssetsPath'] . '/Collection/images/';
 16+ $mediapath = SpecialCollection::getMediaPath();
1717 ?>
1818
1919 <div class="collection-column collection-column-left">
@@ -202,7 +202,7 @@
203203 */
204204 class CollectionListTemplate extends QuickTemplate {
205205 function execute() {
206 - $mediapath = $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/';
 206+ $mediapath = SpecialCollection::getMediaPath();
207207 ?>
208208
209209 <div class="collection-create-chapter-links">
@@ -453,9 +453,9 @@
454454
455455 // needed for Ajax functions
456456 function getProposalList () {
457 - global $wgScript, $wgScriptPath;
 457+ global $wgScript;
458458
459 - $mediapath = $wgScriptPath . '/extensions/Collection/images/';
 459+ $mediapath = SpecialCollection::getMediaPath();
460460 $baseUrl = $wgScript . "/";
461461
462462 $prop = $this->data['proposals'];
@@ -492,7 +492,7 @@
493493
494494 // needed for Ajax functions
495495 function getMemberList() {
496 - $mediapath = $GLOBALS['wgScriptPath'] . '/extensions/Collection/images/';
 496+ $mediapath = SpecialCollection::getMediaPath();
497497 $coll = $this->data['collection'];
498498 $out = '';
499499

Follow-up revisions

RevisionCommit summaryAuthorDate
r114399Revert r113740 and its followups r113785, r113985, r113986, r113988, r113991,...catrope19:56, 21 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113740(bug 33536) Make a list of print on demand publishers configurable for Extens...saper18:15, 13 March 2012

Comments

#Comment by Hashar (talk | contribs)   09:24, 24 March 2012

Was change https://gerrit.wikimedia.org/r/3441

Abandoned and squashed in https://gerrit.wikimedia.org/r/3440 (patchset 3)

Status & tagging log