r105414 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105413‎ | r105414 | r105415 >
Date:04:44, 7 December 2011
Author:santhosh
Status:ok (Comments)
Tags:
Comment:
Follow up r105160. Make sure that resourceloader get correct module name.
Modified paths:
  • /trunk/extensions/Narayam/Narayam.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/Narayam.hooks.php
@@ -42,14 +42,20 @@
4343
4444 $vars['wgNarayamAvailableSchemes'] = self::getSchemes(); // Note: scheme names must be keys, not values
4545 $allSchemes = $wgNarayamSchemes;
46 - if ( !$wgNarayamUseBetaMapping ) {
47 - foreach ( $allSchemes as $lang => $schemes ) {
48 - foreach ( $schemes as $i => $scheme ) {
49 - $version = isset( $scheme[1] ) ? $scheme[1] : "stable";
50 - if ( $version === "beta" ) {
 46+ foreach ( $allSchemes as $lang => $schemes ) {
 47+ foreach ( $schemes as $i => $scheme ) {
 48+ $version = isset( $scheme[1] ) ? $scheme[1] : "stable";
 49+ if ( $version === "beta" ) {
 50+ if ( !$wgNarayamUseBetaMapping ) {
5151 unset( $allSchemes[$lang][$i] );
5252 }
 53+ else {
 54+ $allSchemes[$lang][$i] = $scheme[0];
 55+ }
5356 }
 57+ else {
 58+ $allSchemes[$lang][$i] = $scheme;
 59+ }
5460 }
5561 }
5662 $vars['wgNarayamAllSchemes'] = $allSchemes;
@@ -73,13 +79,19 @@
7480 $wgNarayamSchemes[$pagelang] : array();
7581
7682 $schemes = $userlangSchemes + $contlangSchemes + $pagelangSchemes;
77 - if ( !$wgNarayamUseBetaMapping ) {
78 - foreach ( $schemes as $i => $scheme ) {
79 - $version = isset( $scheme[1] ) ? $scheme[1] : "stable";
80 - if ( $version === "beta" ) {
 83+ foreach ( $schemes as $i => $scheme ) {
 84+ $version = isset( $scheme[1] ) ? $scheme[1] : "stable";
 85+ if ( $version === "beta" ) {
 86+ if ( !$wgNarayamUseBetaMapping ) {
8187 unset( $schemes[$i] );
8288 }
 89+ else {
 90+ $schemes[$i] = $scheme[0];
 91+ }
8392 }
 93+ else {
 94+ $schemes[$i] = $scheme;
 95+ }
8496 }
8597 return $schemes;
8698 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r105160Fix Bug 32768. Add a version status to each input method, and conditionally e...santhosh10:04, 5 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   11:33, 7 December 2011

Do I see a bit of code duplication here?

#Comment by Nikerabbit (talk | contribs)   11:47, 7 December 2011

And we usually write } else { in one line.

Status & tagging log