/**
* Created on Jun 25, 2013
*
- * Copyright © 2013 Brad Jorsch <bjorsch@wikimedia.org>
+ * Copyright © 2013 Wikimedia Foundation and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
$this->dieWithError( [ 'apierror-paramempty', 'ids' ], 'paramempty_ids' );
}
+ // Check if user can add tags
+ if ( count( $params['tags'] ) ) {
+ $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user );
+ if ( !$ableToTag->isOK() ) {
+ $this->dieStatus( $ableToTag );
+ }
+ }
+
$hide = $params['hide'] ?: [];
$show = $params['show'] ?: [];
if ( array_intersect( $hide, $show ) ) {
$list = RevisionDeleter::createList(
$params['type'], $this->getContext(), $targetObj, $params['ids']
);
- $status = $list->setVisibility(
- [ 'value' => $bitfield, 'comment' => $params['reason'], 'perItemStatus' => true ]
- );
+ $status = $list->setVisibility( [
+ 'value' => $bitfield,
+ 'comment' => $params['reason'],
+ 'perItemStatus' => true,
+ 'tags' => $params['tags']
+ ] );
$result = $this->getResult();
$data = $this->extractStatusInfo( $status );
ApiBase::PARAM_DFLT => 'nochange',
],
'reason' => null,
+ 'tags' => [
+ ApiBase::PARAM_TYPE => 'tags',
+ ApiBase::PARAM_ISMULTI => true,
+ ],
];
}
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Revisiondelete';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Revisiondelete';
}
}