Index: trunk/extensions/WebFonts/WebFonts.hooks.php |
— | — | @@ -13,9 +13,8 @@ |
14 | 14 | * BeforePageDisplay hook handler. |
15 | 15 | */ |
16 | 16 | public static function addModules( $out, $skin ) { |
17 | | - global $wgUser; |
18 | 17 | |
19 | | - if ( $wgUser->getOption( 'webfontsEnable' ) ) { |
| 18 | + if ( $out->getUser()->getOption( 'webfontsEnable' ) ) { |
20 | 19 | $out->addModules( 'webfonts' ); |
21 | 20 | } |
22 | 21 | |
— | — | @@ -26,9 +25,9 @@ |
27 | 26 | * MakeGlobalVariablesScript hook handler. |
28 | 27 | */ |
29 | 28 | public static function addVariables( &$vars, $out ) { |
30 | | - global $wgWebFontsEnabledByDefault, $wgUser; |
| 29 | + global $wgWebFontsEnabledByDefault; |
31 | 30 | |
32 | | - if ( $wgUser->isAnon() ) { |
| 31 | + if ( $out->getUser()->isAnon() ) { |
33 | 32 | // If user enabled webfonts from preference page, |
34 | 33 | // wgWebFontsEnabledByDefault is overridden by that. |
35 | 34 | $vars['wgWebFontsEnabledByDefault'] = $wgWebFontsEnabledByDefault; |
— | — | @@ -41,13 +40,12 @@ |
42 | 41 | * GetPreferences hook handler. |
43 | 42 | */ |
44 | 43 | public static function addPreference( $user, &$preferences ) { |
45 | | - global $wgUser; |
46 | 44 | // A checkbox in preferences to enable WebFonts |
47 | 45 | $preferences['webfontsEnable'] = array( |
48 | 46 | 'type' => 'toggle', |
49 | 47 | 'label-message' => 'webfonts-enable-preference', // a system message |
50 | 48 | 'section' => 'rendering/advancedrendering', // under 'Advanced options' section of 'Editing' tab |
51 | | - 'default' => $wgUser->getOption( 'webfontsEnable' ) |
| 49 | + 'default' => $user->getOption( 'webfontsEnable' ) |
52 | 50 | ); |
53 | 51 | |
54 | 52 | return true; |