MediaWiki  master
ResourceLoaderUserDefaultsModule.php
Go to the documentation of this file.
1 <?php
29 
30  protected $targets = [ 'desktop', 'mobile' ];
31 
35  public function enableModuleContentVersion() {
36  return true;
37  }
38 
44  return 'mw.user.options.set('
45  . $context->encodeJson( User::getDefaultOptions() )
46  . ');';
47  }
48 }
$context
Definition: load.php:45
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
encodeJson( $data)
Wrapper around json_encode that avoids needless escapes, and pretty-prints in debug mode...
static getDefaultOptions()
Combine the language default options with any site-specific options and add the default language vari...
Definition: User.php:1652
Module for default user preferences.
Context object that contains information about the state of a specific ResourceLoader web request...