43 protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
54 'patrolToken' => $user->getEditToken(
'patrol' ),
55 'watchToken' => $user->getEditToken(
'watch' ),
56 'csrfToken' => $user->getEditToken(),
58 $script =
'mw.user.tokens.set(' . $context->
encodeJson( $tokens ) .
');' .
"\n";
65 $options = $userOptionsLookup->
getOptions( $user, UserOptionsLookup::EXCLUDE_DEFAULTS );
68 $this->
getHookRunner()->onResourceLoaderExcludeUserOptions( $keysToExclude, $context );
69 foreach ( $keysToExclude as $excludedKey ) {
70 unset( $options[ $excludedKey ] );
74 if ( isset( $options[
'timecorrection'] ) ) {
76 $options[
'timecorrection'],
80 $options[
'timecorrection'] = $corr->toString();
85 $script .=
'mw.user.options.set(' . $context->
encodeJson( $options ) .
');' .
"\n";
102 return self::GROUP_PRIVATE;
A class containing constants representing the names of configuration variables.
const LocalTZoffset
Name constant for the LocalTZoffset setting, for use with Config::get()
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.