diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /includes/resourceloader/ResourceLoaderUserOptionsModule.php | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'includes/resourceloader/ResourceLoaderUserOptionsModule.php')
-rw-r--r-- | includes/resourceloader/ResourceLoaderUserOptionsModule.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/includes/resourceloader/ResourceLoaderUserOptionsModule.php b/includes/resourceloader/ResourceLoaderUserOptionsModule.php index bd97a8e5..84c1906d 100644 --- a/includes/resourceloader/ResourceLoaderUserOptionsModule.php +++ b/includes/resourceloader/ResourceLoaderUserOptionsModule.php @@ -38,14 +38,20 @@ class ResourceLoaderUserOptionsModule extends ResourceLoaderModule { /* Methods */ /** + * @return array List of module names as strings + */ + public function getDependencies() { + return array( 'user.defaults' ); + } + + /** * @param ResourceLoaderContext $context - * @return array|int|mixed + * @return int */ public function getModifiedTime( ResourceLoaderContext $context ) { $hash = $context->getHash(); if ( !isset( $this->modifiedTime[$hash] ) ) { - global $wgUser; - $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() ); + $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $context->getUserObj()->getTouched() ); } return $this->modifiedTime[$hash]; @@ -56,9 +62,8 @@ class ResourceLoaderUserOptionsModule extends ResourceLoaderModule { * @return string */ public function getScript( ResourceLoaderContext $context ) { - global $wgUser; return Xml::encodeJsCall( 'mw.user.options.set', - array( $wgUser->getOptions() ), + array( $context->getUserObj()->getOptions( User::GETOPTIONS_EXCLUDE_DEFAULTS ) ), ResourceLoader::inDebugMode() ); } |