<?php
/**
+ * Resource loader module for user preference customizations.
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
}
global $wgUser;
-
- if ( $context->getUser() === $wgUser->getName() ) {
- return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
- } else {
- return 1;
- }
+ return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
}
/**
- * 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
+ * @param $context ResourceLoaderContext
+ * @return string
*/
- protected function contextUserOptions( ResourceLoaderContext $context ) {
+ public function getScript( ResourceLoaderContext $context ) {
global $wgUser;
-
- // Verify identity -- this is a private module
- if ( $context->getUser() === $wgUser->getName() ) {
- return $wgUser->getOptions();
- } else {
- return User::getDefaultOptions();
- }
+ return Xml::encodeJsCall( 'mw.user.options.set',
+ array( $wgUser->getOptions() ),
+ ResourceLoader::inDebugMode()
+ );
}
/**
- * @param $context ResourceLoaderContext
- * @return string
+ * @return bool
*/
- public function getScript( ResourceLoaderContext $context ) {
- return Xml::encodeJsCall( 'mw.user.options.set',
- array( $this->contextUserOptions( $context ) ) );
+ public function supportsURLLoading() {
+ return false;
}
/**