Index: trunk/extensions/Translate/SpecialManageGroups.php |
— | — | @@ -155,10 +155,10 @@ |
156 | 156 | |
157 | 157 | $this->out->addHTML( |
158 | 158 | Xml::openElement( 'form', $formParams ) . |
159 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
160 | | - Xml::hidden( 'token', $this->user->editToken() ) . |
161 | | - Xml::hidden( 'group', $group->getId() ) . |
162 | | - Xml::hidden( 'process', 1 ) |
| 159 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 160 | + Html::hidden( 'token', $this->user->editToken() ) . |
| 161 | + Html::hidden( 'group', $group->getId() ) . |
| 162 | + Html::hidden( 'process', 1 ) |
163 | 163 | ); |
164 | 164 | |
165 | 165 | // BEGIN |
— | — | @@ -330,7 +330,7 @@ |
331 | 331 | $lang = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ); |
332 | 332 | $this->out->addWikiMsg( 'translate-manage-intro-other', $lang ); |
333 | 333 | } |
334 | | - $this->out->addHTML( Xml::hidden( 'language', $code ) ); |
| 334 | + $this->out->addHTML( Html::hidden( 'language', $code ) ); |
335 | 335 | $this->out->addHTML( implode( "\n", $changed ) ); |
336 | 336 | $this->out->addHTML( Xml::submitButton( wfMsg( 'translate-manage-submit' ) ) ); |
337 | 337 | } else { |
— | — | @@ -398,11 +398,11 @@ |
399 | 399 | |
400 | 400 | $this->out->addHTML( |
401 | 401 | Xml::openElement( 'form', $formParams ) . |
402 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
403 | | - Xml::hidden( 'token', $this->user->editToken() ) . |
404 | | - Xml::hidden( 'group', $group->getId() ) . |
405 | | - Xml::hidden( 'codes', implode( ',', $codes ) ) . |
406 | | - Xml::hidden( 'rebuildall', 1 ) . |
| 402 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 403 | + Html::hidden( 'token', $this->user->editToken() ) . |
| 404 | + Html::hidden( 'group', $group->getId() ) . |
| 405 | + Html::hidden( 'codes', implode( ',', $codes ) ) . |
| 406 | + Html::hidden( 'rebuildall', 1 ) . |
407 | 407 | Xml::submitButton( wfMsg( 'translate-manage-import-rebuild-all' ) ) . |
408 | 408 | Xml::closeElement( 'form' ) |
409 | 409 | ); |
Index: trunk/extensions/Translate/TranslatePage.php |
— | — | @@ -31,7 +31,7 @@ |
32 | 32 | * Access point for this special page. |
33 | 33 | */ |
34 | 34 | public function execute( $parameters ) { |
35 | | - global $wgOut, $wgTranslateBlacklist, $wgUser, $wgRequest; |
| 35 | + global $wgOut, $wgTranslateBlacklist, $wgRequest; |
36 | 36 | |
37 | 37 | TranslateUtils::injectCSS(); |
38 | 38 | |
— | — | @@ -193,10 +193,6 @@ |
194 | 194 | protected function settingsForm( $errors ) { |
195 | 195 | global $wgScript; |
196 | 196 | |
197 | | - $task = $this->taskSelector(); |
198 | | - $group = $this->groupSelector(); |
199 | | - $language = $this->languageSelector(); |
200 | | - $limit = $this->limitSelector(); |
201 | 197 | $button = Xml::submitButton( wfMsg( 'translate-submit' ) ); |
202 | 198 | |
203 | 199 | $options = array(); |
— | — | @@ -213,7 +209,7 @@ |
214 | 210 | Xml::openElement( 'fieldset', array( 'class' => 'mw-sp-translate-settings' ) ) . |
215 | 211 | Xml::element( 'legend', null, wfMsg( 'translate-page-settings-legend' ) ) . |
216 | 212 | Xml::openElement( 'form', array( 'action' => $wgScript, 'method' => 'get' ) ) . |
217 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 213 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
218 | 214 | Xml::openElement( 'table' ) . |
219 | 215 | implode( "", $options ) . |
220 | 216 | self::optionRow( $button, ' ' ) . |
Index: trunk/extensions/Translate/scripts/magic-export.php |
— | — | @@ -263,7 +263,7 @@ |
264 | 264 | protected function writeFooters() { |
265 | 265 | $this->output( "Writing file footers...\n" ); |
266 | 266 | if( $this->type === 'special' ) { |
267 | | - foreach( $this->handles as $group => $handle ) { |
| 267 | + foreach( $this->handles as $handle ) { |
268 | 268 | fwrite( $handle, <<<PHP |
269 | 269 | |
270 | 270 | |
— | — | @@ -282,7 +282,7 @@ |
283 | 283 | */ |
284 | 284 | protected function closeHandles() { |
285 | 285 | $this->output( "Closing file handles...\n" ); |
286 | | - foreach ( $this->handles as $group => $handle ) { |
| 286 | + foreach ( $this->handles as $handle ) { |
287 | 287 | fclose( $handle ); |
288 | 288 | } |
289 | 289 | } |
Index: trunk/extensions/Translate/scripts/cldr-plural-to-yaml.php |
— | — | @@ -35,7 +35,7 @@ |
36 | 36 | $doc->load( 'plurals.xml' ); |
37 | 37 | |
38 | 38 | $rulesets = $doc->getElementsByTagName( "pluralRules" ); |
39 | | - foreach( $rulesets as $index => $ruleset ) { |
| 39 | + foreach( $rulesets as $ruleset ) { |
40 | 40 | $codes = $ruleset->getAttribute( 'locales' ); |
41 | 41 | $parsed = array(); |
42 | 42 | $rules = $ruleset->getElementsByTagName( "pluralRule" ); |
Index: trunk/extensions/Translate/scripts/pagetranslation-check-database.php |
— | — | @@ -121,7 +121,6 @@ |
122 | 122 | $title = Title::newFromID( $id ); |
123 | 123 | $name = $title ? $title->getPrefixedText() : "#$id"; |
124 | 124 | |
125 | | - |
126 | 125 | if ( !$title ) { |
127 | 126 | $name = "#$id"; |
128 | 127 | $deleted = $this->findDeletedPage( $id ); |
Index: trunk/extensions/Translate/SpecialLanguageStats.php |
— | — | @@ -78,7 +78,7 @@ |
79 | 79 | |
80 | 80 | $out = Xml::openElement( 'div', array( 'class' => 'languagecode' ) ); |
81 | 81 | $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
82 | | - $out .= Xml::hidden( 'title', $t->getPrefixedText() ); |
| 82 | + $out .= Html::hidden( 'title', $t->getPrefixedText() ); |
83 | 83 | $out .= Xml::openElement( 'fieldset' ); |
84 | 84 | $out .= Xml::element( 'legend', null, wfMsg( 'translate-language-code' ) ); |
85 | 85 | $out .= Xml::openElement( 'table', array( 'id' => 'langcodeselect', 'class' => 'allpages' ) ); |
— | — | @@ -198,7 +198,7 @@ |
199 | 199 | * @return \string HTML |
200 | 200 | */ |
201 | 201 | function getGroupStats( $code, $suppressComplete = false ) { |
202 | | - global $wgUser, $wgLang, $wgOut; |
| 202 | + global $wgLang; |
203 | 203 | |
204 | 204 | $out = ''; |
205 | 205 | |
— | — | @@ -302,7 +302,9 @@ |
303 | 303 | $cache->set( $group->getId(), $code, $result ); |
304 | 304 | |
305 | 305 | static $i = 0; |
306 | | - if ( $i++ % 50 === 0 ) $cache->commit(); |
| 306 | + if ( $i++ % 50 === 0 ) { |
| 307 | + $cache->commit(); |
| 308 | + } |
307 | 309 | |
308 | 310 | return $result; |
309 | 311 | } |
Index: trunk/extensions/Translate/SpecialImportTranslations.php |
— | — | @@ -133,8 +133,8 @@ |
134 | 134 | 'enctype' => 'multipart/form-data', |
135 | 135 | 'id' => 'mw-translate-import', |
136 | 136 | ) ) . |
137 | | - Xml::hidden( 'token', $this->user->editToken() ) . |
138 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 137 | + Html::hidden( 'token', $this->user->editToken() ) . |
| 138 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
139 | 139 | Xml::openElement( 'table' ) . |
140 | 140 | Xml::openElement( 'tr' ) . |
141 | 141 | Xml::openElement( 'td' ) |
Index: trunk/extensions/Translate/FFS.php |
— | — | @@ -709,8 +709,6 @@ |
710 | 710 | class YamlFFS extends SimpleFFS { |
711 | 711 | |
712 | 712 | public function readFromVariable( $data ) { |
713 | | - $authors = $messages = array(); |
714 | | - |
715 | 713 | // Authors first. |
716 | 714 | $matches = array(); |
717 | 715 | preg_match_all( '/^#\s*Author:\s*(.*)$/m', $data, $matches ); |
Index: trunk/extensions/Translate/MessageGroups.php |
— | — | @@ -813,7 +813,9 @@ |
814 | 814 | /// Initialises the list of groups (but not the groups itself if possible). |
815 | 815 | public static function init() { |
816 | 816 | static $loaded = false; |
817 | | - if ( $loaded ) return; |
| 817 | + if ( $loaded ) { |
| 818 | + return; |
| 819 | + } |
818 | 820 | $loaded = true; |
819 | 821 | |
820 | 822 | global $wgTranslateCC, $wgTranslateEC, $wgTranslateAC; |
— | — | @@ -872,7 +874,7 @@ |
873 | 875 | global $wgTranslateAddMWExtensionGroups; |
874 | 876 | global $wgEnablePageTranslation, $wgTranslateGroupFiles; |
875 | 877 | global $wgTranslateAC, $wgTranslateEC, $wgTranslateCC; |
876 | | - global $wgAutoloadClasses, $wgTranslateExtensionDirectory; |
| 878 | + global $wgAutoloadClasses; |
877 | 879 | |
878 | 880 | $deps = array(); |
879 | 881 | $deps[] = new GlobalDependency( 'wgTranslateAddMWExtensionGroups' ); |
Index: trunk/extensions/Translate/tag/TranslatablePage.php |
— | — | @@ -674,7 +674,7 @@ |
675 | 675 | } |
676 | 676 | |
677 | 677 | $codes = Language::getLanguageNames( false ); |
678 | | - global $wgTranslateDocumentationLanguageCode, $wgContLang; |
| 678 | + global $wgTranslateDocumentationLanguageCode; |
679 | 679 | unset( $codes[$wgTranslateDocumentationLanguageCode] ); |
680 | 680 | |
681 | 681 | if ( !isset( $codes[$code] ) ) { |
Index: trunk/extensions/Translate/tag/SpecialPageTranslation.php |
— | — | @@ -362,10 +362,10 @@ |
363 | 363 | |
364 | 364 | $wgOut->addHTML( |
365 | 365 | Xml::openElement( 'form', $formParams ) . |
366 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
367 | | - Xml::hidden( 'revision', $page->getRevision() ) . |
368 | | - Xml::hidden( 'target', $page->getTitle()->getPrefixedtext() ) . |
369 | | - Xml::hidden( 'token', $this->user->editToken() ) |
| 366 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 367 | + Html::hidden( 'revision', $page->getRevision() ) . |
| 368 | + Html::hidden( 'target', $page->getTitle()->getPrefixedtext() ) . |
| 369 | + Html::hidden( 'token', $this->user->editToken() ) |
370 | 370 | ); |
371 | 371 | |
372 | 372 | $wgOut->wrapWikiMsg( '==$1==', 'tpt-sections-oldnew' ); |
Index: trunk/extensions/Translate/SpecialTranslationChanges.php |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | 'action' => $wgScript, |
57 | 57 | 'method' => 'get' |
58 | 58 | ), |
59 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . $limit . $button |
| 59 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . $limit . $button |
60 | 60 | ); |
61 | 61 | return $form; |
62 | 62 | } |
— | — | @@ -137,7 +137,7 @@ |
138 | 138 | $userLang = $wgLang->getCode(); |
139 | 139 | |
140 | 140 | $changes = $this->sort( $rows ); |
141 | | - foreach ( $changes as $class => $groups ) { |
| 141 | + foreach ( $changes as $groups ) { |
142 | 142 | foreach ( $groups as $group => $languages ) { |
143 | 143 | $label = $group; |
144 | 144 | |
Index: trunk/extensions/Translate/groups/ComplexMessages.php |
— | — | @@ -418,7 +418,7 @@ |
419 | 419 | $this->validate( $errors, $filter ); |
420 | 420 | foreach ( $errors as $_ ) $text .= "#!!# $_\n"; |
421 | 421 | |
422 | | - foreach ( $groups = $this->getGroups() as $group => $data ) { |
| 422 | + foreach ( $this->getGroups() as $group => $data ) { |
423 | 423 | if ( $filter !== false && !in_array( $group, (array) $filter, true ) ) { |
424 | 424 | continue; |
425 | 425 | } |
— | — | @@ -579,7 +579,7 @@ |
580 | 580 | foreach ( $this->getIterator( $group ) as $key ) { |
581 | 581 | $values = $this->val( $group, self::LANG_CURRENT, $key ); |
582 | 582 | |
583 | | - foreach ( $values as $i => $_ ) { |
| 583 | + foreach ( $values as $_ ) { |
584 | 584 | wfSuppressWarnings(); |
585 | 585 | $title = SpecialPage::getTitleFor( $_ ); |
586 | 586 | wfRestoreWarnings(); |
Index: trunk/extensions/Translate/groups/StatusNet/genStatusNet-plugins.php |
— | — | @@ -24,8 +24,7 @@ |
25 | 25 | global $plugins; |
26 | 26 | |
27 | 27 | $path = rtrim( str_replace( "\\", "/", $path ), '/' ) . '/'; |
28 | | - $matches = Array(); |
29 | | - $entries = Array(); |
| 28 | + $entries = array(); |
30 | 29 | $dir = dir( $path ); |
31 | 30 | while ( false !== ( $entry = $dir->read() ) ) { |
32 | 31 | $entries[] = $entry; |
Index: trunk/extensions/Translate/TranslateEditAddons.php |
— | — | @@ -44,12 +44,20 @@ |
45 | 45 | |
46 | 46 | $next = $prev = null; |
47 | 47 | foreach ( $keys as $index => $tkey ) { |
48 | | - if ( $key === strtolower( strtr( $tkey, ' ', '_' ) ) ) break; |
49 | | - if ( $index === $count -1 ) $index = -666; |
| 48 | + if ( $key === strtolower( strtr( $tkey, ' ', '_' ) ) ) { |
| 49 | + break; |
| 50 | + } |
| 51 | + if ( $index === $count -1 ) { |
| 52 | + $index = -666; |
| 53 | + } |
50 | 54 | } |
51 | 55 | |
52 | | - if ( isset( $keys[$index-1] ) ) $prev = $keys[$index-1]; |
53 | | - if ( isset( $keys[$index+1] ) ) $next = $keys[$index+1]; |
| 56 | + if ( isset( $keys[$index-1] ) ) { |
| 57 | + $prev = $keys[$index-1]; |
| 58 | + } |
| 59 | + if ( isset( $keys[$index+1] ) ) { |
| 60 | + $next = $keys[$index+1]; |
| 61 | + } |
54 | 62 | |
55 | 63 | |
56 | 64 | $id = $group->getId(); |
— | — | @@ -291,8 +299,8 @@ |
292 | 300 | global $wgRequest; |
293 | 301 | |
294 | 302 | $out->addHTML( "\n" . |
295 | | - Xml::hidden( 'loadgroup', $wgRequest->getText( 'loadgroup' ) ) . |
296 | | - Xml::hidden( 'loadtask', $wgRequest->getText( 'loadtask' ) ) . |
| 303 | + Html::hidden( 'loadgroup', $wgRequest->getText( 'loadgroup' ) ) . |
| 304 | + Html::hidden( 'loadtask', $wgRequest->getText( 'loadtask' ) ) . |
297 | 305 | "\n" |
298 | 306 | ); |
299 | 307 | |
Index: trunk/extensions/Translate/utils/TranslationEditPage.php |
— | — | @@ -90,16 +90,16 @@ |
91 | 91 | $textarea = Html::element( 'textarea', $textareaParams, $translation ); |
92 | 92 | |
93 | 93 | $hidden = array(); |
94 | | - $hidden[] = Xml::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ); |
| 94 | + $hidden[] = Html::hidden( 'title', $this->getTitle()->getPrefixedDbKey() ); |
95 | 95 | |
96 | 96 | if ( isset( $data['revisions'][0]['timestamp'] ) ) { |
97 | | - $hidden[] = Xml::hidden( 'basetimestamp', $data['revisions'][0]['timestamp'] ); |
| 97 | + $hidden[] = Html::hidden( 'basetimestamp', $data['revisions'][0]['timestamp'] ); |
98 | 98 | } |
99 | 99 | |
100 | | - $hidden[] = Xml::hidden( 'starttimestamp', $data['starttimestamp'] ); |
101 | | - $hidden[] = Xml::hidden( 'token', $data['edittoken'] ); |
102 | | - $hidden[] = Xml::hidden( 'format', 'json' ); |
103 | | - $hidden[] = Xml::hidden( 'action', 'edit' ); |
| 100 | + $hidden[] = Html::hidden( 'starttimestamp', $data['starttimestamp'] ); |
| 101 | + $hidden[] = Html::hidden( 'token', $data['edittoken'] ); |
| 102 | + $hidden[] = Html::hidden( 'format', 'json' ); |
| 103 | + $hidden[] = Html::hidden( 'action', 'edit' ); |
104 | 104 | |
105 | 105 | $summary = Xml::inputLabel( wfMsg( 'summary' ), 'summary', 'summary', 40 ); |
106 | 106 | $save = Xml::submitButton( wfMsg( 'savearticle' ), array( 'style' => 'font-weight:bold', 'class' => 'mw-translate-save' ) ); |
Index: trunk/extensions/Translate/utils/MessageWebImporter.php |
— | — | @@ -83,9 +83,9 @@ |
84 | 84 | |
85 | 85 | return |
86 | 86 | Xml::openElement( 'form', $formParams ) . |
87 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
88 | | - Xml::hidden( 'token', $this->getUser()->editToken() ) . |
89 | | - Xml::hidden( 'process', 1 ); |
| 87 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . |
| 88 | + Html::hidden( 'token', $this->getUser()->editToken() ) . |
| 89 | + Html::hidden( 'process', 1 ); |
90 | 90 | } |
91 | 91 | |
92 | 92 | protected function doFooter() { |
— | — | @@ -266,7 +266,7 @@ |
267 | 267 | $lang = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ); |
268 | 268 | $this->out->addWikiMsg( 'translate-manage-intro-other', $lang ); |
269 | 269 | } |
270 | | - $this->out->addHTML( Xml::hidden( 'language', $code ) ); |
| 270 | + $this->out->addHTML( Html::hidden( 'language', $code ) ); |
271 | 271 | $this->out->addHTML( implode( "\n", $changed ) ); |
272 | 272 | $this->out->addHTML( Xml::submitButton( wfMsg( 'translate-manage-submit' ) ) ); |
273 | 273 | } else { |
Index: trunk/extensions/Translate/utils/TranslationMemoryUpdater.php |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | |
98 | 98 | $database = null; |
99 | 99 | |
100 | | - foreach ( $wgTranslateTranslationServices as $service => $config ) { |
| 100 | + foreach ( $wgTranslateTranslationServices as $config ) { |
101 | 101 | if ( $config['type'] === 'tmserver' && isset( $config['database'] ) ) { |
102 | 102 | $database = $config['database']; |
103 | 103 | break; |
Index: trunk/extensions/Translate/utils/TranslationHelpers.php |
— | — | @@ -433,7 +433,6 @@ |
434 | 434 | return null; |
435 | 435 | } |
436 | 436 | |
437 | | - global $wgSitename, $wgVersion, $wgProxyKey; |
438 | 437 | $options = array(); |
439 | 438 | $options['timeout'] = $config['timeout']; |
440 | 439 | |
— | — | @@ -764,12 +763,12 @@ |
765 | 764 | foreach ( $help as $type => $lines ) { |
766 | 765 | if ( $type === ':' ) { |
767 | 766 | $files = ''; |
768 | | - foreach ( $lines as $index => $line ) { |
| 767 | + foreach ( $lines as $line ) { |
769 | 768 | $files .= ' ' . preg_replace( '/([^ :]+):(\d+)/', $pattern, $line ); |
770 | 769 | } |
771 | 770 | $out .= "<nowiki>#:</nowiki> $files<br />"; |
772 | 771 | } else { |
773 | | - foreach ( $lines as $index => $line ) { |
| 772 | + foreach ( $lines as $line ) { |
774 | 773 | $out .= "<nowiki>#$type</nowiki> $line<br />"; |
775 | 774 | } |
776 | 775 | } |
— | — | @@ -1041,11 +1040,13 @@ |
1042 | 1041 | /** |
1043 | 1042 | * Checks whether the given service has exceeded failure count */ |
1044 | 1043 | public static function checkTranslationServiceFailure( $service ) { |
1045 | | - global $wgMemc, $wgContLang; |
| 1044 | + global $wgMemc; |
1046 | 1045 | |
1047 | 1046 | $key = wfMemckey( "translate-service-$service" ); |
1048 | 1047 | $value = $wgMemc->get( $key ); |
1049 | | - if ( !is_string( $value ) ) return false; |
| 1048 | + if ( !is_string( $value ) ) { |
| 1049 | + return false; |
| 1050 | + } |
1050 | 1051 | list( $count, $failed ) = explode( '|', $value, 2 ); |
1051 | 1052 | |
1052 | 1053 | if ( $failed + ( 2 * self::$serviceFailurePeriod ) < wfTimestamp() ) { |
Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | |
137 | 137 | // Fetch results, prepare a batch link existence check query. |
138 | 138 | $rows = array(); |
139 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
| 139 | + foreach( $res as $row ) { |
140 | 140 | $rows[] = $row; |
141 | 141 | } |
142 | 142 | $dbr->freeResult( $res ); |
Index: trunk/extensions/Translate/SpecialMagic.php |
— | — | @@ -77,7 +77,7 @@ |
78 | 78 | Xml::submitButton( wfMsg( self::MSG . 'submit' ) ) . ' ' . |
79 | 79 | Xml::submitButton( wfMsg( 'translate-magic-cm-export' ), array( 'name' => 'export' ) ) . |
80 | 80 | '</td></tr></table>' . |
81 | | - Xml::hidden( 'title', $this->getTitle()->getPrefixedText() ) |
| 81 | + Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) |
82 | 82 | ); |
83 | 83 | return $form; |
84 | 84 | } |
— | — | @@ -143,8 +143,9 @@ |
144 | 144 | |
145 | 145 | $wgOut->addHTML( $this->getForm() ); |
146 | 146 | |
147 | | - if ( !$this->options['module'] ) { return; } |
148 | | - $o = null; |
| 147 | + if ( !$this->options['module'] ) { |
| 148 | + return; |
| 149 | + } |
149 | 150 | switch ( $this->options['module'] ) { |
150 | 151 | case 'alias': |
151 | 152 | case self::MODULE_SPECIAL: |
Index: trunk/extensions/Translate/SpecialTranslations.php |
— | — | @@ -33,8 +33,6 @@ |
34 | 34 | |
35 | 35 | self::includeAssets(); |
36 | 36 | |
37 | | - $title = null; |
38 | | - |
39 | 37 | if ( $this->including() ) { |
40 | 38 | $title = Title::newFromText( $par ); |
41 | 39 | if ( !$title ) { |
— | — | @@ -86,7 +84,7 @@ |
87 | 85 | |
88 | 86 | $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) ); |
89 | 87 | $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); |
90 | | - $out .= Xml::hidden( 'title', $t->getPrefixedText() ); |
| 88 | + $out .= Html::hidden( 'title', $t->getPrefixedText() ); |
91 | 89 | $out .= Xml::openElement( 'fieldset' ); |
92 | 90 | $out .= Xml::element( 'legend', null, wfMsg( 'translate-translations-fieldset-title' ) ); |
93 | 91 | $out .= Xml::openElement( 'table', array( 'id' => 'nsselect', 'class' => 'allpages' ) ); |
Index: trunk/extensions/Translate/api/ApiQueryMessageGroups.php |
— | — | @@ -24,7 +24,6 @@ |
25 | 25 | } |
26 | 26 | |
27 | 27 | public function execute() { |
28 | | - $params = $this->extractRequestParams(); |
29 | 28 | $groups = MessageGroups::getAllGroups(); |
30 | 29 | $result = $this->getResult(); |
31 | 30 | |
— | — | @@ -39,7 +38,6 @@ |
40 | 39 | } |
41 | 40 | |
42 | 41 | $result->setIndexedTagName_internal( array( 'query', $this->getModuleName() ), 'group' ); |
43 | | - |
44 | 42 | } |
45 | 43 | |
46 | 44 | public function getDescription() { |
Index: trunk/extensions/Translate/ffs/Simple.php |
— | — | @@ -87,7 +87,6 @@ |
88 | 88 | $messages = array(); |
89 | 89 | $matches = array(); |
90 | 90 | |
91 | | - $match = array(); |
92 | 91 | preg_match_all( $this->messagePattern, $data, $matches, PREG_SET_ORDER ); |
93 | 92 | foreach ( $matches as $match ) { |
94 | 93 | list( , $key, $value ) = $match; |
Index: trunk/extensions/Translate/ffs/PhpVariables.php |
— | — | @@ -18,8 +18,6 @@ |
19 | 19 | // READ |
20 | 20 | // |
21 | 21 | public function readFromVariable( $data ) { |
22 | | - $authors = $messages = array(); |
23 | | - |
24 | 22 | # Authors first |
25 | 23 | $matches = array(); |
26 | 24 | preg_match_all( '/^ \* @author\s+(.+)$/m', $data, $matches ); |
Index: trunk/extensions/Translate/ffs/WikiExtension.php |
— | — | @@ -48,7 +48,7 @@ |
49 | 49 | |
50 | 50 | $sections = array(); |
51 | 51 | $unknown = array(); |
52 | | - foreach ( $sectionMatches as $index => $data ) { |
| 52 | + foreach ( $sectionMatches as $data ) { |
53 | 53 | $code = array(); |
54 | 54 | if ( !preg_match( "~$codeP~xsu", $data[0], $code ) ) { |
55 | 55 | echo "Malformed section:\n$data[0]"; |
Index: trunk/extensions/Translate/ffs/Gettext.php |
— | — | @@ -26,8 +26,6 @@ |
27 | 27 | } |
28 | 28 | |
29 | 29 | public function readFromVariable( $data ) { |
30 | | - $authors = array(); |
31 | | - |
32 | 30 | # Authors first |
33 | 31 | $matches = array(); |
34 | 32 | preg_match_all( '/^#\s*Author:\s*(.*)$/m', $data, $matches ); |
Index: trunk/extensions/Translate/spyc/spyc.php |
— | — | @@ -480,11 +480,14 @@ |
481 | 481 | * @param string $line A line from the YAML file |
482 | 482 | */ |
483 | 483 | private function _parseLine($line) { |
484 | | - if (!$line) return array(); |
| 484 | + if (!$line) { |
| 485 | + return array(); |
| 486 | + } |
485 | 487 | $line = trim($line); |
486 | | - if (!$line) return array(); |
| 488 | + if (!$line) { |
| 489 | + return array(); |
| 490 | + } |
487 | 491 | |
488 | | - $array = array(); |
489 | 492 | |
490 | 493 | $group = $this->nodeContainsGroup($line); |
491 | 494 | if ($group) { |
— | — | @@ -693,7 +696,7 @@ |
694 | 697 | } |
695 | 698 | |
696 | 699 | $finished = true; |
697 | | - foreach ($explode as $key => $value) { |
| 700 | + foreach ($explode as $value) { |
698 | 701 | if (strpos($value,'YAMLSeq') !== false) { |
699 | 702 | $finished = false; break; |
700 | 703 | } |
— | — | @@ -965,7 +968,6 @@ |
966 | 969 | |
967 | 970 | private function returnKeyValuePair ($line) { |
968 | 971 | $array = array(); |
969 | | - $key = ''; |
970 | 972 | if (strpos ($line, ':')) { |
971 | 973 | // It's a key/value pair most likely |
972 | 974 | // If the key is in double quotes pull it out |
— | — | @@ -987,10 +989,8 @@ |
988 | 990 | $array = array ($line); |
989 | 991 | } |
990 | 992 | return $array; |
991 | | - |
992 | 993 | } |
993 | 994 | |
994 | | - |
995 | 995 | private function returnArrayElement ($line) { |
996 | 996 | if (strlen($line) <= 1) return array(array()); // Weird %) |
997 | 997 | $array = array(); |