MediaWiki  REL1_19
ResourceLoaderUserOptionsModule.php
Go to the documentation of this file.
00001 <?php
00026 class ResourceLoaderUserOptionsModule extends ResourceLoaderModule {
00027 
00028         /* Protected Members */
00029 
00030         protected $modifiedTime = array();
00031 
00032         protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
00033 
00034         /* Methods */
00035 
00040         public function getModifiedTime( ResourceLoaderContext $context ) {
00041                 $hash = $context->getHash();
00042                 if ( isset( $this->modifiedTime[$hash] ) ) {
00043                         return $this->modifiedTime[$hash];
00044                 }
00045                 
00046                 global $wgUser;
00047                 return $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
00048         }
00049 
00054         public function getScript( ResourceLoaderContext $context ) {
00055                 global $wgUser;
00056                 return Xml::encodeJsCall( 'mw.user.options.set',
00057                         array( $wgUser->getOptions() ) );
00058         }
00059 
00063         public function getGroup() {
00064                 return 'private';
00065         }
00066 }