Merge "(bug 35923) tweaks to mediawiki.action.history.diff.css"
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderUserOptionsModule.php
index 84932ad..4624cbc 100644 (file)
@@ -1,5 +1,7 @@
 <?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
@@ -44,39 +46,24 @@ class ResourceLoaderUserOptionsModule extends ResourceLoaderModule {
                }
 
                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() ) );
        }
 
        /**
-        * @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;
        }
 
        /**