r84690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84689‎ | r84690 | r84691 >
Date:17:38, 24 March 2011
Author:demon
Status:ok
Tags:
Comment:
Partial revert r84686: Yaron wants to maintain b/c in these still
Modified paths:
  • /trunk/extensions/AdminLinks/AdminLinks_body.php (modified) (history)
  • /trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php (modified) (history)
  • /trunk/extensions/ApprovedRevs/ApprovedRevs_body.php (modified) (history)
  • /trunk/extensions/ApprovedRevs/SpecialApprovedRevs.php (modified) (history)
  • /trunk/extensions/ReplaceText/SpecialReplaceText.php (modified) (history)

Diff [purge]

Index: trunk/extensions/AdminLinks/AdminLinks_body.php
@@ -15,6 +15,11 @@
1616 */
1717 function __construct() {
1818 parent::__construct( 'AdminLinks' );
 19+ // deprecated in MW 1.16
 20+ global $wgVersion;
 21+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 22+ wfLoadExtensionMessages( 'AdminLinks' );
 23+ }
1924 global $wgUser;
2025 $this->skin = $wgUser->getSkin();
2126 }
@@ -85,6 +90,11 @@
8691 global $wgUser;
8792 // if user is a sysop, add link
8893 if ( $wgUser->isAllowed( 'adminlinks' ) ) {
 94+ // deprecated in MW 1.16
 95+ global $wgVersion;
 96+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 97+ wfLoadExtensionMessages( 'AdminLinks' );
 98+ }
8999 $al = SpecialPage::getTitleFor( 'AdminLinks' );
90100 $href = $al->getLocalURL();
91101 $admin_links_vals = array(
Index: trunk/extensions/ApprovedRevs/ApprovedRevs_body.php
@@ -232,4 +232,13 @@
233233 );
234234 $wgOut->addLink( $link );
235235 }
 236+
 237+ public static function loadMessages() {
 238+ // for backwards compatibility
 239+ global $wgVersion;
 240+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 241+ wfLoadExtensionMessages( 'ApprovedRevs' );
 242+ }
 243+ }
 244+
236245 }
Index: trunk/extensions/ApprovedRevs/SpecialApprovedRevs.php
@@ -13,6 +13,7 @@
1414 */
1515 function __construct() {
1616 parent::__construct( 'ApprovedRevs' );
 17+ ApprovedRevs::loadMessages();
1718 }
1819
1920 function execute( $query ) {
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php
@@ -171,6 +171,7 @@
172172 }
173173
174174 ApprovedRevs::addCSS();
 175+ ApprovedRevs::loadMessages();
175176
176177 $content = '';
177178
@@ -208,6 +209,7 @@
209210 }
210211
211212 ApprovedRevs::addCSS();
 213+ ApprovedRevs::loadMessages();
212214 if ( $revisionID == $article->getLatest() ) {
213215 $text = Xml::element(
214216 'span',
@@ -260,6 +262,7 @@
261263 $latestRevID = $title->getLatestRevID();
262264 if ( ! empty( $approvedRevID ) && $approvedRevID != $latestRevID ) {
263265 ApprovedRevs::addCSS();
 266+ ApprovedRevs::loadMessages();
264267 global $wgOut;
265268 $wgOut->addHTML( '<p class="approvedRevsEditWarning">' . wfMsg( 'approvedrevs-editwarning' ) . "</p>\n" );
266269 }
@@ -279,6 +282,7 @@
280283 $latestRevID = $wgTitle->getLatestRevID();
281284 if ( ! empty( $approvedRevID ) && $approvedRevID != $latestRevID ) {
282285 ApprovedRevs::addCSS();
 286+ ApprovedRevs::loadMessages();
283287 $preFormHTML .= '<p><strong>' . wfMsg( 'approvedrevs-editwarning' ) . "</strong></p>\n";
284288 }
285289 return true;
@@ -337,6 +341,8 @@
338342 // this will be null if there's no ID
339343 $approvedRevID = ApprovedRevs::getApprovedRevID( $article->getTitle() );
340344 $article->approvedRevID = $approvedRevID;
 345+ // also load extension messages, while we're at it
 346+ ApprovedRevs::loadMessages();
341347 return true;
342348 }
343349
Index: trunk/extensions/ReplaceText/SpecialReplaceText.php
@@ -6,7 +6,11 @@
77 * Constructor
88 */
99 public function __construct() {
 10+ global $wgVersion;
1011 parent::__construct( 'ReplaceText', 'replacetext' );
 12+ if ( version_compare( $wgVersion, '1.16', '<' ) ) {
 13+ wfLoadExtensionMessages( 'ReplaceText' );
 14+ }
1115 }
1216
1317 function execute( $query ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84686Remove wfLoadExtensionMessages() in all trunk extensions (do not backport)...demon17:04, 24 March 2011

Status & tagging log