MediaWiki
REL1_35
ResourceLoaderUserDefaultsModule.php
Go to the documentation of this file.
1
<?php
28
class
ResourceLoaderUserDefaultsModule
extends
ResourceLoaderModule
{
29
protected
$targets
= [
'desktop'
,
'mobile'
];
30
34
public
function
enableModuleContentVersion
() {
35
return
true
;
36
}
37
42
public
function
getScript
(
ResourceLoaderContext
$context ) {
43
return
'mw.user.options.set('
44
. $context->
encodeJson
(
User::getDefaultOptions
() )
45
.
');'
;
46
}
47
}
ResourceLoaderContext
Context object that contains information about the state of a specific ResourceLoader web request.
Definition
ResourceLoaderContext.php:33
ResourceLoaderContext\encodeJson
encodeJson( $data)
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode.
Definition
ResourceLoaderContext.php:403
ResourceLoaderModule
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
Definition
ResourceLoaderModule.php:39
ResourceLoaderUserDefaultsModule
Module for default user preferences.
Definition
ResourceLoaderUserDefaultsModule.php:28
ResourceLoaderUserDefaultsModule\getScript
getScript(ResourceLoaderContext $context)
Definition
ResourceLoaderUserDefaultsModule.php:42
ResourceLoaderUserDefaultsModule\$targets
$targets
Definition
ResourceLoaderUserDefaultsModule.php:29
ResourceLoaderUserDefaultsModule\enableModuleContentVersion
enableModuleContentVersion()
Definition
ResourceLoaderUserDefaultsModule.php:34
User\getDefaultOptions
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
Definition
User.php:1540
includes
resourceloader
ResourceLoaderUserDefaultsModule.php
Generated on Sat Apr 6 2024 00:07:42 for MediaWiki by
1.9.8