MediaWiki  1.23.2
ResourceLoaderUserOptionsModule.php
Go to the documentation of this file.
1 <?php
29 
30  /* Protected Members */
31 
32  protected $modifiedTime = array();
33 
35 
36  protected $targets = array( 'desktop', 'mobile' );
37 
38  /* Methods */
39 
44  public function getModifiedTime( ResourceLoaderContext $context ) {
45  $hash = $context->getHash();
46  if ( !isset( $this->modifiedTime[$hash] ) ) {
48  $this->modifiedTime[$hash] = wfTimestamp( TS_UNIX, $wgUser->getTouched() );
49  }
50 
51  return $this->modifiedTime[$hash];
52  }
53 
58  public function getScript( ResourceLoaderContext $context ) {
60  return Xml::encodeJsCall( 'mw.user.options.set',
61  array( $wgUser->getOptions() ),
63  );
64  }
65 
69  public function supportsURLLoading() {
70  return false;
71  }
72 
76  public function getGroup() {
77  return 'private';
78  }
79 }
ResourceLoaderContext
Object passed around to modules which contains information about the state of a specific loader reque...
Definition: ResourceLoaderContext.php:29
$wgUser
$wgUser
Definition: Setup.php:552
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
ResourceLoaderUserOptionsModule\$modifiedTime
$modifiedTime
Definition: ResourceLoaderUserOptionsModule.php:32
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:2483
ResourceLoaderUserOptionsModule\$origin
$origin
Definition: ResourceLoaderUserOptionsModule.php:34
ResourceLoaderUserOptionsModule\getModifiedTime
getModifiedTime(ResourceLoaderContext $context)
Definition: ResourceLoaderUserOptionsModule.php:44
ResourceLoaderUserOptionsModule
Module for user preference customizations.
Definition: ResourceLoaderUserOptionsModule.php:28
Xml\encodeJsCall
static encodeJsCall( $name, $args, $pretty=false)
Create a call to a JavaScript function.
Definition: Xml.php:665
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
ResourceLoaderUserOptionsModule\getScript
getScript(ResourceLoaderContext $context)
Definition: ResourceLoaderUserOptionsModule.php:58
ResourceLoaderUserOptionsModule\$targets
$targets
Definition: ResourceLoaderUserOptionsModule.php:36
ResourceLoaderUserOptionsModule\supportsURLLoading
supportsURLLoading()
Definition: ResourceLoaderUserOptionsModule.php:69
ResourceLoaderModule\ORIGIN_CORE_INDIVIDUAL
const ORIGIN_CORE_INDIVIDUAL
Definition: ResourceLoaderModule.php:40
$hash
return false to override stock group addition can be modified try getUserPermissionsErrors userCan checks are continued by internal code can override on output return false to not delete it return false to override the default password checks & $hash
Definition: hooks.txt:2697
ResourceLoaderModule
Abstraction for resource loader modules, with name registration and maxage functionality.
Definition: ResourceLoaderModule.php:28
ResourceLoader\inDebugMode
static inDebugMode()
Determine whether debug mode was requested Order of priority is 1) request param, 2) cookie,...
Definition: ResourceLoader.php:1188
TS_UNIX
const TS_UNIX
Unix time - the number of seconds since 1970-01-01 00:00:00 UTC.
Definition: GlobalFunctions.php:2426
ResourceLoaderUserOptionsModule\getGroup
getGroup()
Definition: ResourceLoaderUserOptionsModule.php:76
ResourceLoaderContext\getHash
getHash()
Definition: ResourceLoaderContext.php:231