r69902 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r69901‎ | r69902 | r69903 >
Date:20:19, 25 July 2010
Author:platonides
Status:deferred
Tags:
Comment:
Add a needed global and remove double ones.
Modified paths:
  • /trunk/extensions/Translate/SpecialManageGroups.php (modified) (history)
  • /trunk/extensions/Translate/Translate.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslation.php (modified) (history)
  • /trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php (modified) (history)
  • /trunk/extensions/Translate/utils/MessageWebImporter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialManageGroups.php
@@ -120,7 +120,7 @@
121121 'class' => 'mw-translate-manage'
122122 );
123123
124 - global $wgRequest;
 124+ global $wgRequest, $wgLang;
125125 if (
126126 $wgRequest->wasPosted() &&
127127 $wgRequest->getBool( 'process', false ) &&
@@ -202,8 +202,6 @@
203203 $changed[] = '<ul>';
204204 }
205205
206 - global $wgRequest, $wgLang;
207 -
208206 $requestKey = str_replace( '.', '_', $key );
209207 $requestKey = str_replace( ' ', '_', $key );
210208 $action = $wgRequest->getVal( "action-$type-$key" );
@@ -306,7 +304,6 @@
307305 if ( $code === 'en' ) {
308306 $this->out->addWikiMsg( 'translate-manage-intro-en' );
309307 } else {
310 - global $wgLang;
311308 $lang = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() );
312309 $this->out->addWikiMsg( 'translate-manage-intro-other', $lang );
313310 }
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php
@@ -60,7 +60,7 @@
6161 $page = TranslatablePage::newFromTitle( $title );
6262 $page->removeTags();
6363 $page->getTitle()->invalidateCache();
64 - global $wgUser;
 64+
6565 $logger = new LogPage( 'pagetranslation' );
6666 $params = array( 'user' => $wgUser->getName() );
6767 $logger->addEntry( 'unmark', $page->getTitle(), null, array( serialize( $params ) ) );
Index: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php
@@ -141,9 +141,9 @@
142142 }
143143
144144 protected function doNormalMovePage() {
145 - global $action, $wgRequest;
 145+ global $wgRequest;
146146 $form = new MovePageForm( $this->oldTitle, $this->newTitle );
147 - if ( $action === 'submit' && $this->checkToken() && $wgRequest->wasPosted() ) {
 147+ if ( 'submit' == $wgRequest->getVal( 'action' ) && $this->checkToken() && $wgRequest->wasPosted() ) {
148148 $form->doSubmit();
149149 } else {
150150 $form->showForm( '' );
@@ -478,4 +478,4 @@
479479 return $this->page->getTitle()->getSubpages();
480480 }
481481
482 -}
\ No newline at end of file
 482+}
Index: trunk/extensions/Translate/Translate.php
@@ -473,7 +473,6 @@
474474 if ( $wgCommandLineMode ) return true;
475475
476476 $version = "3"; // Must be a string
477 - global $wgMemc;
478477 $memcKey = wfMemcKey( 'pt' );
479478 $ok = $wgMemc->get( $memcKey );
480479
@@ -534,7 +533,7 @@
535534 function wfAddNamespace( $id, $name ) {
536535 global $wgExtraNamespaces, $wgContentNamespaces,
537536 $wgTranslateMessageNamespaces, $wgNamespaceProtection,
538 - $wgNamespacesWithSubpages;
 537+ $wgNamespacesWithSubpages, $wgNamespacesToBeSearchedDefault;
539538
540539 $constant = strtoupper( "NS_$name" );
541540
Index: trunk/extensions/Translate/utils/MessageWebImporter.php
@@ -162,7 +162,7 @@
163163 $text = $diff->getDiff( '', '' );
164164 $type = 'changed';
165165
166 - global $wgRequest;
 166+ global $wgRequest, $wgLang;;
167167
168168 # Spaces don't seem to survive round trip in addition to dots
169169 # which are silently handled in getVal
@@ -175,8 +175,6 @@
176176 $changed[] = '<ul>';
177177 }
178178
179 - global $wgLang;
180 -
181179 if ( $action === null ) {
182180 $message = wfMsgExt( 'translate-manage-inconsistent', 'parseinline', wfEscapeWikiText( "action-$type-$key" ) );
183181 $changed[] = "<li>$message</li></ul>";
@@ -262,7 +260,6 @@
263261 if ( $code === 'en' ) {
264262 $this->out->addWikiMsg( 'translate-manage-intro-en' );
265263 } else {
266 - global $wgLang;
267264 $lang = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() );
268265 $this->out->addWikiMsg( 'translate-manage-intro-other', $lang );
269266 }

Status & tagging log