Go to the documentation of this file.
33 if ( $params[
'operation'] !==
'delete'
36 $this->
dieWithError(
'tags-manage-no-permission',
'permissiondenied' );
38 $this->
dieWithError(
'tags-delete-no-permission',
'permissiondenied' );
42 if ( $params[
'tags'] ) {
44 if ( !$ableToTag->isOK() ) {
50 $funcName =
"{$params['operation']}TagWithChecks";
51 $status = ChangeTags::$funcName(
55 $params[
'ignorewarnings'],
64 'operation' => $params[
'operation'],
65 'tag' => $params[
'tag'],
70 $ret[
'success'] =
$status->value !==
null;
71 if ( $ret[
'success'] ) {
116 'action=managetags&operation=create&tag=spam&reason=For+use+in+edit+patrolling&token=123ABC'
117 =>
'apihelp-managetags-example-create',
118 'action=managetags&operation=delete&tag=vandlaism&reason=Misspelt&token=123ABC'
119 =>
'apihelp-managetags-example-delete',
120 'action=managetags&operation=activate&tag=spam&reason=For+use+in+edit+patrolling&token=123ABC'
121 =>
'apihelp-managetags-example-activate',
122 'action=managetags&operation=deactivate&tag=spam&reason=No+longer+required&token=123ABC'
123 =>
'apihelp-managetags-example-deactivate',
128 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Tag_management';
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
This abstract class implements many basic API functions, and is the base of all API classes.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getPermissionManager()
Obtain a PermissionManager instance that subclasses may use in their authorization checks.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
getModuleName()
Get the name of the module being executed by this instance.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
getErrorFormatter()
Get the error formatter.