48 $userOptionsManager ??= $services->getUserOptionsManager();
49 $preferencesFactory ??= $services->getPreferencesFactory();
50 parent::__construct( $main, $action, $userOptionsManager, $preferencesFactory );
53 protected function runHook( $user, $changes, $resetKinds ) {
54 $this->
getHookRunner()->onApiOptions( $this, $user, $changes, $resetKinds );
60 if ( $this->getGlobalParam() ===
'ignore' && $manager->isOptionGlobal( $user, $key ) ) {
61 $this->
addWarning( $this->
msg(
'apiwarn-global-option-ignored', $key ) );
75 'ignore' => UserOptionsManager::GLOBAL_IGNORE,
76 'update' => UserOptionsManager::GLOBAL_UPDATE,
77 'override' => UserOptionsManager::GLOBAL_OVERRIDE
78 ][ $this->getGlobalParam() ];
88 private function getGlobalParam() {
97 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Options';
102 'action=options&reset=&token=123ABC'
103 =>
'apihelp-options-example-reset',
104 'action=options&change=skin=vector|hideminor=1&token=123ABC'
105 =>
'apihelp-options-example-change',
106 'action=options&reset=&change=skin=monobook&optionname=nickname&' .
107 'optionvalue=[[User:Beau|Beau]]%20([[User_talk:Beau|talk]])&token=123ABC'
108 =>
'apihelp-options-example-complex',
113 return parent::getAllowedParams() + [
115 ParamValidator::PARAM_TYPE => [
'ignore',
'update',
'override' ],
116 ParamValidator::PARAM_DEFAULT =>
'ignore'
123class_alias( ApiOptions::class,
'ApiOptions' );
This is the main API class, used for both external and internal processing.
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()