MediaWiki
REL1_21
|
The parent class to generate form fields. More...
Public Member Functions | |
__construct ($params) | |
Initialise the object. | |
filter ($value, $alldata) | |
getDefault () | |
getDiv ($value) | |
Get the complete div for the input, including help text, labels, and whatever. | |
getErrorsAndErrorClass ($value) | |
Determine form errors to display and their classes. | |
getHelpText () | |
Determine the help text to display. | |
getHelpTextHtmlDiv ($helptext) | |
Generate help text HTML in div format. | |
getHelpTextHtmlRaw ($helptext) | |
Generate help text HTML formatted for raw output. | |
getHelpTextHtmlTable ($helptext) | |
Generate help text HTML in table format. | |
getInputHTML ($value) | |
This function must be implemented to return the HTML to generate the input object itself. | |
getLabel () | |
getLabelHtml ($cellAttributes=array()) | |
getRaw ($value) | |
Get the complete raw fields for the input, including help text, labels, and whatever. | |
getTableRow ($value) | |
Get the complete table row for the input, including help text, labels, and whatever. | |
getTooltipAndAccessKey () | |
Returns the attributes required for the tooltip and accesskey. | |
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. | |
msg () | |
Get a translated interface message. | |
validate ($value, $alldata) | |
Override this function to add specific validation checks on the field input. | |
Static Public Member Functions | |
static | flattenOptions ($options) |
flatten an array of options to a single array, for instance, a set of "<options>" inside "<optgroups>". | |
Public Attributes | |
$mParams | |
HTMLForm | $mParent |
Protected Member Functions | |
needsLabel () | |
Should this field have a label, or is there no input element with the appropriate id for the label to point to? | |
Static Protected Member Functions | |
static | formatErrors ($errors) |
Formats one or more errors as accepted by field validation-callback. | |
Protected Attributes | |
$mClass = '' | |
$mDefault | |
$mFilterCallback | |
$mID | |
$mLabel | |
$mName | |
$mValidationCallback |
The parent class to generate form fields.
Any field type should be a subclass of this.
Definition at line 1079 of file HTMLForm.php.
HTMLFormField::__construct | ( | $ | params | ) |
Initialise the object.
array | $params | Associative Array. See HTMLForm doc for syntax. |
MWException |
Reimplemented in HTMLSubmitField, HTMLHiddenField, HTMLInfoField, HTMLSelectAndOtherField, HTMLSelectOrOtherField, and Licenses.
Definition at line 1183 of file HTMLForm.php.
HTMLFormField::filter | ( | $ | value, |
$ | alldata | ||
) |
Definition at line 1146 of file HTMLForm.php.
static HTMLFormField::flattenOptions | ( | $ | options | ) | [static] |
flatten an array of options to a single array, for instance, a set of "<options>" inside "<optgroups>".
array | $options | Associative Array with values either Strings or Arrays |
Definition at line 1490 of file HTMLForm.php.
Referenced by Preferences\datetimePreferences(), PreferencesForm\filterDataForSubmit(), Preferences\getOptionFromUser(), and HTMLSelectField\validate().
static HTMLFormField::formatErrors | ( | $ | errors | ) | [static, protected] |
Formats one or more errors as accepted by field validation-callback.
$errors | String|Message|Array of strings or Message instances |
Definition at line 1510 of file HTMLForm.php.
Reimplemented in HTMLMultiSelectField, and HTMLCheckMatrix.
Definition at line 1463 of file HTMLForm.php.
Referenced by HTMLCheckField\loadDataFromRequest(), HTMLSelectOrOtherField\loadDataFromRequest(), and HTMLSelectAndOtherField\loadDataFromRequest().
HTMLFormField::getDiv | ( | $ | value | ) |
Get the complete div for the input, including help text, labels, and whatever.
string | $value | the value to set the input to. |
Reimplemented in HTMLApiField, HTMLEditTools, HTMLHiddenField, and HTMLInfoField.
Definition at line 1296 of file HTMLForm.php.
HTMLFormField::getErrorsAndErrorClass | ( | $ | value | ) |
Determine form errors to display and their classes.
string | $value | the value of the input |
Definition at line 1421 of file HTMLForm.php.
Determine the help text to display.
Definition at line 1387 of file HTMLForm.php.
HTMLFormField::getHelpTextHtmlDiv | ( | $ | helptext | ) |
Generate help text HTML in div format.
$helptext | String|null |
Definition at line 1363 of file HTMLForm.php.
HTMLFormField::getHelpTextHtmlRaw | ( | $ | helptext | ) |
Generate help text HTML formatted for raw output.
$helptext | String|null |
Definition at line 1378 of file HTMLForm.php.
HTMLFormField::getHelpTextHtmlTable | ( | $ | helptext | ) |
Generate help text HTML in table format.
$helptext | String|null |
Definition at line 1343 of file HTMLForm.php.
HTMLFormField::getInputHTML | ( | $ | value | ) | [abstract] |
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 in HTMLApiField, HTMLEditTools, HTMLSubmitField, HTMLHiddenField, HTMLInfoField, HTMLRadioField, HTMLSelectAndOtherField, HTMLMultiSelectField, HTMLSelectOrOtherField, HTMLSelectField, HTMLCheckMatrix, HTMLCheckField, HTMLTextAreaField, HTMLTextField, and Licenses.
Reimplemented in HTMLCheckField.
Definition at line 1434 of file HTMLForm.php.
HTMLFormField::getLabelHtml | ( | $ | cellAttributes = array() | ) |
Reimplemented in UploadSourceField.
Definition at line 1438 of file HTMLForm.php.
HTMLFormField::getRaw | ( | $ | value | ) |
Get the complete raw fields for the input, including help text, labels, and whatever.
string | $value | the value to set the input to. |
Reimplemented in HTMLApiField, HTMLEditTools, HTMLHiddenField, and HTMLInfoField.
Definition at line 1323 of file HTMLForm.php.
HTMLFormField::getTableRow | ( | $ | value | ) |
Get the complete table row for the input, including help text, labels, and whatever.
string | $value | the value to set the input to. |
Reimplemented in HTMLApiField, HTMLEditTools, HTMLHiddenField, HTMLInfoField, and HTMLCheckMatrix.
Definition at line 1252 of file HTMLForm.php.
Returns the attributes required for the tooltip and accesskey.
Definition at line 1476 of file HTMLForm.php.
Referenced by HTMLCheckField\getInputHTML().
HTMLFormField::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.
$request | WebRequest |
Reimplemented in HTMLSelectAndOtherField, HTMLMultiSelectField, HTMLSelectOrOtherField, HTMLCheckMatrix, and HTMLCheckField.
Definition at line 1170 of file HTMLForm.php.
Get a translated interface message.
This is a wrapper around $this->mParent->msg() if $this->mParent is set and wfMessage() otherwise.
Parameters are the same as wfMessage().
Definition at line 1114 of file HTMLForm.php.
Referenced by HTMLSelectAndOtherField\loadDataFromRequest(), and HTMLIntField\validate().
HTMLFormField::needsLabel | ( | ) | [protected] |
Should this field have a label, or is there no input element with the appropriate id for the label to point to?
Reimplemented in HTMLSubmitField, HTMLInfoField, HTMLRadioField, and HTMLMultiSelectField.
Definition at line 1160 of file HTMLForm.php.
HTMLFormField::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 | $value | the value the field was submitted with |
array | $alldata | the data collected from the form |
Reimplemented in HTMLSubmitField, HTMLRadioField, HTMLSelectAndOtherField, HTMLMultiSelectField, HTMLSelectField, HTMLCheckMatrix, HTMLIntField, HTMLFloatField, EditWatchlistCheckboxSeriesField, and HTMLBlockedUsersItemSelect.
Definition at line 1134 of file HTMLForm.php.
HTMLFormField::$mClass = '' [protected] |
Definition at line 1087 of file HTMLForm.php.
HTMLFormField::$mDefault [protected] |
Definition at line 1088 of file HTMLForm.php.
HTMLFormField::$mFilterCallback [protected] |
Definition at line 1082 of file HTMLForm.php.
HTMLFormField::$mID [protected] |
Definition at line 1086 of file HTMLForm.php.
HTMLFormField::$mLabel [protected] |
Definition at line 1085 of file HTMLForm.php.
HTMLFormField::$mName [protected] |
Definition at line 1083 of file HTMLForm.php.
HTMLFormField::$mParams |
Definition at line 1084 of file HTMLForm.php.
HTMLForm HTMLFormField::$mParent |
Definition at line 1092 of file HTMLForm.php.
HTMLFormField::$mValidationCallback [protected] |
Definition at line 1081 of file HTMLForm.php.