Inherits ApiBase.
Public Member Functions | |
__construct ($main, $action) | |
execute () | |
Extracts the title, token, and reason from the request parameters and invokes the local delete() function with these as arguments. | |
mustBePosted () | |
Indicates whether this module must be called with a POST request. | |
isWriteMode () | |
Indicates whether this module requires write mode. | |
getAllowedParams () | |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed. | |
getParamDescription () | |
Returns an array of parameter descriptions. | |
getDescription () | |
Returns the description string for this module. | |
getPossibleErrors () | |
Returns a list of all possible errors returned by the module. | |
needsToken () | |
Returns whether this module requires a Token to execute. | |
getTokenSalt () | |
Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token. | |
getVersion () | |
Returns a string that identifies the version of the extending class. | |
Static Public Member Functions | |
static | delete (&$article, $token, &$reason=null) |
We have our own delete() function, since Article.php's implementation is split in two phases. | |
static | deleteFile ($token, &$title, $oldimage, &$reason=null, $suppress=false) |
Protected Member Functions | |
getExamples () | |
Returns usage examples for this module. | |
Static Private Member Functions | |
static | getPermissionsError (&$title, $token) |
Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>.nl
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. http://www.gnu.org/copyleft/gpl.html API module that facilitates deleting pages. The API eqivalent of action=delete. Requires API write mode to be enabled.
Definition at line 36 of file ApiDelete.php.
ApiDelete::__construct | ( | $ | main, | |
$ | action | |||
) |
static ApiDelete::delete | ( | &$ | article, | |
$ | token, | |||
&$ | reason = null | |||
) | [static] |
We have our own delete() function, since Article.php's implementation is split in two phases.
Article | $article - Article object to work on | |
string | $token - Delete token (same as edit token) | |
string | $reason - Reason for the deletion. Autogenerated if NULL |
Definition at line 116 of file ApiDelete.php.
References $title, $wgDeleteRevisionsLimit, $wgUser, ApiBase::dieUsageMsg(), getPermissionsError(), and wfRunHooks().
Referenced by deleteFile(), and execute().
static ApiDelete::deleteFile | ( | $ | token, | |
&$ | title, | |||
$ | oldimage, | |||
&$ | reason = null , |
|||
$ | suppress = false | |||
) | [static] |
Definition at line 152 of file ApiDelete.php.
References $title, delete(), FileDeleteForm::doDelete(), getPermissionsError(), FileDeleteForm::haveDeletableFile(), FileDeleteForm::isValidOldSpec(), RepoGroup::singleton(), and wfFindFile().
Referenced by execute().
ApiDelete::execute | ( | ) |
Extracts the title, token, and reason from the request parameters and invokes the local delete() function with these as arguments.
It does not make use of the delete function specified by Article.php. If the deletion succeeds, the details of the article deleted and the reason for deletion are added to the result object.
Reimplemented from ApiBase.
Definition at line 49 of file ApiDelete.php.
References $wgUser, delete(), deleteFile(), ApiBase::dieUsageMsg(), ApiBase::extractRequestParams(), ApiBase::getModuleName(), ApiBase::getResult(), Title::newFromID(), Title::newFromText(), and ApiBase::requireOnlyOneParameter().
ApiDelete::getAllowedParams | ( | ) |
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (array with PARAM_* constants as keys) Don't call this function directly: use getFinalParams() to allow hooks to modify parameters as needed.
Reimplemented from ApiBase.
Definition at line 192 of file ApiDelete.php.
References ApiBase::PARAM_TYPE.
ApiDelete::getDescription | ( | ) |
Returns the description string for this module.
Reimplemented from ApiBase.
Definition at line 218 of file ApiDelete.php.
ApiDelete::getExamples | ( | ) | [protected] |
Returns usage examples for this module.
Return null if no examples are available.
Reimplemented from ApiBase.
Definition at line 241 of file ApiDelete.php.
ApiDelete::getParamDescription | ( | ) |
Returns an array of parameter descriptions.
Don't call this functon directly: use getFinalParamDescription() to allow hooks to modify descriptions as needed.
Reimplemented from ApiBase.
Definition at line 206 of file ApiDelete.php.
static ApiDelete::getPermissionsError | ( | &$ | title, | |
$ | token | |||
) | [static, private] |
Definition at line 96 of file ApiDelete.php.
References $title, and $wgUser.
Referenced by delete(), and deleteFile().
ApiDelete::getPossibleErrors | ( | ) |
Returns a list of all possible errors returned by the module.
Reimplemented from ApiBase.
Definition at line 224 of file ApiDelete.php.
ApiDelete::getTokenSalt | ( | ) |
Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token.
Reimplemented from ApiBase.
Definition at line 237 of file ApiDelete.php.
ApiDelete::getVersion | ( | ) |
Returns a string that identifies the version of the extending class.
Typically includes the class name, the svn revision, timestamp, and last author. Usually done with SVN's Id keyword
Reimplemented from ApiBase.
Definition at line 248 of file ApiDelete.php.
ApiDelete::isWriteMode | ( | ) |
Indicates whether this module requires write mode.
Reimplemented from ApiBase.
Definition at line 188 of file ApiDelete.php.
ApiDelete::mustBePosted | ( | ) |
Indicates whether this module must be called with a POST request.
Reimplemented from ApiBase.
Definition at line 184 of file ApiDelete.php.
ApiDelete::needsToken | ( | ) |
Returns whether this module requires a Token to execute.
Reimplemented from ApiBase.
Definition at line 233 of file ApiDelete.php.