r78502 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78501‎ | r78502 | r78503 >
Date:18:13, 16 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Replaced calls to wfLoadExtensionMessages() with calls to new SFUtils::loadMessages() function, for compatibility with all MW versions
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormEditPage.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_FormEditTab.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_LinkUtils.php (modified) (history)
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateCategory.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateClass.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateForm.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateProperty.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_FormEdit.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_FormStart.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_Forms.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_RunQuery.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_Templates.php (modified) (history)
  • /trunk/extensions/SemanticForms/specials/SF_UploadWindow.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_CreateCategory.php
@@ -15,7 +15,7 @@
1616 */
1717 function __construct() {
1818 parent::__construct( 'CreateCategory' );
19 - wfLoadExtensionMessages( 'SemanticForms' );
 19+ SFUtils::loadMessages();
2020 }
2121
2222 function execute( $query ) {
@@ -24,7 +24,7 @@
2525 }
2626
2727 static function createCategoryText( $default_form, $category_name, $parent_category ) {
28 - wfLoadExtensionMessages( 'SemanticForms' );
 28+ SFUtils::loadMessages();
2929
3030 if ( $default_form == '' ) {
3131 $text = wfMsgForContent( 'sf_category_desc', $category_name );
@@ -47,7 +47,7 @@
4848 function doSpecialCreateCategory() {
4949 global $wgOut, $wgRequest, $wgUser, $sfgScriptPath;
5050
51 - wfLoadExtensionMessages( 'SemanticForms' );
 51+ SFUtils::loadMessages();
5252
5353 # cycle through the query values, setting the appropriate local variables
5454 $category_name = $wgRequest->getVal( 'category_name' );
Index: trunk/extensions/SemanticForms/specials/SF_FormStart.php
@@ -15,7 +15,7 @@
1616 */
1717 function __construct() {
1818 parent::__construct( 'FormStart' );
19 - wfLoadExtensionMessages( 'SemanticForms' );
 19+ SFUtils::loadMessages();
2020 }
2121
2222 function execute( $query ) {
@@ -23,7 +23,7 @@
2424
2525 $this->setHeaders();
2626
27 - wfLoadExtensionMessages( 'SemanticForms' );
 27+ SFUtils::loadMessages();
2828 $form_name = $wgRequest->getVal( 'form' );
2929 $target_namespace = $wgRequest->getVal( 'namespace' );
3030 $super_page = $wgRequest->getVal( 'super_page' );
Index: trunk/extensions/SemanticForms/specials/SF_Forms.php
@@ -14,7 +14,7 @@
1515 */
1616 function __construct() {
1717 parent::__construct( 'Forms' );
18 - wfLoadExtensionMessages( 'SemanticForms' );
 18+ SFUtils::loadMessages();
1919 }
2020
2121 function execute( $query ) {
@@ -37,7 +37,7 @@
3838 function getPageHeader() {
3939 global $wgUser;
4040
41 - wfLoadExtensionMessages( 'SemanticForms' );
 41+ SFUtils::loadMessages();
4242
4343 $sk = $wgUser->getSkin();
4444 $cf = SpecialPage::getPage( 'CreateForm' );
Index: trunk/extensions/SemanticForms/specials/SF_CreateForm.php
@@ -15,7 +15,7 @@
1616 */
1717 function __construct() {
1818 parent::__construct( 'CreateForm' );
19 - wfLoadExtensionMessages( 'SemanticForms' );
 19+ SFUtils::loadMessages();
2020 }
2121
2222 function execute( $query ) {
@@ -28,7 +28,7 @@
2929 global $wgOut, $wgRequest, $wgUser, $sfgScriptPath, $wgContLang;
3030 $db = wfGetDB( DB_SLAVE );
3131
32 - wfLoadExtensionMessages( 'SemanticForms' );
 32+ SFUtils::loadMessages();
3333
3434 # get the names of all templates on this site
3535 $all_templates = array();
Index: trunk/extensions/SemanticForms/specials/SF_CreateProperty.php
@@ -15,7 +15,7 @@
1616 */
1717 function __construct() {
1818 parent::__construct( 'CreateProperty' );
19 - wfLoadExtensionMessages( 'SemanticForms' );
 19+ SFUtils::loadMessages();
2020 }
2121
2222 function execute( $query ) {
@@ -62,7 +62,7 @@
6363 global $wgOut, $wgRequest, $sfgScriptPath;
6464 global $smwgContLang;
6565
66 - wfLoadExtensionMessages( 'SemanticForms' );
 66+ SFUtils::loadMessages();
6767
6868 # cycle through the query values, setting the appropriate local variables
6969 $property_name = $wgRequest->getVal( 'property_name' );
Index: trunk/extensions/SemanticForms/specials/SF_CreateClass.php
@@ -16,7 +16,7 @@
1717 */
1818 public function __construct() {
1919 parent::__construct( 'CreateClass', 'createclass' );
20 - wfLoadExtensionMessages( 'SemanticForms' );
 20+ SFUtils::loadMessages();
2121 }
2222
2323 function execute( $query ) {
Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
@@ -14,7 +14,7 @@
1515 */
1616 function __construct() {
1717 parent::__construct( 'FormEdit' );
18 - wfLoadExtensionMessages( 'SemanticForms' );
 18+ SFUtils::loadMessages();
1919 }
2020
2121 function execute( $query ) {
@@ -57,7 +57,7 @@
5858 static function printForm( $form_name, $target_name, $alt_forms = array() ) {
5959 global $wgOut, $wgRequest, $wgScriptPath, $sfgScriptPath, $sfgFormPrinter;
6060
61 - wfLoadExtensionMessages( 'SemanticForms' );
 61+ SFUtils::loadMessages();
6262
6363 // initialize some variables
6464 $target_title = null;
Index: trunk/extensions/SemanticForms/specials/SF_RunQuery.php
@@ -14,7 +14,7 @@
1515 */
1616 function __construct() {
1717 parent::__construct( 'RunQuery' );
18 - wfLoadExtensionMessages( 'SemanticForms' );
 18+ SFUtils::loadMessages();
1919 }
2020
2121 function execute( $query ) {
Index: trunk/extensions/SemanticForms/specials/SF_UploadWindow.php
@@ -24,7 +24,7 @@
2525 */
2626 function __construct() {
2727 parent::__construct( 'UploadWindow' );
28 - wfLoadExtensionMessages( 'SemanticForms' );
 28+ SFUtils::loadMessages();
2929 }
3030
3131 function execute( $query ) {
Index: trunk/extensions/SemanticForms/specials/SF_Templates.php
@@ -14,7 +14,7 @@
1515 */
1616 function __construct() {
1717 parent::__construct( 'Templates' );
18 - wfLoadExtensionMessages( 'SemanticForms' );
 18+ SFUtils::loadMessages();
1919 }
2020
2121 function execute( $query ) {
@@ -37,7 +37,7 @@
3838 function getPageHeader() {
3939 global $wgUser;
4040
41 - wfLoadExtensionMessages( 'SemanticForms' );
 41+ SFUtils::loadMessages();
4242
4343 $sk = $wgUser->getSkin();
4444 $ct = SpecialPage::getPage( 'CreateTemplate' );
@@ -83,7 +83,7 @@
8484 }
8585
8686 function formatResult( $skin, $result ) {
87 - wfLoadExtensionMessages( 'SemanticForms' );
 87+ SFUtils::loadMessages();
8888 $title = Title::makeTitle( NS_TEMPLATE, $result->value );
8989 $text = $skin->makeLinkObj( $title, $title->getText() );
9090 $category = $this->getCategoryDefinedByTemplate( new Article( $title ) );
Index: trunk/extensions/SemanticForms/specials/SF_CreateTemplate.php
@@ -19,7 +19,7 @@
2020 */
2121 public function SFCreateTemplate() {
2222 parent::__construct( 'CreateTemplate' );
23 - wfLoadExtensionMessages( 'SemanticForms' );
 23+ SFUtils::loadMessages();
2424 }
2525
2626 public function execute( $query ) {
@@ -66,7 +66,7 @@
6767 }
6868
6969 public static function printFieldEntryBox( $id, $f, $all_properties ) {
70 - wfLoadExtensionMessages( 'SemanticForms' );
 70+ SFUtils::loadMessages();
7171 $dropdown_html = SFCreateTemplate::printPropertiesDropdown( $all_properties, $id, $f->semantic_property );
7272
7373 $text = ' <div class="fieldBox">' . "\n";
@@ -93,7 +93,7 @@
9494 function doSpecialCreateTemplate() {
9595 global $wgOut, $wgRequest, $wgUser, $sfgScriptPath, $wgContLang;
9696
97 - wfLoadExtensionMessages( 'SemanticForms' );
 97+ SFUtils::loadMessages();
9898
9999 $all_properties = SFCreateTemplate::getAllPropertyNames();
100100
Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -324,7 +324,7 @@
325325 ) . "\n";
326326 }
327327 }
328 - wfLoadExtensionMessages( 'SemanticForms' );
 328+ SFUtils::loadMessages();
329329 $button_str = ( $inButtonStr != '' ) ? $inButtonStr : wfMsg( 'sf_formstart_createoredit' );
330330 $str .= <<<END
331331 <input type="submit" value="$button_str" /></p>
Index: trunk/extensions/SemanticForms/includes/SF_FormEditPage.php
@@ -13,7 +13,7 @@
1414 function __construct( $article, $form_name = '' ) {
1515 global $wgRequest;
1616 parent::__construct( $article );
17 - wfLoadExtensionMessages( 'SemanticForms' );
 17+ SFUtils::loadMessages();
1818 $this->action = 'formedit';
1919 $form_name = $wgRequest->getText( 'form', $form_name );
2020 $this->form = Title::makeTitleSafe( SF_NS_FORM, $form_name );
Index: trunk/extensions/SemanticForms/includes/SF_LinkUtils.php
@@ -232,7 +232,7 @@
233233 if ( '' === $namespace ) {
234234 // if it's in the main (blank) namespace, check for the
235235 // file named with the word for "Main" in this language
236 - wfLoadExtensionMessages( 'SemanticForms' );
 236+ SFUtils::loadMessages();
237237 $namespace = wfMsgForContent( 'sf_blank_namespace' );
238238 }
239239 if ( $form_edit_link = self::getFormEditLinkForPage( $title, $namespace, NS_PROJECT ) ) {
@@ -301,7 +301,7 @@
302302 if ( NS_MAIN === $namespace ) {
303303 // if it's in the main (blank) namespace, check for the
304304 // file named with the word for "Main" in this language
305 - wfLoadExtensionMessages( 'SemanticForms' );
 305+ SFUtils::loadMessages();
306306 $namespace_label = wfMsgForContent( 'sf_blank_namespace' );
307307 } else {
308308 global $wgContLang;
Index: trunk/extensions/SemanticForms/includes/SF_FormEditTab.php
@@ -25,7 +25,7 @@
2626 global $wgRequest, $wgUser;
2727 global $sfgRenameEditTabs, $sfgRenameMainEditTab;
2828
29 - wfLoadExtensionMessages( 'SemanticForms' );
 29+ SFUtils::loadMessages();
3030
3131 $user_can_edit = $wgUser->isAllowed( 'edit' ) && $obj->mTitle->userCan( 'edit' );
3232 // create the form edit tab, and apply whatever
@@ -131,7 +131,7 @@
132132 return true;
133133 }
134134 if ( count( $form_names ) > 1 ) {
135 - wfLoadExtensionMessages( 'SemanticForms' );
 135+ SFUtils::loadMessages();
136136 $warning_text = ' <div class="warningMessage">' . wfMsg( 'sf_formedit_morethanoneform' ) . "</div>\n";
137137 global $wgOut;
138138 $wgOut->addHTML( $warning_text );

Status & tagging log