40 protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
53 'patrolToken' => $user->getEditToken(
'patrol' ),
54 'watchToken' => $user->getEditToken(
'watch' ),
55 'csrfToken' => $user->getEditToken(),
57 $script =
'mw.user.tokens.set(' . $context->
encodeJson( $tokens ) .
');' .
"\n";
64 $options = $userOptionsLookup->getOptions( $user, UserOptionsLookup::EXCLUDE_DEFAULTS );
67 $this->
getHookRunner()->onResourceLoaderExcludeUserOptions( $keysToExclude, $context );
68 foreach ( $keysToExclude as $excludedKey ) {
69 unset( $options[ $excludedKey ] );
74 $script .=
'mw.user.options.set(' . $context->
encodeJson( $options ) .
');' .
"\n";
91 return self::GROUP_PRIVATE;
96class_alias( UserOptionsModule::class,
'ResourceLoaderUserOptionsModule' );
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.
getUserObj()
Get the possibly-cached User object for the specified username.