29 protected $origin = self::ORIGIN_CORE_INDIVIDUAL;
40 'patrolToken' => $user->getEditToken(
'patrol' ),
41 'watchToken' => $user->getEditToken(
'watch' ),
42 'csrfToken' => $user->getEditToken(),
44 $script =
'mw.user.tokens.set(' . $context->
encodeJson( $tokens ) .
');' .
"\n";
51 $options = $userOptionsLookup->
getOptions( $user, UserOptionsLookup::EXCLUDE_DEFAULTS );
54 $this->
getHookRunner()->onResourceLoaderExcludeUserOptions( $keysToExclude, $context );
55 foreach ( $keysToExclude as $excludedKey ) {
56 unset( $options[ $excludedKey ] );
60 if ( isset( $options[
'timecorrection'] ) ) {
62 $options[
'timecorrection'],
66 $options[
'timecorrection'] = $corr->toString();
71 $script .=
'mw.user.options.set(' . $context->
encodeJson( $options ) .
');' .
"\n";
88 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.