X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiImport.php;h=b46f0b1e5105d46cc2833336c2b7f5bfc0e430f7;hb=01299000d028c77afdc8c5358b81861337bd35ac;hp=dffd6b253f77afdd2d5d9549d3374867608e0f7a;hpb=b8bf745ca957de92f447ded545179663d344191f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiImport.php b/includes/api/ApiImport.php index dffd6b253f..b46f0b1e51 100644 --- a/includes/api/ApiImport.php +++ b/includes/api/ApiImport.php @@ -64,6 +64,14 @@ class ApiImport extends ApiBase { $this->dieStatus( $source ); } + // Check if user can add the log entry tags which were requested + if ( $params['tags'] ) { + $ableToTag = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user ); + if ( !$ableToTag->isOK() ) { + $this->dieStatus( $ableToTag ); + } + } + $importer = new WikiImporter( $source->value, $this->getConfig() ); if ( isset( $params['namespace'] ) ) { $importer->setTargetNamespace( $params['namespace'] ); @@ -79,6 +87,9 @@ class ApiImport extends ApiBase { $params['interwikisource'], $params['summary'] ); + if ( $params['tags'] ) { + $reporter->setChangeTags( $params['tags'] ); + } try { $importer->doImport(); @@ -140,6 +151,10 @@ class ApiImport extends ApiBase { ApiBase::PARAM_TYPE => 'namespace' ], 'rootpage' => null, + 'tags' => [ + ApiBase::PARAM_TYPE => 'tags', + ApiBase::PARAM_ISMULTI => true, + ], ]; } @@ -156,7 +171,7 @@ class ApiImport extends ApiBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Import'; + return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Import'; } }