MediaWiki  REL1_24
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.

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 13 of file HTMLSelectAndOtherField.php.


Constructor & Destructor Documentation

Initialise the object.

Parameters:
array$paramsAssociative Array. See HTMLForm doc for syntax.
Since:
1.22 The 'label' attribute no longer accepts raw HTML, use 'label-raw' instead
Exceptions:
MWException

Reimplemented from HTMLFormField.

Definition at line 14 of file HTMLSelectAndOtherField.php.

References $params, array(), HTMLFormField\flattenOptions(), HTMLFormField\getOptions(), and wfMessage().


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:
string$valueThe value to set the input to; eg a default text for a text input.
Returns:
string Valid HTML.

Reimplemented from HTMLSelectField.

Definition at line 36 of file HTMLSelectAndOtherField.php.

References $value, array(), HTMLFormField\getAttributes(), getSize(), and Html\input().

Definition at line 103 of file HTMLSelectAndOtherField.php.

Referenced by getInputHTML().

Parameters:
WebRequest$request
Returns:
array("<overall message>","<select value>","<text field value>")

Reimplemented from HTMLFormField.

Definition at line 68 of file HTMLSelectAndOtherField.php.

References array(), as, HTMLFormField\getDefault(), and HTMLFormField\msg().

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:
string | array$valueThe value the field was submitted with
array$alldataThe data collected from the form
Returns:
bool|string True on success, or String error to display, or false to fail validation without displaying an error.

Reimplemented from HTMLSelectField.

Definition at line 107 of file HTMLSelectAndOtherField.php.

References $value, and HTMLFormField\msg().


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