34 if ( $user->isBlocked() ) {
38 $titleObj = Title::newFromText(
$params[
'title'] );
39 if ( !$titleObj || $titleObj->isExternal() ) {
43 if ( !$titleObj->userCan(
'undelete', $user,
'secure' ) ) {
48 if ( !is_null(
$params[
'tags'] ) ) {
50 if ( !$ableToTag->isOK() ) {
56 if ( !isset(
$params[
'timestamps'] ) ) {
59 if ( !is_array(
$params[
'timestamps'] ) ) {
62 foreach (
$params[
'timestamps'] as $i => $ts ) {
80 Hooks::run(
'FileUndeleteComplete',
86 $info[
'title'] = $titleObj->getPrefixedText();
87 $info[
'revisions'] = intval(
$retval[0] );
88 $info[
'fileversions'] = intval(
$retval[1] );
138 'action=undelete&title=Main%20Page&token=123ABC&reason=Restoring%20main%20page'
139 =>
'apihelp-undelete-example-page',
140 'action=undelete&title=Main%20Page&token=123ABC' .
141 '×tamps=2007-07-03T22:00:45Z|2007-07-02T19:48:56Z'
142 =>
'apihelp-undelete-example-revisions',
147 return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Undelete';
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
This abstract class implements many basic API functions, and is the base of all API classes.
const PARAM_REQUIRED
(boolean) Is the parameter required?
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
setWatch( $watch, $titleObj, $userOption=null)
Set a watch (or unwatch) based the based on a watchlist parameter.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
extractRequestParams( $parseLimit=true)
Using getAllowedParams(), this function makes an array of the values provided by the user,...
getResult()
Get the result object.
getModuleName()
Get the name of the module being executed by this instance.
dieStatus(StatusValue $status)
Throw an ApiUsageException based on the Status object.
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
dieBlocked(Block $block)
Throw an ApiUsageException, which will (if uncaught) call the main module's error handler and die wit...
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
needsToken()
Returns the token type this module requires in order to execute.
mustBePosted()
Indicates whether this module must be called with a POST request.
getHelpUrls()
Return links to more detailed help pages about the module.
getExamplesMessages()
Returns usage examples for this module.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...
isWriteMode()
Indicates whether this module requires write mode.
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
Used to show archived pages and eventually restore them.
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 local account incomplete not yet checked for validity & $retval
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true