X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiOptions.php;h=8ef062992814f784550a08d84e1b4b47ee350e4b;hb=a985acd573f19b7fd36d9d4c18783401e710c3e9;hp=8ac9b9afb0e5c919cba3b78c5037ab40fcf369cd;hpb=0525f22b8825c617fffa98f191ab07e8113da085;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiOptions.php b/includes/api/ApiOptions.php index 8ac9b9afb0..8ef0629928 100644 --- a/includes/api/ApiOptions.php +++ b/includes/api/ApiOptions.php @@ -135,10 +135,6 @@ class ApiOptions extends ApiBase { $optionKinds[] = 'all'; return array( - 'token' => array( - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true - ), 'reset' => false, 'resetkinds' => array( ApiBase::PARAM_TYPE => $optionKinds, @@ -157,49 +153,23 @@ class ApiOptions extends ApiBase { ); } - public function getParamDescription() { - return array( - 'token' => 'An options token previously obtained through the action=tokens', - 'reset' => 'Resets preferences to the site defaults', - 'resetkinds' => 'List of types of options to reset when the "reset" option is set', - 'change' => array( 'List of changes, formatted name=value (e.g. skin=vector), ' . - 'value cannot contain pipe characters. If no value is given (not ', - 'even an equals sign), e.g., optionname|otheroption|..., the ' . - 'option will be reset to its default value' - ), - 'optionname' => 'A name of a option which should have an optionvalue set', - 'optionvalue' => 'A value of the option specified by the optionname, ' . - 'can contain pipe characters', - ); - } - - public function getDescription() { - return array( - 'Change preferences of the current user.', - 'Only options which are registered in core or in one of installed extensions,', - 'or as options with keys prefixed with \'userjs-\' (intended to be used by user', - 'scripts), can be set.' - ); - } - public function needsToken() { - return true; - } - - public function getTokenSalt() { - return ''; + return 'csrf'; } public function getHelpUrls() { return 'https://www.mediawiki.org/wiki/API:Options'; } - public function getExamples() { + protected function getExamplesMessages() { return array( - 'api.php?action=options&reset=&token=123ABC', - 'api.php?action=options&change=skin=vector|hideminor=1&token=123ABC', - 'api.php?action=options&reset=&change=skin=monobook&optionname=nickname&' . - 'optionvalue=[[User:Beau|Beau]]%20([[User_talk:Beau|talk]])&token=123ABC', + 'action=options&reset=&token=123ABC' + => 'apihelp-options-example-reset', + 'action=options&change=skin=vector|hideminor=1&token=123ABC' + => 'apihelp-options-example-change', + 'action=options&reset=&change=skin=monobook&optionname=nickname&' . + 'optionvalue=[[User:Beau|Beau]]%20([[User_talk:Beau|talk]])&token=123ABC' + => 'apihelp-options-example-complex', ); } }