MediaWiki
REL1_34
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
ResourceLoaderModule
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
Definition
ResourceLoaderModule.php:37
ResourceLoaderUserDefaultsModule
Module for default user preferences.
Definition
ResourceLoaderUserDefaultsModule.php:28
ResourceLoaderUserDefaultsModule\getScript
getScript(ResourceLoaderContext $context)
Definition
ResourceLoaderUserDefaultsModule.php:43
ResourceLoaderUserDefaultsModule\$targets
$targets
Definition
ResourceLoaderUserDefaultsModule.php:30
ResourceLoaderUserDefaultsModule\enableModuleContentVersion
enableModuleContentVersion()
Definition
ResourceLoaderUserDefaultsModule.php:35
$context
$context
Definition
load.php:45
includes
resourceloader
ResourceLoaderUserDefaultsModule.php
Generated on Mon Nov 25 2024 16:05:38 for MediaWiki by
1.10.0