MediaWiki REL1_35
ResourceLoaderUserDefaultsModule.php
Go to the documentation of this file.
1<?php
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}
Context object that contains information about the state of a specific ResourceLoader web request.
encodeJson( $data)
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode.
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
Definition User.php:1540