MediaWiki  REL1_19
HTMLSelectAndOtherField Class Reference

Double field with a dropdown list constructed from a system message in the format * Optgroup header ** <option value>=""> * New Optgroup header Plus a text field underneath for an additional reason. More...

Inheritance diagram for HTMLSelectAndOtherField:
Collaboration diagram for HTMLSelectAndOtherField:

List of all members.

Public Member Functions

 __construct ($params)
 Initialise the object.
 getInputHTML ($value)
 This function must be implemented to return the HTML to generate the input object itself.
 getSize ()
 loadDataFromRequest ($request)
 validate ($value, $alldata)
 Override this function to add specific validation checks on the field input.

Static Public Member Functions

static parseMessage ($string, $otherName=null)
 Build a drop-down box from a textual list.

Detailed Description

Double field with a dropdown list constructed from a system message in the format * Optgroup header ** <option value>=""> * New Optgroup header Plus a text field underneath for an additional reason.

The 'value' of the field is ""<select>: <extra reason>="">"", or "<extra reason>" if nothing has been selected in the select dropdown.

Todo:
FIXME: If made 'required', only the text field should be compulsory.

Definition at line 1692 of file HTMLForm.php.


Constructor & Destructor Documentation

Initialise the object.

Parameters:
$paramsarray Associative Array. See HTMLForm doc for syntax.

Reimplemented from HTMLFormField.

Definition at line 1694 of file HTMLForm.php.

References HTMLFormField\flattenOptions(), parseMessage(), and wfMessage().

Here is the call graph for this function:


Member Function Documentation

This function must be implemented to return the HTML to generate the input object itself.

It should not implement the surrounding table cells/rows, or labels/help messages.

Parameters:
$valueString the value to set the input to; eg a default text for a text input.
Returns:
String valid HTML.

Reimplemented from HTMLSelectField.

Definition at line 1760 of file HTMLForm.php.

References getSize(), and Html\input().

Here is the call graph for this function:

Definition at line 1827 of file HTMLForm.php.

Referenced by getInputHTML().

Here is the caller graph for this function:

Parameters:
$requestWebRequest
Returns:
Array( <overall message>, <select value>, <text field value> )

Reimplemented from HTMLFormField.

Definition at line 1792 of file HTMLForm.php.

References HTMLFormField\getDefault(), and wfMsgForContent().

Here is the call graph for this function:

static HTMLSelectAndOtherField::parseMessage ( string,
otherName = null 
) [static]

Build a drop-down box from a textual list.

Parameters:
$stringString message text
$otherNameString name of "other reason" option
Returns:
Array TODO: this is copied from Xml::listDropDown(), deprecate/avoid duplication?

Definition at line 1726 of file HTMLForm.php.

References $options, and wfMessage().

Referenced by __construct().

Here is the call graph for this function:

Here is the caller graph for this function:

HTMLSelectAndOtherField::validate ( value,
alldata 
)

Override this function to add specific validation checks on the field input.

Don't forget to call parent::validate() to ensure that the user-defined callback mValidationCallback is still run

Parameters:
$valueString the value the field was submitted with
$alldataArray the data collected from the form
Returns:
Mixed Bool true on success, or String error to display.

Reimplemented from HTMLSelectField.

Definition at line 1833 of file HTMLForm.php.

References wfMsgExt().

Here is the call graph for this function:


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