BlueSpice MediaWiki master
 All Classes Namespaces Files Functions Variables Groups Pages
FormAction Class Reference
Inheritance diagram for FormAction:
Collaboration diagram for FormAction:

Public Member Functions

 onSubmit ($data)
 
 onSuccess ()
 
 show ()
 
 doesWrites ()
 
- Public Member Functions inherited from Action
 getContext ()
 
 getRequest ()
 
 getOutput ()
 
 getUser ()
 
 getSkin ()
 
 getLanguage ()
 
 getTitle ()
 
 msg ($key)
 
 __construct (Page $page, IContextSource $context=null)
 
 getName ()
 
 getRestriction ()
 
 requiresWrite ()
 
 requiresUnblock ()
 
 addHelpLink ($to, $overrideBaseUrl=false)
 
 show ()
 
 doesWrites ()
 

Protected Member Functions

 getFormFields ()
 
 preText ()
 
 postText ()
 
 alterForm (HTMLForm $form)
 
 usesOOUI ()
 
 getForm ()
 
- Protected Member Functions inherited from Action
 checkCanExecute (User $user)
 
 setHeaders ()
 
 getPageTitle ()
 
 getDescription ()
 
 useTransactionalTimeLimit ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Action
static factory ($action, Page $page, IContextSource $context=null)
 
static getActionName (IContextSource $context)
 
static exists ($name)
 
- Protected Attributes inherited from Action
 $page
 
 $context
 
 $fields
 

Detailed Description

An action which shows a form and does something based on the input from the form

Member Function Documentation

FormAction::alterForm ( HTMLForm  $form)
protected

Play with the HTMLForm if you need to more substantially

Parameters
HTMLForm$form
FormAction::getForm ( )
protected

Get the HTMLForm to control behavior

Returns
HTMLForm|null
FormAction::getFormFields ( )
protected

Get an HTMLForm descriptor array

Returns
array
FormAction::onSubmit (   $data)
abstract

Process the form on POST submission.

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
FormAction::onSuccess ( )
abstract

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

FormAction::postText ( )
protected
Returns
string
FormAction::preText ( )
protected

Add pre- or post-text to the form

Returns
string HTML which will be sent to $form->addPreText()
FormAction::show ( )

The basic pattern for actions is to display some sort of HTMLForm UI, maybe with some stuff underneath (history etc); to do some processing on submission of that form (delete, protect, etc) and to do something exciting on 'success', be that display something new or redirect to somewhere. Some actions have more exotic behavior, but that's what subclassing is for :D

FormAction::usesOOUI ( )
protected

Whether the form should use OOUI

Returns
bool

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