Go to the documentation of this file.
35 if ( !$this->
getUser()->isAllowed(
'undelete' ) ) {
39 if ( $this->
getUser()->isBlocked() ) {
44 if ( !$titleObj || $titleObj->isExternal() ) {
49 if ( !isset(
$params[
'timestamps'] ) ) {
52 if ( !is_array(
$params[
'timestamps'] ) ) {
55 foreach (
$params[
'timestamps']
as $i => $ts ) {
78 $info[
'title'] = $titleObj->getPrefixedText();
79 $info[
'revisions'] = intval(
$retval[0] );
80 $info[
'fileversions'] = intval(
$retval[1] );
104 'timestamps' =>
array(
108 'watchlist' =>
array(
122 'title' =>
'Title of the page you want to restore',
123 'token' =>
'An undelete token previously retrieved through list=deletedrevs',
124 'reason' =>
'Reason for restoring',
125 'timestamps' =>
'Timestamps of the revisions to restore. If not set, all ' .
126 'revisions will be restored.',
127 'watchlist' =>
'Unconditionally add or remove the page from your ' .
128 'watchlist, use preferences or do not change watch',
136 'revisions' =>
'integer',
137 'filerevisions' =>
'integer',
145 'Restore certain revisions of a deleted page. A list of deleted revisions ',
146 '(including timestamps) can be retrieved through list=deletedrevs.'
151 return array_merge( parent::getPossibleErrors(),
array(
152 array(
'permdenied-undelete' ),
153 array(
'blockedtext' ),
154 array(
'invalidtitle',
'title' ),
155 array(
'cannotundelete' ),
169 'api.php?action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page',
170 'api.php?action=undelete&title=Main%20Page&token=123ABC×tamps=20070703220045|20070702194856'
175 return 'https://www.mediawiki.org/wiki/API:Undelete';
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
Used to show archived pages and eventually restore them.
getTokenSalt()
Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the mo...
dieUsageMsg( $error)
Output the error message related to a certain array.
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getResult()
Get the result object.
getExamples()
Returns usage examples for this module.
getUser()
Get the User object.
This abstract class implements many basic API functions, and is the base of all API classes.
getParamDescription()
Returns an array of parameter descriptions.
needsToken()
Returns whether this module requires a token to execute It is used to show possible errors in action=...
getDescription()
Returns the description string for this module.
wfRunHooks( $event, array $args=array(), $deprecatedVersion=null)
Call hook functions defined in $wgHooks.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
isWriteMode()
Indicates whether this module requires write mode.
setWatch( $watch, $titleObj, $userOption=null)
Set a watch (or unwatch) based the based on a watchlist parameter.
const TS_MW
MediaWiki concatenated string timestamp (YYYYMMDDHHMMSS)
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getPossibleErrors()
Returns a list of all possible errors returned by the module.
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
getModuleName()
Get the name of the module being executed by this instance.
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account incomplete not yet checked for validity & $retval
getResultProperties()
Returns possible properties in the result, grouped by the value of the prop parameter that shows them...
mustBePosted()
Indicates whether this module must be called with a POST request.