MediaWiki REL1_34
ResourceLoaderUserOptionsModule.php
Go to the documentation of this file.
1<?php
30
31 protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
32
33 protected $targets = [ 'desktop', 'mobile' ];
34
40 return [ 'user.defaults' ];
41 }
42
46 public function enableModuleContentVersion() {
47 return true;
48 }
49
55 // Use FILTER_NOMIN annotation to prevent needless minification and caching (T84960).
56 return ResourceLoader::FILTER_NOMIN
57 . 'mw.user.options.set('
58 . $context->encodeJson(
59 $context->getUserObj()->getOptions( User::GETOPTIONS_EXCLUDE_DEFAULTS )
60 )
61 . ');';
62 }
63
67 public function supportsURLLoading() {
68 return false;
69 }
70
76 return !$context->getUserObj()->getOptions( User::GETOPTIONS_EXCLUDE_DEFAULTS );
77 }
78
82 public function getGroup() {
83 return 'private';
84 }
85}
Context object that contains information about the state of a specific ResourceLoader web request.
Abstraction for ResourceLoader modules, with name registration and maxage functionality.
getDependencies(ResourceLoaderContext $context=null)
isKnownEmpty(ResourceLoaderContext $context)
const GETOPTIONS_EXCLUDE_DEFAULTS
Exclude user options that are set to their default value.
Definition User.php:73
$context
Definition load.php:45