diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-03-22 21:04:56 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-03-22 21:04:56 +0100 |
commit | 81be3ba123fa26c29ab157288530ffaec9d0930f (patch) | |
tree | 8054ad0536e27b20838d85a05884ca47752537dc /includes/resourceloader/ResourceLoaderUserOptionsModule.php | |
parent | ba0fc4fa20067528effd4802e53ceeb959640825 (diff) |
Update to MediaWiki 1.18.2
Diffstat (limited to 'includes/resourceloader/ResourceLoaderUserOptionsModule.php')
-rw-r--r-- | includes/resourceloader/ResourceLoaderUserOptionsModule.php | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/includes/resourceloader/ResourceLoaderUserOptionsModule.php b/includes/resourceloader/ResourceLoaderUserOptionsModule.php index 8f28eb8d..78548416 100644 --- a/includes/resourceloader/ResourceLoaderUserOptionsModule.php +++ b/includes/resourceloader/ResourceLoaderUserOptionsModule.php @@ -45,29 +45,7 @@ class ResourceLoaderUserOptionsModule extends ResourceLoaderModule { global $wgUser; - if ( $context->getUser() === $wgUser->getName() ) { - return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); - } else { - return 1; - } - } - - /** - * Fetch the context's user options, or if it doesn't match current user, - * the default options. - * - * @param $context ResourceLoaderContext: Context object - * @return Array: List of user options keyed by option name - */ - protected function contextUserOptions( ResourceLoaderContext $context ) { - global $wgUser; - - // Verify identity -- this is a private module - if ( $context->getUser() === $wgUser->getName() ) { - return $wgUser->getOptions(); - } else { - return User::getDefaultOptions(); - } + return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); } /** @@ -75,8 +53,9 @@ class ResourceLoaderUserOptionsModule extends ResourceLoaderModule { * @return string */ public function getScript( ResourceLoaderContext $context ) { + global $wgUser; return Xml::encodeJsCall( 'mw.user.options.set', - array( $this->contextUserOptions( $context ) ) ); + array( $wgUser->getOptions() ) ); } /** @@ -84,10 +63,10 @@ class ResourceLoaderUserOptionsModule extends ResourceLoaderModule { * @return array */ public function getStyles( ResourceLoaderContext $context ) { - global $wgAllowUserCssPrefs; + global $wgAllowUserCssPrefs, $wgUser; if ( $wgAllowUserCssPrefs ) { - $options = $this->contextUserOptions( $context ); + $options = $wgUser->getOptions(); // Build CSS rules $rules = array(); |