MediaWiki  REL1_23
FormSpecialPage Class Reference

Special page which uses an HTMLForm to handle processing. More...

Inheritance diagram for FormSpecialPage:
Collaboration diagram for FormSpecialPage:

List of all members.

Public Member Functions

 execute ($par)
 Basic SpecialPage workflow: get a form, send it to the user; get some data back,.
 onSubmit (array $data)
 Process the form on POST submission.
 onSuccess ()
 Do something exciting on successful processing of the form, most likely to show a confirmation message.
 requiresUnblock ()
 Whether this action cannot be executed by a blocked user.
 requiresWrite ()
 Whether this action requires the wiki not to be locked.

Protected Member Functions

 alterForm (HTMLForm $form)
 Play with the HTMLForm if you need to more substantially.
 checkExecutePermissions (User $user)
 Called from execute() to check if the given user can perform this action.
 getForm ()
 Get the HTMLForm to control behavior.
 getFormFields ()
 Get an HTMLForm descriptor array.
 getMessagePrefix ()
 Get message prefix for HTMLForm.
 postText ()
 Add post-text to the form.
 preText ()
 Add pre-text to the form.
 setParameter ($par)
 Maybe do something interesting with the subpage parameter.

Protected Attributes

string $par = null
 The sub-page of the special page.

Detailed Description

Special page which uses an HTMLForm to handle processing.

This is mostly a clone of FormAction. More special pages should be built this way; maybe this could be a new structure for SpecialPages.

Definition at line 31 of file FormSpecialPage.php.


Member Function Documentation

FormSpecialPage::alterForm ( HTMLForm form) [protected]

Play with the HTMLForm if you need to more substantially.

Parameters:
$formHTMLForm

Reimplemented in SpecialRedirect, SpecialChangePassword, SpecialResetTokens, SpecialPasswordReset, SpecialBlock, SpecialLockdb, and SpecialUnlockdb.

Definition at line 63 of file FormSpecialPage.php.

Called from execute() to check if the given user can perform this action.

Failures here must throw subclasses of ErrorPageError.

Parameters:
$userUser
Exceptions:
UserBlockedError
Returns:
Bool true

Reimplemented in SpecialBlock, SpecialChangePassword, SpecialPasswordReset, SpecialLockdb, and SpecialUnlockdb.

Definition at line 161 of file FormSpecialPage.php.

Basic SpecialPage workflow: get a form, send it to the user; get some data back,.

Parameters:
string$parSubpage string if one was specified

Reimplemented from SpecialPage.

Reimplemented in SpecialResetTokens, and SpecialChangePassword.

Definition at line 133 of file FormSpecialPage.php.

FormSpecialPage::getForm ( ) [protected]

Get the HTMLForm to control behavior.

Returns:
HTMLForm|null

Definition at line 80 of file FormSpecialPage.php.

FormSpecialPage::getFormFields ( ) [abstract, protected]

Get message prefix for HTMLForm.

Since:
1.21
Returns:
string

Definition at line 72 of file FormSpecialPage.php.

FormSpecialPage::onSubmit ( array data) [abstract]

Process the form on POST submission.

Parameters:
$dataArray
Returns:
Bool|Array true for success, false for didn't-try, array of errors on failure

Reimplemented in SpecialBlock, SpecialRedirect, SpecialChangePassword, SpecialPasswordReset, SpecialResetTokens, SpecialLockdb, and SpecialUnlockdb.

Do something exciting on successful processing of the form, most likely to show a confirmation message.

Since:
1.22 Default is to do nothing

Reimplemented in SpecialBlock, SpecialPasswordReset, SpecialRedirect, SpecialChangePassword, SpecialLockdb, SpecialUnlockdb, and SpecialResetTokens.

Definition at line 125 of file FormSpecialPage.php.

FormSpecialPage::postText ( ) [protected]

Add post-text to the form.

Returns:
String HTML which will be sent to $form->addPostText()

Reimplemented in SpecialBlock.

Definition at line 55 of file FormSpecialPage.php.

FormSpecialPage::preText ( ) [protected]

Add pre-text to the form.

Returns:
String HTML which will be sent to $form->addPreText()

Reimplemented in SpecialBlock.

Definition at line 47 of file FormSpecialPage.php.

Whether this action cannot be executed by a blocked user.

Returns:
Bool

Reimplemented in SpecialChangePassword.

Definition at line 188 of file FormSpecialPage.php.

Whether this action requires the wiki not to be locked.

Returns:
Bool

Reimplemented in SpecialLockdb, and SpecialUnlockdb.

Definition at line 180 of file FormSpecialPage.php.

FormSpecialPage::setParameter ( par) [protected]

Maybe do something interesting with the subpage parameter.

Parameters:
string$par

Reimplemented in SpecialBlock, and SpecialRedirect.

Definition at line 150 of file FormSpecialPage.php.


Member Data Documentation

string FormSpecialPage::$par = null [protected]

The sub-page of the special page.

Definition at line 35 of file FormSpecialPage.php.

Referenced by SpecialChangePassword\execute(), and SpecialResetTokens\execute().


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