<?php
/**
- *
- * Created on January 3rd, 2013
- *
* 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
* the Free Software Foundation; either version 2 of the License, or
$pageSet = $this->getPageSet();
$pageSet->execute();
- $result = [];
-
$result = $pageSet->getInvalidTitlesAndRevisions( [
'invalidTitles', 'special', 'missingIds', 'missingRevIds', 'interwikiTitles',
] );
+ // Check if user can add tags
+ if ( $params['tags'] ) {
+ $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $this->getUser() );
+ if ( !$ableToTag->isOK() ) {
+ $this->dieStatus( $ableToTag );
+ }
+ }
+
foreach ( $pageSet->getTitles() as $title ) {
$r = [];
$r['id'] = $title->getArticleID();
$comment = wfMessage(
'rotate-comment'
)->numParams( $rotation )->inContentLanguage()->text();
- $status = $file->upload( $dstPath,
- $comment, $comment, 0, false, false, $this->getUser() );
+ $status = $file->upload(
+ $dstPath,
+ $comment,
+ $comment,
+ 0,
+ false,
+ false,
+ $this->getUser(),
+ $params['tags'] ?: []
+ );
if ( $status->isGood() ) {
$r['result'] = 'Success';
} else {
'continue' => [
ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
],
+ 'tags' => [
+ ApiBase::PARAM_TYPE => 'tags',
+ ApiBase::PARAM_ISMULTI => true,
+ ],
];
if ( $flags ) {
$result += $this->getPageSet()->getFinalParams( $flags );