MediaWiki
1.34.0
ResourceLoaderUserDefaultsModule.php
Go to the documentation of this file.
1
<?php
28
class
ResourceLoaderUserDefaultsModule
extends
ResourceLoaderModule
{
29
30
protected
$targets
= [
'desktop'
,
'mobile'
];
31
35
public
function
enableModuleContentVersion
() {
36
return
true
;
37
}
38
43
public
function
getScript
(
ResourceLoaderContext
$context
) {
44
return
'mw.user.options.set('
45
.
$context
->encodeJson(
User::getDefaultOptions
() )
46
.
');'
;
47
}
48
}
ResourceLoaderContext
Context object that contains information about the state of a specific ResourceLoader web request.
Definition:
ResourceLoaderContext.php:33
ResourceLoaderUserDefaultsModule\$targets
$targets
Definition:
ResourceLoaderUserDefaultsModule.php:30
User\getDefaultOptions
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
Definition:
User.php:1651
ResourceLoaderUserDefaultsModule
Module for default user preferences.
Definition:
ResourceLoaderUserDefaultsModule.php:28
$context
$context
Definition:
load.php:45
ResourceLoaderModule
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
Definition:
ResourceLoaderModule.php:37
ResourceLoaderUserDefaultsModule\enableModuleContentVersion
enableModuleContentVersion()
Definition:
ResourceLoaderUserDefaultsModule.php:35
ResourceLoaderUserDefaultsModule\getScript
getScript(ResourceLoaderContext $context)
Definition:
ResourceLoaderUserDefaultsModule.php:43
includes
resourceloader
ResourceLoaderUserDefaultsModule.php
Generated on Thu Dec 19 2019 14:54:46 for MediaWiki by
1.8.16