r103815 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103814‎ | r103815 | r103816 >
Date:15:36, 21 November 2011
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Fixed typo, indentation and moved constant to configs
Modified paths:
  • /trunk/extensions/Narayam/Narayam.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/Narayam.hooks.php
@@ -28,6 +28,7 @@
2929 global $wgNarayamRecentItemsLength, $wgNarayamEnabledByDefault;
3030 $vars['wgNarayamEnabledByDefault'] = $wgNarayamEnabledByDefault;
3131 $vars['wgNarayamRecentItemsLength'] = $wgNarayamRecentItemsLength;
 32+ $vars['wgNarayamHelpPage'] = wfMsgForContent( 'narayam-help-page' );
3233 return true;
3334 }
3435
@@ -41,7 +42,6 @@
4243
4344 $vars['wgNarayamAvailableSchemes'] = self::getSchemes(); // Note: scheme names must be keys, not values
4445 $vars['wgNarayamAllSchemes'] = $wgNarayamSchemes;
45 - $vars['wgNarayamHelpPage'] = wfMsgForContent( 'narayam-help-page' );
4646 return true;
4747 }
4848
@@ -50,28 +50,25 @@
5151 * @return array( scheme name => module name )
5252 */
5353 protected static function getSchemes() {
54 - global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgTitle;
 54+ global $wgLanguageCode, $wgLang, $wgNarayamSchemes, $wgRequest;
5555
5656 $userlangCode = $wgLang->getCode();
5757 $contlangSchemes = isset( $wgNarayamSchemes[$wgLanguageCode] ) ?
58 - $wgNarayamSchemes[$wgLanguageCode] : array();
 58+ $wgNarayamSchemes[$wgLanguageCode] : array();
5959 $userlangSchemes = isset( $wgNarayamSchemes[$userlangCode] ) ?
60 - $wgNarayamSchemes[$userlangCode] : array();
61 - $pagelang = $wgTitle->getPageLanguage()->getCode();
62 - $pagelangSchemes = isset( $wgNarayamSchemes[$pagelang] ) ?
63 - $wgNarayamSchemes[$pagelang] : array();
 60+ $wgNarayamSchemes[$userlangCode] : array();
6461
65 - $schemes = $userlangSchemes + $contlangSchemes + $pagelangSchemes;
 62+ $schemes = $userlangSchemes + $contlangSchemes;
6663
6764 return $schemes;
6865 }
6966
7067 /// Hook: GetPreferences
7168 public static function addPreference( $user, &$preferences ) {
72 - // A checkbox in preferences to diable Narayam
 69+ // A checkbox in preferences to disable Narayam
7370 $preferences['narayamDisable'] = array(
7471 'type' => 'toggle',
75 - 'label-message' => 'narayam-disable-preference', // a system message
 72+ 'label-message' => 'narayam-disable-preference',
7673 'section' => 'editing/advancedediting', // under 'Advanced options' section of 'Editing' tab
7774 );
7875

Follow-up revisions

RevisionCommit summaryAuthorDate
r104222Partial revert of r103815 which destroyed some previous changesnikerabbit05:27, 25 November 2011

Comments

#Comment by SPQRobin (talk | contribs)   20:40, 22 November 2011

Was the revert of r103657 in getSchemes() intentional?

#Comment by Santhosh.thottingal (talk | contribs)   05:33, 25 November 2011

r104222 fixed it.

Status & tagging log