MediaWiki
REL1_21
|
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 } 00061 00065 public function supportsURLLoading() { 00066 return false; 00067 } 00068 00072 public function getGroup() { 00073 return 'private'; 00074 } 00075 }