MediaWiki  REL1_22
ResourceLoaderUserOptionsModule.php
Go to the documentation of this file.
00001 <?php
00028 class ResourceLoaderUserOptionsModule extends ResourceLoaderModule {
00029 
00030     /* Protected Members */
00031 
00032     protected $modifiedTime = array();
00033 
00034     protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
00035 
00036     /* Methods */
00037 
00042     public function getModifiedTime( ResourceLoaderContext $context ) {
00043         $hash = $context->getHash();
00044         if ( isset( $this->modifiedTime[$hash] ) ) {
00045             return $this->modifiedTime[$hash];
00046         }
00047 
00048         global $wgUser;
00049         return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
00050     }
00051 
00056     public function getScript( ResourceLoaderContext $context ) {
00057         global $wgUser;
00058         return Xml::encodeJsCall( 'mw.user.options.set',
00059             array( $wgUser->getOptions() ),
00060             ResourceLoader::inDebugMode()
00061         );
00062     }
00063 
00067     public function supportsURLLoading() {
00068         return false;
00069     }
00070 
00074     public function getGroup() {
00075         return 'private';
00076     }
00077 }