r103454 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103453‎ | r103454 | r103455 >
Date:10:50, 17 November 2011
Author:nikerabbit
Status:ok
Tags:
Comment:
Partially get rid of globs
Modified paths:
  • /trunk/extensions/Narayam/Narayam.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Narayam/Narayam.hooks.php
@@ -9,10 +9,7 @@
1010
1111 /// Hook: BeforePageDisplay
1212 public static function addModules( $out, $skin ) {
13 - global $wgUser;
14 -
15 - if ( $wgUser->getOption( 'narayamDisable' ) ) {
16 - // User disabled Narayam
 13+ if ( $out->getUser()->getOption( 'narayamDisable' ) ) {
1714 return true;
1815 }
1916
@@ -28,17 +25,9 @@
2926
3027 /// Hook: ResourceLoaderGetConfigVars
3128 public static function addConfig( &$vars ) {
32 - global $wgNarayamEnabledByDefault, $wgNarayamRecentItemsLength, $wgUser;
33 -
34 - // FIXME: this hook cannot depend on any state!
35 - if ( $wgUser->getOption( 'narayamDisable' ) ) {
36 - // User disabled Narayam
37 - return true;
38 - }
39 -
 29+ global $wgNarayamRecentItemsLength, $wgNarayamEnabledByDefault;
4030 $vars['wgNarayamEnabledByDefault'] = $wgNarayamEnabledByDefault;
4131 $vars['wgNarayamRecentItemsLength'] = $wgNarayamRecentItemsLength;
42 -
4332 return true;
4433 }
4534
@@ -47,7 +36,6 @@
4837 global $wgUser, $wgNarayamSchemes;
4938
5039 if ( $wgUser->getOption( 'narayamDisable' ) ) {
51 - // User disabled Narayam
5240 return true;
5341 }
5442
@@ -86,4 +74,5 @@
8775
8876 return true;
8977 }
 78+
9079 }

Status & tagging log