*/
class ResourceLoaderUserOptionsModule extends ResourceLoaderModule {
- /* Protected Members */
-
- protected $modifiedTime = array();
-
protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
protected $targets = array( 'desktop', 'mobile' );
- /* Methods */
-
/**
* @param ResourceLoaderContext $context
- * @return array|int|mixed
+ * @return array List of module names as strings
*/
- public function getModifiedTime( ResourceLoaderContext $context ) {
- $hash = $context->getHash();
- if ( !isset( $this->modifiedTime[$hash] ) ) {
- $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $context->getUserObj()->getTouched() );
- }
+ public function getDependencies( ResourceLoaderContext $context = null ) {
+ return array( 'user.defaults' );
+ }
- return $this->modifiedTime[$hash];
+ /**
+ * @return bool
+ */
+ public function enableModuleContentVersion() {
+ return true;
}
/**
*/
public function getScript( ResourceLoaderContext $context ) {
return Xml::encodeJsCall( 'mw.user.options.set',
- array( $context->getUserObj()->getOptions() ),
+ array( $context->getUserObj()->getOptions( User::GETOPTIONS_EXCLUDE_DEFAULTS ) ),
ResourceLoader::inDebugMode()
);
}