r102944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102943‎ | r102944 | r102945 >
Date:07:54, 14 November 2011
Author:catrope
Status:ok
Tags:
Comment:
1.18wmf1: MFT r97887
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/Gadgets/Gadgets_body.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/Gadgets/Gadgets_body.php
@@ -16,7 +16,7 @@
1717
1818 /**
1919 * ArticleSaveComplete hook handler.
20 - *
 20+ *
2121 * @param $article Article
2222 * @param $user User
2323 * @param $text String: New page text
@@ -56,7 +56,7 @@
5757 public static function getPreferences( $user, &$preferences ) {
5858 $gadgets = Gadget::loadStructuredList();
5959 if (!$gadgets) return true;
60 -
 60+
6161 $options = array();
6262 $default = array();
6363 foreach( $gadgets as $section => $thisSection ) {
@@ -79,7 +79,7 @@
8080 $options = array_merge( $options, $available );
8181 }
8282 }
83 -
 83+
8484 $preferences['gadgets-intro'] =
8585 array(
8686 'type' => 'info',
@@ -91,8 +91,8 @@
9292 'raw' => 1,
9393 'rawrow' => 1,
9494 );
95 -
96 - $preferences['gadgets'] =
 95+
 96+ $preferences['gadgets'] =
9797 array(
9898 'type' => 'multiselect',
9999 'options' => $options,
@@ -101,7 +101,7 @@
102102 'prefix' => 'gadget-',
103103 'default' => $default,
104104 );
105 -
 105+
106106 return true;
107107 }
108108
@@ -129,7 +129,7 @@
130130 */
131131 public static function beforePageDisplay( $out ) {
132132 global $wgUser;
133 -
 133+
134134 wfProfileIn( __METHOD__ );
135135
136136 $gadgets = Gadget::loadList();
@@ -169,7 +169,7 @@
170170
171171 /**
172172 * Adds one legacy script to output.
173 - *
 173+ *
174174 * @param $page String: Unprefixed page title
175175 * @param $out OutputPage
176176 */
@@ -354,8 +354,8 @@
355355 * @return Boolean: Whether this gadget has resources that can be loaded via ResourceLoader
356356 */
357357 public function hasModule() {
358 - return count( $this->styles )
359 - + ( $this->supportsResourceLoader() ? count( $this->scripts ) : 0 )
 358+ return count( $this->styles )
 359+ + ( $this->supportsResourceLoader() ? count( $this->scripts ) : 0 )
360360 > 0;
361361 }
362362
@@ -506,12 +506,13 @@
507507 return $gadgets;
508508 }
509509
510 - $g = wfMsgForContentNoTrans( "gadgets-definition" );
511 - if ( wfEmptyMsg( "gadgets-definition", $g ) ) {
 510+ $g = wfMessage( "gadgets-definition" )->inContentLanguage();
 511+ if ( !$g->exists() ) {
512512 $gadgets = false;
513513 wfProfileOut( __METHOD__ );
514514 return $gadgets;
515515 }
 516+ $g = $g->plain();
516517 } else {
517518 $g = $forceNewText;
518519 }
Property changes on: branches/wmf/1.18wmf1/extensions/Gadgets/Gadgets_body.php
___________________________________________________________________
Modified: svn:mergeinfo
519520 Merged /trunk/extensions/Gadgets/Gadgets_body.php:r97887

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97887Replaced use of wfEmptyMsg() with new Message class. The underlying implement...aaron05:43, 23 September 2011

Status & tagging log