MediaWiki  REL1_24
RevertAction Class Reference

File reversion user interface. More...

Inheritance diagram for RevertAction:
Collaboration diagram for RevertAction:

List of all members.

Public Member Functions

 getName ()
 Return the name of the action this object responds to.
 getRestriction ()
 Get the permission required to perform this action.
 onSubmit ($data)
 Process the form on POST submission.
 onSuccess ()
 Do something exciting on successful processing of the form.

Protected Member Functions

 alterForm (HTMLForm $form)
 Play with the HTMLForm if you need to more substantially.
 checkCanExecute (User $user)
 Checks if the given user (identified by an object) can perform this action.
 getDescription ()
 Returns the description that goes below the <h1> tag.
 getFormFields ()
 Get an HTMLForm descriptor array.
 getPageTitle ()
 Returns the name that goes in the <h1> page title.

Protected Attributes

OldLocalFile $oldFile

Detailed Description

File reversion user interface.

Definition at line 31 of file RevertAction.php.


Member Function Documentation

RevertAction::alterForm ( HTMLForm form) [protected]

Play with the HTMLForm if you need to more substantially.

Parameters:
HTMLForm$form

Reimplemented from FormAction.

Definition at line 68 of file RevertAction.php.

References HTMLForm\addHiddenField(), array(), Action\getRequest(), Action\getTitle(), HTMLForm\setSubmitTextMsg(), HTMLForm\setTokenSalt(), and HTMLForm\setWrapperLegendMsg().

RevertAction::checkCanExecute ( User user) [protected]

Checks if the given user (identified by an object) can perform this action.

Can be overridden by sub-classes with more complicated permissions schemes. Failures here must throw subclasses of ErrorPageError

Since:
1.17
Parameters:
User$userThe user to check, or null to use the context user
Exceptions:
UserBlockedError|ReadOnlyError|PermissionsError

Reimplemented from Action.

Definition at line 44 of file RevertAction.php.

References array(), Action\getRequest(), Action\getTitle(), Action\msg(), and RepoGroup\singleton().

Returns the description that goes below the <h1> tag.

Since:
1.17
Returns:
string

Reimplemented from Action.

Definition at line 145 of file RevertAction.php.

References Action\getOutput(), and Action\getTitle().

RevertAction::getFormFields ( ) [protected]

Get an HTMLForm descriptor array.

Returns:
array

Reimplemented from FormAction.

Definition at line 75 of file RevertAction.php.

References $timestamp, $user, $wgContLang, array(), Action\getLanguage(), Action\getRequest(), Action\getTitle(), Action\getUser(), global, Action\msg(), page, and wfExpandUrl().

Return the name of the action this object responds to.

Since:
1.17
Returns:
string Lowercase name

Reimplemented from Action.

Definition at line 36 of file RevertAction.php.

RevertAction::getPageTitle ( ) [protected]

Returns the name that goes in the <h1> page title.

Returns:
string

Reimplemented from Action.

Definition at line 141 of file RevertAction.php.

References Action\getTitle(), and Action\msg().

Get the permission required to perform this action.

Often, but not always, the same as the action name

Since:
1.17
Returns:
string|null

Reimplemented from Action.

Definition at line 40 of file RevertAction.php.

Process the form on POST submission.

If you return false from getFormFields(), this will obviously never be reached. If you don't want to do anything with the form, just return false here

Parameters:
array$data
Returns:
bool|array True for success, false for didn't-try, array of errors on failure

Reimplemented from FormAction.

Definition at line 108 of file RevertAction.php.

References $comment, $source, Action\getRequest(), Action\getUser(), and page.

Do something exciting on successful processing of the form.

This might be to show a confirmation message (watch, rollback, etc) or to redirect somewhere else (edit, protect, etc).

Reimplemented from FormAction.

Definition at line 126 of file RevertAction.php.

References $timestamp, $user, Action\getLanguage(), Action\getOutput(), Action\getRequest(), Action\getTitle(), Action\getUser(), page, and wfExpandUrl().


Member Data Documentation

OldLocalFile RevertAction::$oldFile [protected]

Definition at line 34 of file RevertAction.php.


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