2007-12-06 16:06:22 +00:00
|
|
|
<?php
|
2010-02-22 12:25:53 +00:00
|
|
|
/**
|
2010-12-22 20:52:06 +00:00
|
|
|
*
|
2007-12-06 16:06:22 +00:00
|
|
|
*
|
2010-08-07 19:59:42 +00:00
|
|
|
* Created on Oct 31, 2007
|
|
|
|
|
*
|
2012-07-15 20:13:02 +00:00
|
|
|
* Copyright © 2007 Roan Kattouw "<Firstname>.<Lastname>@gmail.com"
|
2007-12-06 16:06:22 +00:00
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
2010-06-21 13:13:32 +00:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2007-12-06 16:06:22 +00:00
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
2010-08-07 19:59:42 +00:00
|
|
|
*
|
|
|
|
|
* @file
|
2007-12-06 16:06:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
2010-05-11 22:30:18 +00:00
|
|
|
* API Module to move pages
|
WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>
Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage
One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
|
|
|
* @ingroup API
|
2007-12-06 16:06:22 +00:00
|
|
|
*/
|
|
|
|
|
class ApiMove extends ApiBase {
|
|
|
|
|
|
2010-01-11 15:55:52 +00:00
|
|
|
public function __construct( $main, $action ) {
|
2010-02-22 12:25:53 +00:00
|
|
|
parent::__construct( $main, $action );
|
2007-12-06 16:06:22 +00:00
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2007-12-06 16:06:22 +00:00
|
|
|
public function execute() {
|
2011-10-26 23:27:01 +00:00
|
|
|
$user = $this->getUser();
|
2007-12-06 16:06:22 +00:00
|
|
|
$params = $this->extractRequestParams();
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2010-01-11 15:55:52 +00:00
|
|
|
$this->requireOnlyOneParameter( $params, 'from', 'fromid' );
|
2007-12-06 16:06:22 +00:00
|
|
|
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( isset( $params['from'] ) ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$fromTitle = Title::newFromText( $params['from'] );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( !$fromTitle ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$this->dieUsageMsg( array( 'invalidtitle', $params['from'] ) );
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
|
|
|
|
} elseif ( isset( $params['fromid'] ) ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$fromTitle = Title::newFromID( $params['fromid'] );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( !$fromTitle ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$this->dieUsageMsg( array( 'nosuchpageid', $params['fromid'] ) );
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
2008-10-07 14:57:59 +00:00
|
|
|
}
|
2010-01-23 22:26:40 +00:00
|
|
|
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( !$fromTitle->exists() ) {
|
2011-05-19 17:51:16 +00:00
|
|
|
$this->dieUsageMsg( 'notanarticle' );
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
2007-12-06 16:06:22 +00:00
|
|
|
$fromTalk = $fromTitle->getTalkPage();
|
|
|
|
|
|
2010-01-11 15:55:52 +00:00
|
|
|
$toTitle = Title::newFromText( $params['to'] );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( !$toTitle ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$this->dieUsageMsg( array( 'invalidtitle', $params['to'] ) );
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
2007-12-06 16:06:22 +00:00
|
|
|
$toTalk = $toTitle->getTalkPage();
|
2010-02-22 03:34:56 +00:00
|
|
|
|
2010-01-11 15:55:52 +00:00
|
|
|
if ( $toTitle->getNamespace() == NS_FILE
|
|
|
|
|
&& !RepoGroup::singleton()->getLocalRepo()->findFile( $toTitle )
|
2009-10-24 04:36:11 +00:00
|
|
|
&& wfFindFile( $toTitle ) )
|
|
|
|
|
{
|
2011-10-26 23:27:01 +00:00
|
|
|
if ( !$params['ignorewarnings'] && $user->isAllowed( 'reupload-shared' ) ) {
|
2011-05-19 17:51:16 +00:00
|
|
|
$this->dieUsageMsg( 'sharedfile-exists' );
|
2011-10-26 23:27:01 +00:00
|
|
|
} elseif ( !$user->isAllowed( 'reupload-shared' ) ) {
|
2011-05-19 17:51:16 +00:00
|
|
|
$this->dieUsageMsg( 'cantoverwrite-sharedfile' );
|
2009-10-24 04:36:11 +00:00
|
|
|
}
|
|
|
|
|
}
|
2010-02-22 03:34:56 +00:00
|
|
|
|
2010-01-23 22:52:40 +00:00
|
|
|
// Move the page
|
2012-08-31 14:15:13 +00:00
|
|
|
$toTitleExists = $toTitle->exists();
|
2010-01-11 15:55:52 +00:00
|
|
|
$retval = $fromTitle->moveTo( $toTitle, true, $params['reason'], !$params['noredirect'] );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( $retval !== true ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$this->dieUsageMsg( reset( $retval ) );
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
2008-01-18 15:52:40 +00:00
|
|
|
|
2010-01-11 15:55:52 +00:00
|
|
|
$r = array( 'from' => $fromTitle->getPrefixedText(), 'to' => $toTitle->getPrefixedText(), 'reason' => $params['reason'] );
|
2012-12-13 16:26:43 +00:00
|
|
|
|
|
|
|
|
if ( $fromTitle->exists() ) {
|
|
|
|
|
//NOTE: we assume that if the old title exists, it's because it was re-created as
|
|
|
|
|
// a redirect to the new title. This is not safe, but what we did before was
|
|
|
|
|
// even worse: we just determined whether a redirect should have been created,
|
|
|
|
|
// and reported that it was created if it should have, without any checks.
|
|
|
|
|
// Also note that isRedirect() is unreliable because of bug 37209.
|
2007-12-06 16:06:22 +00:00
|
|
|
$r['redirectcreated'] = '';
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
2012-12-13 16:26:43 +00:00
|
|
|
|
2012-08-31 14:15:13 +00:00
|
|
|
if( $toTitleExists ) {
|
|
|
|
|
$r['moveoverredirect'] = '';
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2010-01-23 22:52:40 +00:00
|
|
|
// Move the talk page
|
2010-07-22 22:13:21 +00:00
|
|
|
if ( $params['movetalk'] && $fromTalk->exists() && !$fromTitle->isTalkPage() ) {
|
2012-08-31 14:15:13 +00:00
|
|
|
$toTalkExists = $toTalk->exists();
|
2010-01-11 15:55:52 +00:00
|
|
|
$retval = $fromTalk->moveTo( $toTalk, true, $params['reason'], !$params['noredirect'] );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( $retval === true ) {
|
2007-12-06 16:06:22 +00:00
|
|
|
$r['talkfrom'] = $fromTalk->getPrefixedText();
|
|
|
|
|
$r['talkto'] = $toTalk->getPrefixedText();
|
2012-08-31 14:15:13 +00:00
|
|
|
if( $toTalkExists ) {
|
|
|
|
|
$r['talkmoveoverredirect'] = '';
|
|
|
|
|
}
|
2010-02-22 12:25:53 +00:00
|
|
|
} else {
|
|
|
|
|
// We're not gonna dieUsage() on failure, since we already changed something
|
2010-01-11 15:55:52 +00:00
|
|
|
$parsed = $this->parseMsg( reset( $retval ) );
|
2009-02-09 14:16:51 +00:00
|
|
|
$r['talkmove-error-code'] = $parsed['code'];
|
|
|
|
|
$r['talkmove-error-info'] = $parsed['info'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-30 01:06:17 +00:00
|
|
|
$result = $this->getResult();
|
|
|
|
|
|
2010-01-23 22:52:40 +00:00
|
|
|
// Move subpages
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( $params['movesubpages'] ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$r['subpages'] = $this->moveSubpages( $fromTitle, $toTitle,
|
|
|
|
|
$params['reason'], $params['noredirect'] );
|
2011-06-30 01:06:17 +00:00
|
|
|
$result->setIndexedTagName( $r['subpages'], 'subpage' );
|
|
|
|
|
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( $params['movetalk'] ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$r['subpages-talk'] = $this->moveSubpages( $fromTalk, $toTalk,
|
|
|
|
|
$params['reason'], $params['noredirect'] );
|
2011-06-30 01:06:17 +00:00
|
|
|
$result->setIndexedTagName( $r['subpages-talk'], 'subpage' );
|
2008-04-14 07:45:50 +00:00
|
|
|
}
|
2007-12-06 16:06:22 +00:00
|
|
|
}
|
2010-04-12 15:44:33 +00:00
|
|
|
|
2013-01-12 06:50:48 +00:00
|
|
|
$watch = 'preferences';
|
2010-04-12 20:15:04 +00:00
|
|
|
if ( isset( $params['watchlist'] ) ) {
|
|
|
|
|
$watch = $params['watchlist'];
|
2010-04-14 12:17:39 +00:00
|
|
|
} elseif ( $params['watch'] ) {
|
2010-04-12 15:44:33 +00:00
|
|
|
$watch = 'watch';
|
2010-03-28 15:08:45 +00:00
|
|
|
} elseif ( $params['unwatch'] ) {
|
2010-04-12 15:44:33 +00:00
|
|
|
$watch = 'unwatch';
|
2010-03-28 15:08:45 +00:00
|
|
|
}
|
|
|
|
|
|
2010-04-12 15:44:33 +00:00
|
|
|
// Watch pages
|
2010-04-14 12:17:39 +00:00
|
|
|
$this->setWatch( $watch, $fromTitle, 'watchmoves' );
|
|
|
|
|
$this->setWatch( $watch, $toTitle, 'watchmoves' );
|
2010-04-12 15:44:33 +00:00
|
|
|
|
2011-06-30 01:06:17 +00:00
|
|
|
$result->addValue( null, $this->getModuleName(), $r );
|
2007-12-06 16:06:22 +00:00
|
|
|
}
|
2010-02-22 03:34:56 +00:00
|
|
|
|
2011-03-07 14:59:41 +00:00
|
|
|
/**
|
|
|
|
|
* @param Title $fromTitle
|
|
|
|
|
* @param Title $toTitle
|
|
|
|
|
* @param $reason
|
|
|
|
|
* @param $noredirect
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
2010-02-22 12:25:53 +00:00
|
|
|
public function moveSubpages( $fromTitle, $toTitle, $reason, $noredirect ) {
|
2009-02-09 14:16:51 +00:00
|
|
|
$retval = array();
|
2010-01-11 15:55:52 +00:00
|
|
|
$success = $fromTitle->moveSubpages( $toTitle, true, $reason, !$noredirect );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( isset( $success[0] ) ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
return array( 'error' => $this->parseMsg( $success ) );
|
2010-02-22 12:25:53 +00:00
|
|
|
} else {
|
2009-02-09 14:16:51 +00:00
|
|
|
// At least some pages could be moved
|
|
|
|
|
// Report each of them separately
|
2010-02-22 12:25:53 +00:00
|
|
|
foreach ( $success as $oldTitle => $newTitle ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$r = array( 'from' => $oldTitle );
|
2010-02-22 12:25:53 +00:00
|
|
|
if ( is_array( $newTitle ) ) {
|
2010-01-11 15:55:52 +00:00
|
|
|
$r['error'] = $this->parseMsg( reset( $newTitle ) );
|
2010-02-22 12:25:53 +00:00
|
|
|
} else {
|
2009-02-09 14:16:51 +00:00
|
|
|
// Success
|
|
|
|
|
$r['to'] = $newTitle;
|
2010-02-22 12:25:53 +00:00
|
|
|
}
|
2009-02-09 14:16:51 +00:00
|
|
|
$retval[] = $r;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return $retval;
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2010-02-14 21:12:11 +00:00
|
|
|
public function mustBePosted() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2008-04-14 07:45:50 +00:00
|
|
|
|
2009-03-06 13:49:44 +00:00
|
|
|
public function isWriteMode() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-28 19:05:26 +00:00
|
|
|
public function getAllowedParams() {
|
2010-02-22 12:25:53 +00:00
|
|
|
return array(
|
2007-12-06 16:06:22 +00:00
|
|
|
'from' => null,
|
2008-10-07 14:57:59 +00:00
|
|
|
'fromid' => array(
|
|
|
|
|
ApiBase::PARAM_TYPE => 'integer'
|
|
|
|
|
),
|
2010-08-04 14:15:33 +00:00
|
|
|
'to' => array(
|
|
|
|
|
ApiBase::PARAM_TYPE => 'string',
|
2010-08-04 14:29:39 +00:00
|
|
|
ApiBase::PARAM_REQUIRED => true
|
2010-08-04 14:15:33 +00:00
|
|
|
),
|
2012-07-18 17:24:38 +00:00
|
|
|
'token' => array(
|
|
|
|
|
ApiBase::PARAM_TYPE => 'string',
|
|
|
|
|
ApiBase::PARAM_REQUIRED => true
|
|
|
|
|
),
|
2012-07-07 07:12:04 +00:00
|
|
|
'reason' => '',
|
2007-12-06 16:06:22 +00:00
|
|
|
'movetalk' => false,
|
2009-02-09 14:16:51 +00:00
|
|
|
'movesubpages' => false,
|
2008-03-02 19:00:50 +00:00
|
|
|
'noredirect' => false,
|
2010-03-25 22:15:08 +00:00
|
|
|
'watch' => array(
|
|
|
|
|
ApiBase::PARAM_DFLT => false,
|
|
|
|
|
ApiBase::PARAM_DEPRECATED => true,
|
|
|
|
|
),
|
|
|
|
|
'unwatch' => array(
|
|
|
|
|
ApiBase::PARAM_DFLT => false,
|
|
|
|
|
ApiBase::PARAM_DEPRECATED => true,
|
|
|
|
|
),
|
|
|
|
|
'watchlist' => array(
|
|
|
|
|
ApiBase::PARAM_DFLT => 'preferences',
|
|
|
|
|
ApiBase::PARAM_TYPE => array(
|
|
|
|
|
'watch',
|
|
|
|
|
'unwatch',
|
|
|
|
|
'preferences',
|
|
|
|
|
'nochange'
|
|
|
|
|
),
|
|
|
|
|
),
|
2009-10-24 04:36:11 +00:00
|
|
|
'ignorewarnings' => false
|
2007-12-06 16:06:22 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-28 19:05:26 +00:00
|
|
|
public function getParamDescription() {
|
2010-05-11 22:30:18 +00:00
|
|
|
$p = $this->getModulePrefix();
|
2010-02-22 12:25:53 +00:00
|
|
|
return array(
|
2010-05-11 22:30:18 +00:00
|
|
|
'from' => "Title of the page you want to move. Cannot be used together with {$p}fromid",
|
|
|
|
|
'fromid' => "Page ID of the page you want to move. Cannot be used together with {$p}from",
|
|
|
|
|
'to' => 'Title you want to rename the page to',
|
2007-12-06 16:06:22 +00:00
|
|
|
'token' => 'A move token previously retrieved through prop=info',
|
2012-07-07 07:12:04 +00:00
|
|
|
'reason' => 'Reason for the move',
|
2010-05-11 22:30:18 +00:00
|
|
|
'movetalk' => 'Move the talk page, if it exists',
|
2009-02-09 14:16:51 +00:00
|
|
|
'movesubpages' => 'Move subpages, if applicable',
|
2008-03-02 19:00:50 +00:00
|
|
|
'noredirect' => 'Don\'t create a redirect',
|
|
|
|
|
'watch' => 'Add the page and the redirect to your watchlist',
|
2009-10-24 04:36:11 +00:00
|
|
|
'unwatch' => 'Remove the page and the redirect from your watchlist',
|
2010-03-25 22:15:08 +00:00
|
|
|
'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
|
2009-10-24 04:36:11 +00:00
|
|
|
'ignorewarnings' => 'Ignore any warnings'
|
2007-12-06 16:06:22 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
Added result properties to action=paraminfo
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.
Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.
Partially implemented modules:
* expandtemplates:
parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
logevents, querypage, recentchanges, revisions, searchinfo,
usercontribs, userinfo, users, watchlist, upload:
response with partially complex structure
Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
non-standard reponse
* help:
error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
response with complex structure
Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
2012-05-02 15:00:30 +00:00
|
|
|
public function getResultProperties() {
|
|
|
|
|
return array(
|
|
|
|
|
'' => array(
|
|
|
|
|
'from' => 'string',
|
|
|
|
|
'to' => 'string',
|
|
|
|
|
'reason' => 'string',
|
|
|
|
|
'redirectcreated' => 'boolean',
|
2012-08-31 14:15:13 +00:00
|
|
|
'moveoverredirect' => 'boolean',
|
Added result properties to action=paraminfo
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.
Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.
Partially implemented modules:
* expandtemplates:
parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
logevents, querypage, recentchanges, revisions, searchinfo,
usercontribs, userinfo, users, watchlist, upload:
response with partially complex structure
Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
non-standard reponse
* help:
error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
response with complex structure
Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
2012-05-02 15:00:30 +00:00
|
|
|
'talkfrom' => array(
|
|
|
|
|
ApiBase::PROP_TYPE => 'string',
|
|
|
|
|
ApiBase::PROP_NULLABLE => true
|
|
|
|
|
),
|
|
|
|
|
'talkto' => array(
|
|
|
|
|
ApiBase::PROP_TYPE => 'string',
|
|
|
|
|
ApiBase::PROP_NULLABLE => true
|
|
|
|
|
),
|
2012-08-31 14:15:13 +00:00
|
|
|
'talkmoveoverredirect' => 'boolean',
|
Added result properties to action=paraminfo
Added information about the properties of the results of API calls
to action=paraminfo, including information about "property groups":
what should the prop parameter be set to to get that property.
Uses the same format for types as parameters already do.
The output format of some modules doesn't fit this, so the result
properties for them weren't added, or only partially.
Partially implemented modules:
* expandtemplates:
parsetree is in its own tag
* protect, allusers, backlinks, deletedrevs, info, imageinfo,
logevents, querypage, recentchanges, revisions, searchinfo,
usercontribs, userinfo, users, watchlist, upload:
response with partially complex structure
Not implemented modules:
* feedcontributions, feedwatchlist, opensearch, rds:
non-standard reponse
* help:
error is normal response; not very useful for automated tools anyway
* paraminfo, parse, pageprops, siteinfo, userrights:
response with complex structure
Change-Id: Iff2a9bef79f994e73eef3062b4dd5461bff968ab
2012-05-02 15:00:30 +00:00
|
|
|
'talkmove-error-code' => array(
|
|
|
|
|
ApiBase::PROP_TYPE => 'string',
|
|
|
|
|
ApiBase::PROP_NULLABLE => true
|
|
|
|
|
),
|
|
|
|
|
'talkmove-error-info' => array(
|
|
|
|
|
ApiBase::PROP_TYPE => 'string',
|
|
|
|
|
ApiBase::PROP_NULLABLE => true
|
|
|
|
|
)
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2008-01-28 19:05:26 +00:00
|
|
|
public function getDescription() {
|
2010-05-25 20:46:09 +00:00
|
|
|
return 'Move a page';
|
2007-12-06 16:06:22 +00:00
|
|
|
}
|
2010-02-22 12:25:53 +00:00
|
|
|
|
2010-02-14 14:29:24 +00:00
|
|
|
public function getPossibleErrors() {
|
2011-02-25 19:09:39 +00:00
|
|
|
return array_merge( parent::getPossibleErrors(),
|
|
|
|
|
$this->getRequireOnlyOneParameterErrorMessages( array( 'from', 'fromid' ) ),
|
|
|
|
|
array(
|
|
|
|
|
array( 'invalidtitle', 'from' ),
|
|
|
|
|
array( 'nosuchpageid', 'fromid' ),
|
|
|
|
|
array( 'notanarticle' ),
|
|
|
|
|
array( 'invalidtitle', 'to' ),
|
|
|
|
|
array( 'sharedfile-exists' ),
|
|
|
|
|
)
|
|
|
|
|
);
|
2010-02-13 00:28:27 +00:00
|
|
|
}
|
2010-02-22 03:34:56 +00:00
|
|
|
|
2010-10-01 20:17:01 +00:00
|
|
|
public function needsToken() {
|
2010-10-01 20:12:50 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2010-02-15 23:53:43 +00:00
|
|
|
public function getTokenSalt() {
|
2010-02-16 21:59:16 +00:00
|
|
|
return '';
|
2010-02-14 22:20:27 +00:00
|
|
|
}
|
2007-12-06 16:06:22 +00:00
|
|
|
|
2011-08-17 22:24:21 +00:00
|
|
|
public function getExamples() {
|
2010-02-22 12:25:53 +00:00
|
|
|
return array(
|
2010-11-23 22:05:27 +00:00
|
|
|
'api.php?action=move&from=Exampel&to=Example&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect='
|
2007-12-06 16:06:22 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2011-07-17 16:38:24 +00:00
|
|
|
public function getHelpUrls() {
|
2011-11-28 15:43:11 +00:00
|
|
|
return 'https://www.mediawiki.org/wiki/API:Move';
|
2011-07-17 16:38:24 +00:00
|
|
|
}
|
2007-12-06 16:06:22 +00:00
|
|
|
}
|