ApiDelete Class Reference
[API]

API module that facilitates deleting pages. More...

Inherits ApiBase.

List of all members.

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.
 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)


Detailed Description

API module that facilitates deleting pages.

The API eqivalent of action=delete. Requires API write mode to be enabled.

Definition at line 37 of file ApiDelete.php.


Constructor & Destructor Documentation

ApiDelete::__construct ( main,
action 
)

Definition at line 39 of file ApiDelete.php.

References $action.


Member Function Documentation

static ApiDelete::delete ( &$  article,
token,
&$  reason = NULL 
) [static]

We have our own delete() function, since Article.php's implementation is split in two phases.

Parameters:
Article $article - Article object to work on
string $token - Delete token (same as edit token)
string $reason - Reason for the deletion. Autogenerated if NULL
Returns:
Title::getUserPermissionsErrors()-like array

Definition at line 122 of file ApiDelete.php.

References $error, $reason, $title, $wgUser, ApiBase::dieUsageMsg(), getPermissionsError(), and wfRunHooks().

Referenced by execute().

static ApiDelete::deleteFile ( token,
&$  title,
oldimage,
&$  reason = NULL,
suppress = false 
) [static]

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 50 of file ApiDelete.php.

References $reason, $wgDeleteRevisionsLimit, $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.

Returns:
array

Reimplemented from ApiBase.

Definition at line 184 of file ApiDelete.php.

ApiDelete::getDescription (  ) 

Returns the description string for this module.

Returns:
mixed string or array of strings

Reimplemented from ApiBase.

Definition at line 210 of file ApiDelete.php.

ApiDelete::getExamples (  )  [protected]

Returns usage examples for this module.

Return null if no examples are available.

Returns:
mixed string or array of strings

Reimplemented from ApiBase.

Definition at line 216 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.

Returns:
array

Reimplemented from ApiBase.

Definition at line 198 of file ApiDelete.php.

static ApiDelete::getPermissionsError ( &$  title,
token 
) [static, private]

Definition at line 101 of file ApiDelete.php.

References $title, and $wgUser.

Referenced by delete(), and deleteFile().

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

Returns:
string

Reimplemented from ApiBase.

Definition at line 223 of file ApiDelete.php.

ApiDelete::isWriteMode (  ) 

Indicates whether this module requires write mode.

Returns:
bool

Reimplemented from ApiBase.

Definition at line 180 of file ApiDelete.php.

ApiDelete::mustBePosted (  ) 

Indicates whether this module must be called with a POST request.

Returns:
bool

Reimplemented from ApiBase.

Definition at line 178 of file ApiDelete.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:30 2009 for MediaWiki by  doxygen 1.5.9