Index: trunk/extensions/Narayam/Narayam.hooks.php |
— | — | @@ -9,10 +9,7 @@ |
10 | 10 | |
11 | 11 | /// Hook: BeforePageDisplay |
12 | 12 | 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' ) ) { |
17 | 14 | return true; |
18 | 15 | } |
19 | 16 | |
— | — | @@ -28,17 +25,9 @@ |
29 | 26 | |
30 | 27 | /// Hook: ResourceLoaderGetConfigVars |
31 | 28 | 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; |
40 | 30 | $vars['wgNarayamEnabledByDefault'] = $wgNarayamEnabledByDefault; |
41 | 31 | $vars['wgNarayamRecentItemsLength'] = $wgNarayamRecentItemsLength; |
42 | | - |
43 | 32 | return true; |
44 | 33 | } |
45 | 34 | |
— | — | @@ -47,7 +36,6 @@ |
48 | 37 | global $wgUser, $wgNarayamSchemes; |
49 | 38 | |
50 | 39 | if ( $wgUser->getOption( 'narayamDisable' ) ) { |
51 | | - // User disabled Narayam |
52 | 40 | return true; |
53 | 41 | } |
54 | 42 | |
— | — | @@ -86,4 +74,5 @@ |
87 | 75 | |
88 | 76 | return true; |
89 | 77 | } |
| 78 | + |
90 | 79 | } |