MediaWiki  REL1_24
HTMLForm Class Reference

Object handling generic submission, CSRF protection, layout and other logic for UI forms. More...

Inheritance diagram for HTMLForm:
Collaboration diagram for HTMLForm:

List of all members.

Public Member Functions

 __construct ($descriptor, $context=null, $messagePrefix= '')
 Build a new HTMLForm from an array of field attributes.
 addButton ($name, $value, $id=null, $attribs=null)
 Add a button to the form.
 addFooterText ($msg, $section=null)
 Add footer text, inside the form.
 addHeaderText ($msg, $section=null)
 Add header text, inside the form.
 addHiddenField ($name, $value, $attribs=array())
 Add a hidden field to the output.
 addHiddenFields (array $fields)
 Add an array of hidden fields to the output.
 addPostText ($msg)
 Add text to the end of the display.
 addPreText ($msg)
 Add introductory text.
 displayForm ($submitResult)
 Display the form (sending to the context's OutputPage object), with an appropriate error message or stack of messages, and any validation errors, etc.
 displaySection ($fields, $sectionName= '', $fieldsetIDPrefix= '', &$hasUserVisibleFields=false)
 filterDataForSubmit ($data)
 Overload this if you want to apply special filtration routines to the form as a whole, after it's submitted but before it's processed.
 getAction ()
 Get the value for the action attribute of the form.
 getBody ()
 Get the whole body of the form.
 getButtons ()
 Get the submit and (potentially) reset buttons.
 getDisplayFormat ()
 Getter for displayFormat.
 getErrors ($errors)
 Format and display an error message stack.
 getHiddenFields ()
 Get the hidden fields that should go inside the form.
 getHTML ($submitResult)
 Returns the raw HTML generated by the form.
 getLegend ($key)
 Get a string to go in the "<legend>" of a section fieldset.
 getMethod ()
 getSubmitText ()
 Get the text for the submit button, either customised or a default.
 getTitle ()
 Get the title.
 isVForm ()
 Test if displayFormat is 'vform'.
 loadData ()
 Construct the form fields from the Descriptor array.
 prepareForm ()
 Prepare form for submission.
 setAction ($action)
 Set the value for the action attribute of the form.
 setDisplayFormat ($format)
 Set format in which to display the form.
 setFooterText ($msg, $section=null)
 Set footer text, inside the form.
 setHeaderText ($msg, $section=null)
 Set header text, inside the form.
 setId ($id)
 setIntro ($msg)
 Set the introductory message, overwriting any existing message.
 setMessagePrefix ($p)
 Set the prefix for various default messages.
 setMethod ($method= 'post')
 Set the method used to submit the form.
 setPostText ($msg)
 Set text at the end of the display.
 setPreText ($msg)
 Set the introductory message, overwriting any existing message.
 setSubmitCallback ($cb)
 Set a callback to a function to do something with the form once it's been successfully validated.
 setSubmitDestructive ()
 Identify that the submit button in the form has a destructive action.
 setSubmitID ($t)
 Set the id for the submit button.
 setSubmitName ($name)
 setSubmitText ($t)
 Set the text for the submit button.
 setSubmitTextMsg ($msg)
 Set the text for the submit button to a message.
 setSubmitTooltip ($name)
 setTableId ($id)
 Set the id of the <table> or outermost <div> element.
 setTitle ($t)
 Set the title for form submission.
 setTokenSalt ($salt)
 Set the salt for the edit token.
 setValidationErrorMessage ($msg)
 Set a message to display on a validation error.
 setWrapperLegend ($legend)
 Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element.
 setWrapperLegendMsg ($msg)
 Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element.
 show ()
 The here's-one-I-made-earlier option: do the submission if posted, or display the form with or without funky validation errors.
 suppressDefaultSubmit ($suppressSubmit=true)
 Stop a default submit button being shown for this form.
 suppressReset ($suppressReset=true)
 Stop a reset button being shown for this form.
 tryAuthorizedSubmit ()
 Try submitting, with edit token check first.
 trySubmit ()
 Validate all the fields, and call the submission callback function if everything is kosher.
 wasSubmitted ()
 Test whether the form was considered to have been submitted or not, i.e.
 wrapForm ($html)
 Wrap the form innards in an actual "<form>" element.

Static Public Member Functions

static formatErrors ($errors)
 Format a stack of error messages into a single HTML string.
static getClassFromDescriptor ($fieldname, &$descriptor)
 Get the HTMLFormField subclass for this descriptor.
static loadInputFromParameters ($fieldname, $descriptor)
 Initialise a new Object for the field.

Public Attributes

 $mFieldData

Static Public Attributes

static $typeMappings

Protected Attributes

array $availableDisplayFormats
 Available formats in which to display the form.
string $displayFormat = 'table'
 Format in which to display form.
bool string $mAction = false
 Form action URL.
 $mButtons = array()
 $mFieldTree
HTMLFormField[] $mFlatFields
 *
 $mFooter = ''
 $mHeader = ''
 $mHiddenFields = array()
 $mId
 $mMessagePrefix
 $mMethod = 'post'
 $mPost = ''
 $mPre = ''
 $mSectionFooters = array()
 $mSectionHeaders = array()
 $mShowReset = false
 $mShowSubmit = true
 $mSubmitCallback
 $mSubmitID
 $mSubmitModifierClass = 'mw-ui-constructive'
 $mSubmitName
 $mSubmitText
 $mSubmitTooltip
 $mSubSectionBeforeFields = true
 If true, sections that contain both fields and subsections will render their subsections before their fields.
 $mTableId = ''
 $mTitle
string array $mTokenSalt = ''
 Salt for the edit token.
 $mUseMultipart = false
 $mValidationErrorMessage
 $mWasSubmitted = false
 $mWrapperLegend = false

Detailed Description

Object handling generic submission, CSRF protection, layout and other logic for UI forms.

in a reusable manner.

In order to generate the form, the HTMLForm object takes an array structure detailing the form fields available. Each element of the array is a basic property-list, including the type of field, the label it is to be given in the form, callbacks for validation and 'filtering', and other pertinent information.

Field types are implemented as subclasses of the generic HTMLFormField object, and typically implement at least getInputHTML, which generates the HTML for the input field to be placed in the table.

You can find extensive documentation on the www.mediawiki.org wiki:

The constructor input is an associative array of $fieldname => $info, where $info is an Associative Array with any of the following:

'class' -- the subclass of HTMLFormField that will be used to create the object. *NOT* the CSS class! 'type' -- roughly translates into the <select> type attribute. if 'class' is not specified, this is used as a map through HTMLForm::$typeMappings to get the class name. 'default' -- default value when the form is displayed 'id' -- HTML id attribute 'cssclass' -- CSS class 'csshelpclass' -- CSS class used to style help text 'options' -- associative array mapping labels to values. Some field types support multi-level arrays. 'options-messages' -- associative array mapping message keys to values. Some field types support multi-level arrays. 'options-message' -- message key to be parsed to extract the list of options (like 'ipbreason-dropdown'). 'label-message' -- message key for a message to use as the label. can be an array of msg key and then parameters to the message. 'label' -- alternatively, a raw text message. Overridden by label-message 'help' -- message text for a message to use as a help text. 'help-message' -- message key for a message to use as a help text. can be an array of msg key and then parameters to the message. Overwrites 'help-messages' and 'help'. 'help-messages' -- array of message key. As above, each item can be an array of msg key and then parameters. Overwrites 'help'. 'required' -- passed through to the object, indicating that it is a required field. 'size' -- the length of text fields 'filter-callback -- a function name to give you the chance to massage the inputted value before it's processed.

See also:
HTMLForm::filter() 'validation-callback' -- a function name to give you the chance to impose extra validation on the field input.
HTMLForm::validate() 'name' -- By default, the 'name' attribute of the input field is "wp{$fieldname}". If you want a different name (eg one without the "wp" prefix), specify it here and it will be used without modification.

Since 1.20, you can chain mutators to ease the form generation:

Example:
 $form = new HTMLForm( $someFields );
 $form->setMethod( 'get' )
      ->setWrapperLegendMsg( 'message-key' )
      ->prepareForm()
      ->displayForm( '' );
Note that you will have prepareForm and displayForm at the end. Other methods call done after that would simply not be part of the form :(
Todo:
Document 'section' / 'subsection' stuff

Definition at line 101 of file HTMLForm.php.


Constructor & Destructor Documentation

HTMLForm::__construct ( descriptor,
context = null,
messagePrefix = '' 
)

Build a new HTMLForm from an array of field attributes.

Parameters:
array$descriptorArray of Field constructs, as described above
IContextSource$contextAvailable since 1.18, will become compulsory in 1.18. Obviates the need to call $form->setTitle()
string$messagePrefixA prefix to go in front of default messages

Definition at line 214 of file HTMLForm.php.


Member Function Documentation

HTMLForm::addButton ( name,
value,
id = null,
attribs = null 
)

Add a button to the form.

Parameters:
string$nameField name.
string$valueField value
string$idDOM id for the button (default: null)
array$attribs
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 737 of file HTMLForm.php.

Referenced by SpecialChangePassword\alterForm().

HTMLForm::addFooterText ( msg,
section = null 
)

Add footer text, inside the form.

Parameters:
string$msgComplete text of message to display
string | null$sectionThe section to add the footer text to
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 635 of file HTMLForm.php.

HTMLForm::addHeaderText ( msg,
section = null 
)

Add header text, inside the form.

Parameters:
string$msgComplete text of message to display
string | null$sectionThe section to add the header to
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 595 of file HTMLForm.php.

Referenced by UploadForm\getDescriptionSection().

HTMLForm::addHiddenField ( name,
value,
attribs = array() 
)

Add a hidden field to the output.

Parameters:
string$nameField name. This will be used exactly as entered
string$valueField value
array$attribs
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 702 of file HTMLForm.php.

Referenced by RevertAction\alterForm(), and SpecialChangeEmail\alterForm().

Add an array of hidden fields to the output.

Since:
1.22
Parameters:
array$fieldsAssociative array of fields to add; mapping names to their values
Returns:
HTMLForm $this for chaining calls

Definition at line 719 of file HTMLForm.php.

Referenced by SpecialChangePassword\alterForm().

Add text to the end of the display.

Parameters:
string$msgComplete text of message to display
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 674 of file HTMLForm.php.

Add introductory text.

Parameters:
string$msgComplete text of message to display
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 581 of file HTMLForm.php.

Referenced by SpecialChangePassword\alterForm().

HTMLForm::displayForm ( submitResult)

Display the form (sending to the context's OutputPage object), with an appropriate error message or stack of messages, and any validation errors, etc.

Attention:
You should call prepareForm() before calling this function. Moreover, when doing method chaining this should be the very last method call just after prepareForm().
Parameters:
bool | string | array | Status$submitResultOutput from HTMLForm::trySubmit()
Returns:
void Nothing, should be last call

Definition at line 770 of file HTMLForm.php.

HTMLForm::displaySection ( fields,
sectionName = '',
fieldsetIDPrefix = '',
&$  hasUserVisibleFields = false 
)
Todo:
Document
Parameters:
array[]|HTMLFormField[]$fields Array of fields (either arrays or objects).
string$sectionNameID attribute of the "<table>" tag for this section, ignored if empty.
string$fieldsetIDPrefixID prefix for the "<fieldset>" tag of each subsection, ignored if empty.
bool&$hasUserVisibleFieldsWhether the section had user-visible fields.
Returns:
string

Definition at line 1256 of file HTMLForm.php.

Referenced by EditWatchlistNormalHTMLForm\getBody(), getBody(), and PreferencesForm\getBody().

Overload this if you want to apply special filtration routines to the form as a whole, after it's submitted but before it's processed.

Parameters:
array$data
Returns:
array

Reimplemented in PreferencesForm.

Definition at line 1410 of file HTMLForm.php.

static HTMLForm::formatErrors ( errors) [static]

Format a stack of error messages into a single HTML string.

Parameters:
array$errorsArray of message keys/values
Returns:
string HTML, a "<ul>" list of errors

Definition at line 1005 of file HTMLForm.php.

Get the value for the action attribute of the form.

Since:
1.22
Returns:
string

Definition at line 1449 of file HTMLForm.php.

Get the whole body of the form.

Returns:
string

Reimplemented in PreferencesForm, and EditWatchlistNormalHTMLForm.

Definition at line 969 of file HTMLForm.php.

References displaySection().

Get the submit and (potentially) reset buttons.

Returns:
string HTML.

Reimplemented in PreferencesForm.

Definition at line 874 of file HTMLForm.php.

References $attribs, $html, array(), as, Html\element(), ContextSource\getConfig(), getSubmitText(), isVForm(), ContextSource\msg(), Html\rawElement(), Xml\submitButton(), text, and Linker\tooltipAndAccesskeyAttribs().

static HTMLForm::getClassFromDescriptor ( fieldname,
&$  descriptor 
) [static]

Get the HTMLFormField subclass for this descriptor.

The descriptor can be passed either 'class' which is the name of a HTMLFormField subclass, or a shorter 'type' which is an alias. This makes sure the 'class' is always set, and also is returned by this function for ease.

Since:
1.23
Parameters:
string$fieldnameName of the field
array$descriptorInput Descriptor, as described above
Exceptions:
MWException
Returns:
string Name of a HTMLFormField subclass

Definition at line 332 of file HTMLForm.php.

Getter for displayFormat.

Since:
1.20
Returns:
string

Definition at line 299 of file HTMLForm.php.

HTMLForm::getErrors ( errors)

Format and display an error message stack.

Parameters:
string | array | Status$errors
Returns:
string

Definition at line 980 of file HTMLForm.php.

Get the hidden fields that should go inside the form.

Returns:
string HTML.

Definition at line 846 of file HTMLForm.php.

References $attribs, $html, $value, array(), as, ContextSource\getConfig(), getMethod(), getTitle(), ContextSource\getUser(), Html\hidden(), and list.

HTMLForm::getHTML ( submitResult)

Returns the raw HTML generated by the form.

Parameters:
bool | string | array | Status$submitResultOutput from HTMLForm::trySubmit()
Returns:
string

Definition at line 781 of file HTMLForm.php.

HTMLForm::getLegend ( key)

Get a string to go in the "<legend>" of a section fieldset.

Override this if you want something more complicated.

Parameters:
string$key
Returns:
string

Reimplemented in PreferencesForm, and EditWatchlistNormalHTMLForm.

Definition at line 1422 of file HTMLForm.php.

Definition at line 1239 of file HTMLForm.php.

Referenced by getHiddenFields(), and tryAuthorizedSubmit().

Get the text for the submit button, either customised or a default.

Returns:
string

Definition at line 1070 of file HTMLForm.php.

References ContextSource\msg().

Referenced by getButtons().

Get the title.

Returns:
Title

Reimplemented from ContextSource.

Definition at line 1220 of file HTMLForm.php.

References ContextSource\getContext().

Referenced by getHiddenFields().

Test if displayFormat is 'vform'.

Since:
1.22
Returns:
bool

Definition at line 312 of file HTMLForm.php.

Referenced by getButtons().

Construct the form fields from the Descriptor array.

Definition at line 1366 of file HTMLForm.php.

static HTMLForm::loadInputFromParameters ( fieldname,
descriptor 
) [static]

Initialise a new Object for the field.

Parameters:
string$fieldnameName of the field
array$descriptorInput Descriptor, as described above
Exceptions:
MWException
Returns:
HTMLFormField Instance of a subclass of HTMLFormField

Definition at line 359 of file HTMLForm.php.

Referenced by ApiOptions\execute(), HTMLFormFieldCloner\getInputHTML(), and Preferences\loadPreferenceValues().

Prepare form for submission.

Attention:
When doing method chaining, that should be the very last method call before displayForm().
Exceptions:
MWException
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 381 of file HTMLForm.php.

HTMLForm::setAction ( action)

Set the value for the action attribute of the form.

When set to false (which is the default state), the set title is used.

Since:
1.19
Parameters:
string | bool$action
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1436 of file HTMLForm.php.

Set format in which to display the form.

Parameters:
string$formatThe name of the format to use, must be one of $this->availableDisplayFormats
Exceptions:
MWException
Since:
1.20
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 284 of file HTMLForm.php.

Referenced by SpecialPageLanguage\alterForm(), and SpecialChangeEmail\alterForm().

HTMLForm::setFooterText ( msg,
section = null 
)

Set footer text, inside the form.

Since:
1.19
Parameters:
string$msgComplete text of message to display
string | null$sectionThe section to add the footer text to
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 657 of file HTMLForm.php.

HTMLForm::setHeaderText ( msg,
section = null 
)

Set header text, inside the form.

Since:
1.19
Parameters:
string$msgComplete text of message to display
string | null$sectionThe section to add the header to
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 617 of file HTMLForm.php.

Referenced by SpecialUnlockdb\alterForm(), SpecialLockdb\alterForm(), and SpecialChangePassword\alterForm().

HTMLForm::setId ( id)
Parameters:
string$idDOM id for the form
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1148 of file HTMLForm.php.

Referenced by SpecialChangeEmail\alterForm(), and SpecialChangePassword\alterForm().

HTMLForm::setIntro ( msg)

Set the introductory message, overwriting any existing message.

Parameters:
string$msgComplete text of message to display
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 554 of file HTMLForm.php.

Set the prefix for various default messages.

Todo:
Currently only used for the "<fieldset>" legend on forms with multiple sections; should be used elsewhere?
Parameters:
string$p
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1197 of file HTMLForm.php.

HTMLForm::setMethod ( method = 'post')

Set the method used to submit the form.

Parameters:
string$method
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1233 of file HTMLForm.php.

Set text at the end of the display.

Parameters:
string$msgComplete text of message to display
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 687 of file HTMLForm.php.

Set the introductory message, overwriting any existing message.

Since:
1.19
Parameters:
string$msgComplete text of message to display
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 568 of file HTMLForm.php.

Set a callback to a function to do something with the form once it's been successfully validated.

Parameters:
callable$cbThe function will be passed the output from HTMLForm::filterDataForSubmit and this HTMLForm object, and must return as documented for HTMLForm::trySubmit
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 527 of file HTMLForm.php.

Identify that the submit button in the form has a destructive action.

Definition at line 1045 of file HTMLForm.php.

Set the id for the submit button.

Parameters:
string$t
Todo:
FIXME: Integrity of $t is *not* validated
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1106 of file HTMLForm.php.

Parameters:
string$nameSubmit button name
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1081 of file HTMLForm.php.

Set the text for the submit button.

Parameters:
string$tPlaintext
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1035 of file HTMLForm.php.

Set the text for the submit button to a message.

Since:
1.19
Parameters:
string | Message$msgMessage key or Message object
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1057 of file HTMLForm.php.

Referenced by UnwatchAction\alterForm(), SpecialUnlockdb\alterForm(), SpecialLockdb\alterForm(), RevertAction\alterForm(), PurgeAction\alterForm(), SpecialChangeEmail\alterForm(), SpecialResetTokens\alterForm(), SpecialChangePassword\alterForm(), and WatchAction\alterForm().

Parameters:
string$nameTooltip for the submit button
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1092 of file HTMLForm.php.

Set the id of the <table> or outermost <div> element.

Since:
1.22
Parameters:
string$idNew value of the id attribute, or "" to remove
Returns:
HTMLForm $this for chaining calls

Definition at line 1137 of file HTMLForm.php.

Referenced by SpecialChangeEmail\alterForm(), and SpecialChangePassword\alterForm().

Set the title for form submission.

Parameters:
Title$tTitle of page the form is on/should be posted to
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1210 of file HTMLForm.php.

Set the salt for the edit token.

Only useful when the method is "post".

Since:
1.24
Parameters:
string | array$saltSalt to use
Returns:
HTMLForm $this For chaining calls

Definition at line 752 of file HTMLForm.php.

Referenced by RevertAction\alterForm().

Set a message to display on a validation error.

Parameters:
string | array$msgString or Array of valid inputs to wfMessage() (so each entry can be either a String or Array)
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 541 of file HTMLForm.php.

Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element.

Parameters:
string | bool$legendHTML to go inside the "<legend>" element, or false for no <legend> Will be escaped
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1164 of file HTMLForm.php.

Referenced by SpecialUnlockdb\alterForm(), SpecialLockdb\alterForm(), SpecialPageLanguage\alterForm(), and SpecialChangeEmail\alterForm().

Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element.

Since:
1.19
Parameters:
string | Message$msgMessage key or Message object
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1179 of file HTMLForm.php.

Referenced by RevertAction\alterForm(), and SpecialChangePassword\alterForm().

The here's-one-I-made-earlier option: do the submission if posted, or display the form with or without funky validation errors.

Returns:
bool|Status Whether submission was successful.

Reimplemented in UploadForm.

Definition at line 429 of file HTMLForm.php.

HTMLForm::suppressDefaultSubmit ( suppressSubmit = true)

Stop a default submit button being shown for this form.

This implies that an alternate submit method must be provided manually.

Since:
1.22
Parameters:
bool$suppressSubmitSet to false to re-enable the button again
Returns:
HTMLForm $this for chaining calls

Definition at line 1122 of file HTMLForm.php.

Referenced by SpecialResetTokens\alterForm().

HTMLForm::suppressReset ( suppressReset = true)

Stop a reset button being shown for this form.

Parameters:
bool$suppressResetSet to false to re-enable the button again
Returns:
HTMLForm $this for chaining calls (since 1.20)

Definition at line 1395 of file HTMLForm.php.

Try submitting, with edit token check first.

Returns:
Status|bool

Definition at line 397 of file HTMLForm.php.

References $result, getMethod(), ContextSource\getRequest(), ContextSource\getUser(), and trySubmit().

Validate all the fields, and call the submission callback function if everything is kosher.

Exceptions:
MWException
Returns:
bool|string|array|Status
  • Bool true or a good Status object indicates success,
  • Bool false indicates no submission was attempted,
  • Anything else indicates failure. The value may be a fatal Status object, an HTML string, or an array of arrays (message keys and params) or strings (message keys)

Reimplemented in UploadForm.

Definition at line 453 of file HTMLForm.php.

Referenced by tryAuthorizedSubmit().

Test whether the form was considered to have been submitted or not, i.e.

whether the last call to tryAuthorizedSubmit or trySubmit returned non-false.

This will return false until HTMLForm::tryAuthorizedSubmit or HTMLForm::trySubmit is called.

Since:
1.23
Returns:
bool

Definition at line 513 of file HTMLForm.php.

HTMLForm::wrapForm ( html)

Wrap the form innards in an actual "<form>" element.

Parameters:
string$htmlHTML contents to wrap.
Returns:
string Wrapped HTML.

Reimplemented in PreferencesForm.

Definition at line 814 of file HTMLForm.php.


Member Data Documentation

array HTMLForm::$availableDisplayFormats [protected]
Initial value:
 array(
        'table',
        'div',
        'raw',
        'vform',
    )

Available formats in which to display the form.

Definition at line 199 of file HTMLForm.php.

string HTMLForm::$displayFormat = 'table' [protected]

Format in which to display form.

For viable options,

See also:
$availableDisplayFormats

Definition at line 194 of file HTMLForm.php.

bool string HTMLForm::$mAction = false [protected]

Form action URL.

false means we will use the URL to set Title

Since:
1.19

Definition at line 168 of file HTMLForm.php.

HTMLForm::$mButtons = array() [protected]

Definition at line 172 of file HTMLForm.php.

HTMLForm::$mFieldData

Definition at line 132 of file HTMLForm.php.

HTMLForm::$mFieldTree [protected]

Definition at line 138 of file HTMLForm.php.

HTMLFormField [] HTMLForm::$mFlatFields [protected]

*

Definition at line 136 of file HTMLForm.php.

HTMLForm::$mFooter = '' [protected]

Definition at line 148 of file HTMLForm.php.

HTMLForm::$mHeader = '' [protected]

Definition at line 147 of file HTMLForm.php.

HTMLForm::$mHiddenFields = array() [protected]

Definition at line 171 of file HTMLForm.php.

HTMLForm::$mId [protected]

Definition at line 152 of file HTMLForm.php.

HTMLForm::$mMessagePrefix [protected]

Definition at line 134 of file HTMLForm.php.

HTMLForm::$mMethod = 'post' [protected]

Definition at line 161 of file HTMLForm.php.

HTMLForm::$mPost = '' [protected]

Definition at line 151 of file HTMLForm.php.

HTMLForm::$mPre = '' [protected]

Definition at line 146 of file HTMLForm.php.

HTMLForm::$mSectionFooters = array() [protected]

Definition at line 150 of file HTMLForm.php.

HTMLForm::$mSectionHeaders = array() [protected]

Definition at line 149 of file HTMLForm.php.

HTMLForm::$mShowReset = false [protected]

Definition at line 139 of file HTMLForm.php.

HTMLForm::$mShowSubmit = true [protected]

Definition at line 140 of file HTMLForm.php.

HTMLForm::$mSubmitCallback [protected]

Definition at line 143 of file HTMLForm.php.

HTMLForm::$mSubmitID [protected]

Definition at line 155 of file HTMLForm.php.

HTMLForm::$mSubmitModifierClass = 'mw-ui-constructive' [protected]

Definition at line 141 of file HTMLForm.php.

HTMLForm::$mSubmitName [protected]

Definition at line 156 of file HTMLForm.php.

HTMLForm::$mSubmitText [protected]

Definition at line 157 of file HTMLForm.php.

HTMLForm::$mSubmitTooltip [protected]

Definition at line 158 of file HTMLForm.php.

HTMLForm::$mSubSectionBeforeFields = true [protected]

If true, sections that contain both fields and subsections will render their subsections before their fields.

Subclasses may set this to false to render subsections after fields instead.

Reimplemented in PreferencesForm.

Definition at line 188 of file HTMLForm.php.

HTMLForm::$mTableId = '' [protected]

Definition at line 153 of file HTMLForm.php.

HTMLForm::$mTitle [protected]

Definition at line 160 of file HTMLForm.php.

string array HTMLForm::$mTokenSalt = '' [protected]

Salt for the edit token.

Definition at line 179 of file HTMLForm.php.

HTMLForm::$mUseMultipart = false [protected]

Definition at line 170 of file HTMLForm.php.

HTMLForm::$mValidationErrorMessage [protected]

Definition at line 144 of file HTMLForm.php.

HTMLForm::$mWasSubmitted = false [protected]

Definition at line 162 of file HTMLForm.php.

HTMLForm::$mWrapperLegend = false [protected]

Definition at line 174 of file HTMLForm.php.

HTMLForm::$typeMappings [static]
Initial value:
 array(
        'api' => 'HTMLApiField',
        'text' => 'HTMLTextField',
        'textarea' => 'HTMLTextAreaField',
        'select' => 'HTMLSelectField',
        'radio' => 'HTMLRadioField',
        'multiselect' => 'HTMLMultiSelectField',
        'limitselect' => 'HTMLSelectLimitField',
        'check' => 'HTMLCheckField',
        'toggle' => 'HTMLCheckField',
        'int' => 'HTMLIntField',
        'float' => 'HTMLFloatField',
        'info' => 'HTMLInfoField',
        'selectorother' => 'HTMLSelectOrOtherField',
        'selectandother' => 'HTMLSelectAndOtherField',
        'submit' => 'HTMLSubmitField',
        'hidden' => 'HTMLHiddenField',
        'edittools' => 'HTMLEditTools',
        'checkmatrix' => 'HTMLCheckMatrix',
        'cloner' => 'HTMLFormFieldCloner',
        'autocompleteselect' => 'HTMLAutoCompleteSelectField',
        
        
        
        'email' => 'HTMLTextField',
        'password' => 'HTMLTextField',
        'url' => 'HTMLTextField',
    )

Definition at line 103 of file HTMLForm.php.


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