MediaWiki
REL1_24
|
Text field for selecting a value from a large list of possible values, with auto-completion and optionally with a select dropdown for selecting common options. More...
Public Member Functions | |
__construct ($params) | |
Initialise the object. | |
getAttributes (array $list) | |
Returns the given attributes from the parameters. | |
getInputHTML ($value) | |
This function must be implemented to return the HTML to generate the input object itself. | |
loadDataFromRequest ($request) | |
Get the value that this input has been set to from a posted form, or the input's default value if it has not been set. | |
validate ($value, $alldata) | |
Override this function to add specific validation checks on the field input. | |
Protected Attributes | |
$autocomplete = array() |
Text field for selecting a value from a large list of possible values, with auto-completion and optionally with a select dropdown for selecting common options.
If one of 'options-messages', 'options', or 'options-message' is provided and non-empty, the select dropdown will be shown. An 'other' key will be appended using message 'htmlform-selectorother-other' if not already present.
Besides the parameters recognized by HTMLTextField, the following are recognized: options-messages - As for HTMLSelectField options - As for HTMLSelectField options-message - As for HTMLSelectField autocomplete - Associative array mapping display text to values. autocomplete-messages - Like autocomplete, but keys are message names. require-match - Boolean, if true the value must be in the options or the autocomplete. other-message - Message to use instead of htmlform-selectorother-other for the 'other' message. other - Raw text to use for the 'other' message
Definition at line 27 of file HTMLAutoCompleteSelectField.php.
HTMLAutoCompleteSelectField::__construct | ( | $ | params | ) |
Initialise the object.
array | $params | Associative Array. See HTMLForm doc for syntax. |
MWException |
Reimplemented from HTMLFormField.
Definition at line 30 of file HTMLAutoCompleteSelectField.php.
References $key, $params, $value, array(), as, HTMLFormField\getOptions(), HTMLFormField\msg(), and wfMessage().
Returns the given attributes from the parameters.
array | $list | List of attributes to get |
Reimplemented from HTMLFormField.
Definition at line 101 of file HTMLAutoCompleteSelectField.php.
References $attribs, array(), FormatJson\encode(), and HTMLFormField\getOptions().
HTMLAutoCompleteSelectField::getInputHTML | ( | $ | value | ) |
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.
string | $value | The value to set the input to; eg a default text for a text input. |
Reimplemented from HTMLTextField.
Definition at line 116 of file HTMLAutoCompleteSelectField.php.
References $key, $ret, $value, array(), empty, HTMLFormField\flattenOptions(), and HTMLFormField\getOptions().
HTMLAutoCompleteSelectField::loadDataFromRequest | ( | $ | request | ) |
Get the value that this input has been set to from a posted form, or the input's default value if it has not been set.
WebRequest | $request |
Reimplemented from HTMLFormField.
Definition at line 64 of file HTMLAutoCompleteSelectField.php.
References HTMLFormField\getDefault().
HTMLAutoCompleteSelectField::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
string | array | $value | The value the field was submitted with |
array | $alldata | The data collected from the form |
Reimplemented from HTMLFormField.
Definition at line 81 of file HTMLAutoCompleteSelectField.php.
References $value, HTMLFormField\flattenOptions(), HTMLFormField\getOptions(), and HTMLFormField\msg().
HTMLAutoCompleteSelectField::$autocomplete = array() [protected] |
Definition at line 28 of file HTMLAutoCompleteSelectField.php.