MediaWiki
1.33.0
|
The parent class to generate form fields. More...
Public Member Functions | |
__construct ( $params) | |
Initialise the object. More... | |
cancelSubmit ( $value, $alldata) | |
Override this function if the control can somehow trigger a form submission that shouldn't actually submit the HTMLForm. More... | |
canDisplayErrors () | |
True if this field type is able to display errors; false if validation errors need to be displayed in the main HTMLForm error area. More... | |
filter ( $value, $alldata) | |
getAttributes (array $list) | |
Returns the given attributes from the parameters. More... | |
getDefault () | |
getDiv ( $value) | |
Get the complete div for the input, including help text, labels, and whatever. More... | |
getErrorsAndErrorClass ( $value) | |
Determine form errors to display and their classes. More... | |
getErrorsRaw ( $value) | |
Determine form errors to display, returning them in an array. More... | |
getHelpText () | |
Determine the help text to display. More... | |
getHelpTextHtmlDiv ( $helptext) | |
Generate help text HTML in div format. More... | |
getHelpTextHtmlRaw ( $helptext) | |
Generate help text HTML formatted for raw output. More... | |
getHelpTextHtmlTable ( $helptext) | |
Generate help text HTML in table format. More... | |
getInline ( $value) | |
Get the complete field as an inline element. More... | |
getInputHTML ( $value) | |
This function must be implemented to return the HTML to generate the input object itself. More... | |
getInputOOUI ( $value) | |
Same as getInputHTML, but returns an OOUI object. More... | |
getLabel () | |
getLabelHtml ( $cellAttributes=[]) | |
getOOUI ( $value) | |
Get the OOUI version of the div. More... | |
getOptions () | |
Fetch the array of options from the field's parameters. More... | |
getOptionsOOUI () | |
Get options and make them into arrays suitable for OOUI. More... | |
getRaw ( $value) | |
Get the complete raw fields for the input, including help text, labels, and whatever. More... | |
getTableRow ( $value) | |
Get the complete table row for the input, including help text, labels, and whatever. More... | |
getTooltipAndAccessKey () | |
Returns the attributes required for the tooltip and accesskey, for Html::element() etc. More... | |
getTooltipAndAccessKeyOOUI () | |
Returns the attributes required for the tooltip and accesskey, for OOUI widgets' config. More... | |
getVForm ( $value) | |
Get the complete field for the input, including help text, labels, and whatever. More... | |
hasVisibleOutput () | |
If this field has a user-visible output or not. More... | |
isHelpInline () | |
Determine if the help text should be displayed inline. More... | |
isHidden ( $alldata) | |
Test whether this field is supposed to be hidden, based on the values of the other form fields. More... | |
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. More... | |
msg () | |
Get a translated interface message. More... | |
needsJSForHtml5FormValidation () | |
Whether this field requires the user agent to have JavaScript enabled for the client-side HTML5 form validation to work correctly. More... | |
setShowEmptyLabel ( $show) | |
Tell the field whether to generate a separate label element if its label is blank. More... | |
skipLoadData ( $request) | |
Skip this field when collecting data. More... | |
validate ( $value, $alldata) | |
Override this function to add specific validation checks on the field input. More... | |
Static Public Member Functions | |
static | flattenOptions ( $options) |
flatten an array of options to a single array, for instance, a set of "<options>" inside "<optgroups>". More... | |
static | forceToStringRecursive ( $array) |
Recursively forces values in an array to strings, because issues arise with integer 0 as a value. More... | |
Public Attributes | |
$mParams | |
HTMLForm null | $mParent |
Protected Member Functions | |
getFieldLayoutOOUI ( $inputField, $config) | |
Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output. More... | |
getLabelAlignOOUI () | |
Get label alignment when generating field for OOUI. More... | |
getMessage ( $value) | |
Turns a *-message parameter (which could be a MessageSpecifier, or a message name, or a name + parameters array) into a Message. More... | |
getNearestFieldByName ( $alldata, $name) | |
Fetch a field value from $alldata for the closest field matching a given name. More... | |
getOOUIModules () | |
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to infuse this field's OOUI widget. More... | |
isHiddenRecurse (array $alldata, array $params) | |
Helper function for isHidden to handle recursive data structures. More... | |
isSubmitAttempt (WebRequest $request) | |
Can we assume that the request is an attempt to submit a HTMLForm, as opposed to an attempt to just view it? This can't normally be distinguished for e.g. More... | |
needsLabel () | |
Should this field have a label, or is there no input element with the appropriate id for the label to point to? More... | |
shouldInfuseOOUI () | |
Whether the field should be automatically infused. More... | |
Static Protected Member Functions | |
static | formatErrors ( $errors) |
Formats one or more errors as accepted by field validation-callback. More... | |
Protected Attributes | |
$mClass = '' | |
$mDefault | |
$mDir | |
$mFilterCallback | |
$mHelpClass = false | |
$mHideIf = null | |
$mID | |
$mLabel | |
$mName | |
array bool null | $mOptions = false |
$mOptionsLabelsNotFromMessage = false | |
bool | $mShowEmptyLabels = true |
If true will generate an empty div element with no label. More... | |
$mValidationCallback | |
$mVFormClass = '' | |
Private Member Functions | |
lookupOptionsKeys ( $options) | |
Given an array of msg-key => value mappings, returns an array with keys being the message texts. More... | |
The parent class to generate form fields.
Any field type should be a subclass of this.
Definition at line 7 of file HTMLFormField.php.
HTMLFormField::__construct | ( | $params | ) |
Initialise the object.
array | $params | Associative Array. See HTMLForm doc for syntax. |
MWException |
Reimplemented in HTMLFormFieldCloner, Licenses, HTMLAutoCompleteSelectField, HTMLCheckMatrix, HTMLDateTimeField, HTMLTextField, HTMLTitlesMultiselectField, HTMLTitleTextField, HTMLUserTextField, HTMLMultiSelectField, HTMLTextAreaField, HTMLRadioField, HTMLSelectAndOtherField, HTMLSelectNamespace, HTMLSelectOrOtherField, HTMLSelectLanguageField, HTMLHiddenField, HTMLButtonField, HTMLFormFieldWithButton, HTMLInfoField, HTMLSelectNamespaceWithButton, and HTMLTextFieldWithButton.
Definition at line 388 of file HTMLFormField.php.
References $params, and getMessage().
HTMLFormField::cancelSubmit | ( | $value, | |
$alldata | |||
) |
Override this function if the control can somehow trigger a form submission that shouldn't actually submit the HTMLForm.
string | array | $value | The value the field was submitted with |
array | $alldata | The data collected from the form |
Reimplemented in HTMLFormFieldCloner.
Definition at line 286 of file HTMLFormField.php.
HTMLFormField::canDisplayErrors | ( | ) |
True if this field type is able to display errors; false if validation errors need to be displayed in the main HTMLForm error area.
Reimplemented in HTMLHiddenField, and HTMLSubmittedValueField.
Definition at line 66 of file HTMLFormField.php.
References hasVisibleOutput().
HTMLFormField::filter | ( | $value, | |
$alldata | |||
) |
Definition at line 320 of file HTMLFormField.php.
References $mFilterCallback, and $value.
|
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 1091 of file HTMLFormField.php.
References $options, $value, and as.
Referenced by HTMLSelectAndOtherField\__construct(), MediaWiki\Preferences\DefaultPreferencesFactory\datetimePreferences(), HTMLMultiSelectField\filterDataForSubmit(), HTMLCheckMatrix\filterDataForSubmit(), HTMLSelectOrOtherField\getInputHTML(), HTMLAutoCompleteSelectField\getInputHTML(), HTMLSelectOrOtherField\getInputOOUI(), MediaWiki\Preferences\DefaultPreferencesFactory\getOptionFromUser(), User\getOptionKinds(), HTMLSelectField\validate(), HTMLRadioField\validate(), HTMLMultiSelectField\validate(), and HTMLAutoCompleteSelectField\validate().
|
static |
Recursively forces values in an array to strings, because issues arise with integer 0 as a value.
array | $array |
Definition at line 1038 of file HTMLFormField.php.
Referenced by HTMLMultiSelectField\filterDataForSubmit(), HTMLMultiSelectField\getInputHTML(), and getOptions().
|
staticprotected |
Formats one or more errors as accepted by field validation-callback.
string | Message | array | $errors | Array of strings or Message instances To work around limitations in phan-taint-check the calling class has taintedness disabled. So instead we pretend that this method outputs html, since the result is eventually outputted anyways without escaping and this allows us to verify stuff is safe even though the caller has taintedness cleared. |
-taint | $errors | exec_html |
Definition at line 1118 of file HTMLFormField.php.
References $lines, as, and captcha-old\count.
Referenced by getErrorsAndErrorClass().
HTMLFormField::getAttributes | ( | array | $list | ) |
Returns the given attributes from the parameters.
array | $list | List of attributes to get |
Reimplemented in HTMLAutoCompleteSelectField, HTMLDateTimeField, and HTMLComboboxField.
Definition at line 996 of file HTMLFormField.php.
Referenced by HTMLMultiSelectField\formatOptions(), HTMLRadioField\formatOptions(), HTMLCheckField\getInputHTML(), HTMLSelectField\getInputHTML(), HTMLFancyCaptchaField\getInputHTML(), HTMLSelectAndOtherField\getInputHTML(), HTMLReCaptchaField\getInputHTML(), HTMLFormFieldWithButton\getInputHTML(), HTMLTextAreaField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLButtonField\getInputHTML(), HTMLCheckMatrix\getInputHTML(), HTMLSelectField\getInputOOUI(), HTMLCheckField\getInputOOUI(), HTMLFormFieldWithButton\getInputOOUI(), HTMLRadioField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLTextAreaField\getInputOOUI(), HTMLButtonField\getInputOOUI(), HTMLTextField\getInputOOUI(), HTMLMultiSelectField\getInputOOUI(), and HTMLCheckMatrix\getInputOOUI().
HTMLFormField::getDefault | ( | ) |
Reimplemented in HTMLCheckMatrix, HTMLMultiSelectField, HTMLFormFieldCloner, HTMLRestrictionsField, and HTMLInfoField.
Definition at line 957 of file HTMLFormField.php.
Referenced by HTMLButtonField\getInputHTML(), HTMLButtonField\getInputOOUI(), HTMLNamespacesMultiselectField\loadDataFromRequest(), HTMLUsersMultiselectField\loadDataFromRequest(), HTMLTitlesMultiselectField\loadDataFromRequest(), HTMLSizeFilterField\loadDataFromRequest(), HTMLDateTimeField\loadDataFromRequest(), HTMLAutoCompleteSelectField\loadDataFromRequest(), HTMLCheckField\loadDataFromRequest(), HTMLSelectAndOtherField\loadDataFromRequest(), HTMLSelectOrOtherField\loadDataFromRequest(), and 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 HTMLInfoField, HTMLHiddenField, HTMLEditTools, HTMLTagFilter, HTMLSubmittedValueField, and HTMLApiField.
Definition at line 532 of file HTMLFormField.php.
References $html, $mClass, $mVFormClass, $value, class, FormatJson\encode(), getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlDiv(), getInputHTML(), getLabelHtml(), and list.
Referenced by getOOUI(), and getVForm().
HTMLFormField::getErrorsAndErrorClass | ( | $value | ) |
Determine form errors to display and their classes.
phan-taint-check gets confused with returning both classes and errors and thinks double escaping is happening, so specify that return value has no taint.
string | $value | The value of the input |
Definition at line 872 of file HTMLFormField.php.
References $value, formatErrors(), and validate().
Referenced by getDiv(), getInline(), getRaw(), HTMLCheckMatrix\getTableRow(), and getTableRow().
HTMLFormField::getErrorsRaw | ( | $value | ) |
Determine form errors to display, returning them in an array.
string | $value | The value of the input |
Definition at line 893 of file HTMLFormField.php.
References $value, as, and validate().
Referenced by getOOUI().
|
protected |
Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output.
string | $inputField | |
array | $config |
Definition at line 660 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getHelpText | ( | ) |
Determine the help text to display.
Reimplemented in HTMLRestrictionsField.
Definition at line 821 of file HTMLFormField.php.
References as, getMessage(), and msg().
Referenced by getDiv(), getInline(), getOOUI(), getRaw(), HTMLCheckMatrix\getTableRow(), getTableRow(), and shouldInfuseOOUI().
HTMLFormField::getHelpTextHtmlDiv | ( | $helptext | ) |
Generate help text HTML in div format.
string | null | $helptext |
Definition at line 785 of file HTMLFormField.php.
References FormatJson\encode().
Referenced by getDiv(), getHelpTextHtmlRaw(), and getInline().
HTMLFormField::getHelpTextHtmlRaw | ( | $helptext | ) |
Generate help text HTML formatted for raw output.
string | null | $helptext |
Definition at line 812 of file HTMLFormField.php.
References getHelpTextHtmlDiv().
Referenced by getRaw().
HTMLFormField::getHelpTextHtmlTable | ( | $helptext | ) |
Generate help text HTML in table format.
string | null | $helptext |
Definition at line 756 of file HTMLFormField.php.
References $mHelpClass, and FormatJson\encode().
Referenced by HTMLCheckMatrix\getTableRow(), and getTableRow().
HTMLFormField::getInline | ( | $value | ) |
Get the complete field as an inline element.
string | $value | The value to set the input to. |
Definition at line 734 of file HTMLFormField.php.
References $html, $value, getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlDiv(), getInputHTML(), getLabelHtml(), and list.
|
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 HTMLFormFieldCloner, Licenses, HTMLAutoCompleteSelectField, HTMLRestrictionsField, HTMLCheckMatrix, HTMLTitlesMultiselectField, HTMLButtonField, HTMLTextField, HTMLNamespacesMultiselectField, HTMLMultiSelectField, HTMLHiddenField, HTMLUsersMultiselectField, HTMLRadioField, HTMLTextAreaField, HTMLFormFieldWithButton, HTMLReCaptchaField, HTMLSelectAndOtherField, HTMLTagFilter, HTMLExpiryField, HTMLInfoField, HTMLFancyCaptchaField, HTMLComboboxField, HTMLSelectField, HTMLSelectOrOtherField, HTMLSubmittedValueField, HTMLSelectNamespace, HTMLApiField, HTMLSizeFilterField, HTMLSelectNamespaceWithButton, HTMLTextFieldWithButton, HTMLCheckField, and HTMLEditTools.
Referenced by getDiv(), getInline(), getRaw(), and getTableRow().
HTMLFormField::getInputOOUI | ( | $value | ) |
Same as getInputHTML, but returns an OOUI object.
Defaults to false, which getOOUI will interpret as "use the HTML version"
string | $value |
Reimplemented in HTMLFormFieldCloner, HTMLAutoCompleteSelectField, HTMLCheckMatrix, HTMLDateTimeField, HTMLMultiSelectField, HTMLTextField, HTMLRestrictionsField, HTMLButtonField, HTMLTextAreaField, HTMLSelectAndOtherField, HTMLTitlesMultiselectField, HTMLSelectOrOtherField, HTMLNamespacesMultiselectField, HTMLRadioField, HTMLUsersMultiselectField, HTMLExpiryField, HTMLFormFieldWithButton, HTMLCheckField, HTMLSelectField, HTMLTagFilter, HTMLComboboxField, HTMLInfoField, and HTMLSelectNamespace.
Definition at line 57 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getLabel | ( | ) |
Reimplemented in HTMLCheckField, and HTMLFancyCaptchaField.
Definition at line 915 of file HTMLFormField.php.
Referenced by getLabelHtml(), and getOOUI().
|
protected |
Get label alignment when generating field for OOUI.
Reimplemented in HTMLCheckField.
Definition at line 650 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getLabelHtml | ( | $cellAttributes = [] | ) |
Reimplemented in HTMLFancyCaptchaField, and UploadSourceField.
Definition at line 919 of file HTMLFormField.php.
References $html, $mID, getLabel(), and needsLabel().
Referenced by getDiv(), getInline(), getRaw(), HTMLCheckMatrix\getTableRow(), and getTableRow().
|
protected |
Turns a *-message parameter (which could be a MessageSpecifier, or a message name, or a name + parameters array) into a Message.
mixed | $value |
Definition at line 1152 of file HTMLFormField.php.
References $value.
Referenced by HTMLSelectAndOtherField\__construct(), HTMLTextAreaField\__construct(), HTMLTextField\__construct(), HTMLButtonField\__construct(), HTMLAutoCompleteSelectField\__construct(), __construct(), HTMLEditTools\formatMsg(), HTMLFormFieldCloner\getCreateButtonHtml(), HTMLFormFieldCloner\getDeleteButtonHtml(), getHelpText(), and getOptions().
|
protected |
Fetch a field value from $alldata for the closest field matching a given name.
This is complex because it needs to handle array fields like the user would expect. The general algorithm is to look for $name as a sibling of $this, then a sibling of $this's parent, and so on. Keeping in mind that $name itself might be referencing an array.
array | $alldata | |
string | $name |
Definition at line 112 of file HTMLFormField.php.
References $data, $keys, $mName, $name, as, captcha-old\count, and string.
Referenced by isHiddenRecurse().
HTMLFormField::getOOUI | ( | $value | ) |
Get the OOUI version of the div.
Falls back to getDiv by default.
string | $value | The value to set the input to. |
Reimplemented in HTMLInfoField, and HTMLTagFilter.
Definition at line 580 of file HTMLFormField.php.
References $help, $mClass, $mHideIf, $value, as, class, getDiv(), getErrorsRaw(), getFieldLayoutOOUI(), getHelpText(), getInputOOUI(), getLabel(), getLabelAlignOOUI(), getOOUIModules(), isHelpInline(), and shouldInfuseOOUI().
|
protected |
Get the list of extra ResourceLoader modules which must be loaded client-side before it's possible to infuse this field's OOUI widget.
Reimplemented in HTMLCheckMatrix, HTMLDateTimeField, HTMLTitlesMultiselectField, HTMLNamespacesMultiselectField, HTMLUserTextField, HTMLTitleTextField, HTMLUsersMultiselectField, HTMLSelectAndOtherField, HTMLSelectOrOtherField, HTMLSizeFilterField, HTMLExpiryField, and HTMLSelectNamespace.
Definition at line 686 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getOptions | ( | ) |
Fetch the array of options from the field's parameters.
In order, this checks 'options-messages', 'options', then 'options-message'.
Definition at line 1052 of file HTMLFormField.php.
References $mOptions, forceToStringRecursive(), getMessage(), Xml\listDropDownOptions(), and lookupOptionsKeys().
Referenced by HTMLSelectOrOtherField\__construct(), HTMLSelectAndOtherField\__construct(), HTMLAutoCompleteSelectField\__construct(), HTMLMultiSelectField\filterDataForSubmit(), HTMLAutoCompleteSelectField\getAttributes(), HTMLSelectOrOtherField\getInputHTML(), HTMLSelectField\getInputHTML(), HTMLComboboxField\getInputHTML(), HTMLRadioField\getInputHTML(), HTMLMultiSelectField\getInputHTML(), HTMLAutoCompleteSelectField\getInputHTML(), HTMLRadioField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), HTMLMultiSelectField\getInputOOUI(), getOptionsOOUI(), HTMLSelectField\validate(), HTMLRadioField\validate(), HTMLMultiSelectField\validate(), and HTMLAutoCompleteSelectField\validate().
HTMLFormField::getOptionsOOUI | ( | ) |
Get options and make them into arrays suitable for OOUI.
Reimplemented in HTMLMultiSelectField.
Definition at line 1074 of file HTMLFormField.php.
References getOptions(), and Xml\listDropDownOptionsOoui().
Referenced by HTMLComboboxField\getInputOOUI(), HTMLSelectField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), and HTMLSelectAndOtherField\getInputOOUI().
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 HTMLInfoField, HTMLHiddenField, HTMLEditTools, HTMLSubmittedValueField, and HTMLApiField.
Definition at line 699 of file HTMLFormField.php.
References $html, $value, getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlRaw(), getInputHTML(), getLabelHtml(), and list.
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 HTMLCheckMatrix, HTMLInfoField, HTMLHiddenField, HTMLSubmittedValueField, HTMLEditTools, HTMLTagFilter, and HTMLApiField.
Definition at line 474 of file HTMLFormField.php.
References $html, $value, class, FormatJson\encode(), getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlTable(), getInputHTML(), getLabelHtml(), and list.
HTMLFormField::getTooltipAndAccessKey | ( | ) |
Returns the attributes required for the tooltip and accesskey, for Html::element() etc.
Definition at line 966 of file HTMLFormField.php.
References Linker\tooltipAndAccesskeyAttribs().
Referenced by HTMLCheckField\getInputHTML(), HTMLTextAreaField\getInputHTML(), and HTMLTextField\getInputHTML().
HTMLFormField::getTooltipAndAccessKeyOOUI | ( | ) |
Returns the attributes required for the tooltip and accesskey, for OOUI widgets' config.
Definition at line 979 of file HTMLFormField.php.
References Linker\accesskey(), and Linker\titleAttrib().
Referenced by HTMLCheckField\getInputOOUI(), HTMLTextAreaField\getInputOOUI(), and HTMLTextField\getInputOOUI().
HTMLFormField::getVForm | ( | $value | ) |
Get the complete field for the input, including help text, labels, and whatever.
Fall back from 'vform' to 'div' when not overridden.
string | $value | The value to set the input to. |
Definition at line 722 of file HTMLFormField.php.
HTMLFormField::hasVisibleOutput | ( | ) |
If this field has a user-visible output or not.
If not, it will not be rendered
Reimplemented in HTMLHiddenField, HTMLSubmittedValueField, and HTMLApiField.
Definition at line 95 of file HTMLFormField.php.
Referenced by canDisplayErrors().
HTMLFormField::isHelpInline | ( | ) |
Determine if the help text should be displayed inline.
Only applies to OOUI forms.
Definition at line 856 of file HTMLFormField.php.
Referenced by getOOUI(), and shouldInfuseOOUI().
HTMLFormField::isHidden | ( | $alldata | ) |
Test whether this field is supposed to be hidden, based on the values of the other form fields.
array | $alldata | The data collected from the form |
Definition at line 268 of file HTMLFormField.php.
References isHiddenRecurse().
Referenced by HTMLRestrictionsField\validate(), and validate().
Helper function for isHidden to handle recursive data structures.
array | $alldata | |
array | $params |
MWException |
Definition at line 161 of file HTMLFormField.php.
References $params, $value, as, captcha-old\count, getNearestFieldByName(), and list.
Referenced by isHidden().
|
protected |
Can we assume that the request is an attempt to submit a HTMLForm, as opposed to an attempt to just view it? This can't normally be distinguished for e.g.
checkboxes.
Returns true if the request has a field for a CSRF token (wpEditToken) or a form identifier (wpFormIdentifier).
WebRequest | $request |
Definition at line 361 of file HTMLFormField.php.
References $request.
Referenced by HTMLCheckField\loadDataFromRequest(), HTMLMultiSelectField\loadDataFromRequest(), and HTMLCheckMatrix\loadDataFromRequest().
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.
WebRequest | $request |
Reimplemented in HTMLCheckMatrix, HTMLMultiSelectField, HTMLSelectOrOtherField, HTMLSelectAndOtherField, HTMLFormFieldCloner, HTMLCheckField, HTMLAutoCompleteSelectField, HTMLDateTimeField, HTMLSizeFilterField, HTMLExpiryField, HTMLRestrictionsField, HTMLTitlesMultiselectField, HTMLUsersMultiselectField, HTMLNamespacesMultiselectField, and HTMLSubmitField.
Definition at line 372 of file HTMLFormField.php.
References $request, and getDefault().
|
private |
Given an array of msg-key => value mappings, returns an array with keys being the message texts.
It also forces values to strings.
array | $options |
Definition at line 1020 of file HTMLFormField.php.
References $options, $ret, $value, as, and msg().
Referenced by getOptions().
HTMLFormField::msg | ( | ) |
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 80 of file HTMLFormField.php.
References $args, and wfMessage().
Referenced by HTMLSelectAndOtherField\__construct(), HTMLRestrictionsField\__construct(), HTMLDateTimeField\__construct(), HTMLAutoCompleteSelectField\__construct(), Licenses\__construct(), HTMLEditTools\formatMsg(), HTMLRestrictionsField\getHelpText(), getHelpText(), HTMLSizeFilterField\getInputHTML(), HTMLFormFieldCloner\getInputHTMLForKey(), HTMLUsersMultiselectField\getInputOOUI(), HTMLNamespacesMultiselectField\getInputOOUI(), HTMLTitlesMultiselectField\getInputOOUI(), HTMLFormFieldCloner\getInputOOUIForKey(), HTMLUserTextField\isValidIPRange(), HTMLSelectAndOtherField\loadDataFromRequest(), lookupOptionsKeys(), Licenses\makeLines(), Licenses\outputOption(), HTMLIntField\validate(), HTMLSelectField\validate(), HTMLFloatField\validate(), HTMLRadioField\validate(), HTMLNamespacesMultiselectField\validate(), HTMLMultiSelectField\validate(), HTMLTitleTextField\validate(), HTMLUserTextField\validate(), HTMLCheckMatrix\validate(), HTMLTitlesMultiselectField\validate(), HTMLRestrictionsField\validate(), HTMLDateTimeField\validate(), HTMLAutoCompleteSelectField\validate(), HTMLSelectAndOtherField\validate(), HTMLFormFieldCloner\validate(), and validate().
HTMLFormField::needsJSForHtml5FormValidation | ( | ) |
Whether this field requires the user agent to have JavaScript enabled for the client-side HTML5 form validation to work correctly.
Definition at line 1179 of file HTMLFormField.php.
|
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 HTMLMultiSelectField, HTMLFormFieldCloner, HTMLButtonField, HTMLRadioField, HTMLCheckField, HTMLInfoField, and HTMLSizeFilterField.
Definition at line 334 of file HTMLFormField.php.
Referenced by getLabelHtml().
HTMLFormField::setShowEmptyLabel | ( | $show | ) |
Tell the field whether to generate a separate label element if its label is blank.
bool | $show | Set to false to not generate a label. |
Definition at line 347 of file HTMLFormField.php.
Referenced by HTMLButtonField\__construct().
|
protected |
Whether the field should be automatically infused.
Note that all OOUI HTMLForm fields are infusable (you can call OO.ui.infuse() on them), but not all are infused by default, since there is no benefit in doing it e.g. for buttons and it's a small performance hit on page load.
Reimplemented in HTMLCheckMatrix, HTMLDateTimeField, HTMLTitlesMultiselectField, HTMLNamespacesMultiselectField, HTMLUserTextField, HTMLTitleTextField, HTMLUsersMultiselectField, HTMLSelectField, HTMLSelectOrOtherField, HTMLComboboxField, HTMLSelectNamespace, and HTMLExpiryField.
Definition at line 675 of file HTMLFormField.php.
References getHelpText(), and isHelpInline().
Referenced by getOOUI().
HTMLFormField::skipLoadData | ( | $request | ) |
Skip this field when collecting data.
WebRequest | $request |
Reimplemented in HTMLReCaptchaField, and HTMLSubmitField.
Definition at line 1168 of file HTMLFormField.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 | array | $value | The value the field was submitted with |
array | $alldata | The data collected from the form |
Reimplemented in HTMLFormFieldCloner, HTMLSelectAndOtherField, HTMLButtonField, HTMLAutoCompleteSelectField, HTMLDateTimeField, HTMLRestrictionsField, HTMLTitlesMultiselectField, HTMLCheckMatrix, HTMLUserTextField, HTMLTitleTextField, HTMLMultiSelectField, EditWatchlistCheckboxSeriesField, HTMLUsersMultiselectField, HTMLNamespacesMultiselectField, HTMLRadioField, HTMLSelectLimitField, HTMLFloatField, HTMLIntField, and HTMLSelectField.
Definition at line 301 of file HTMLFormField.php.
References $mParent, $value, isHidden(), and msg().
Referenced by getErrorsAndErrorClass(), getErrorsRaw(), EditWatchlistCheckboxSeriesField\validate(), and HTMLCheckMatrixTest\validate().
|
protected |
Definition at line 16 of file HTMLFormField.php.
Referenced by getDiv(), HTMLCheckField\getInputHTML(), HTMLSelectOrOtherField\getInputHTML(), HTMLSelectAndOtherField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLAutoCompleteSelectField\getInputHTML(), HTMLComboboxField\getInputOOUI(), HTMLSelectField\getInputOOUI(), HTMLCheckField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLTextField\getInputOOUI(), HTMLMultiSelectField\getInputOOUI(), and getOOUI().
|
protected |
Definition at line 19 of file HTMLFormField.php.
Referenced by HTMLHiddenField\getHiddenFieldData().
|
protected |
Definition at line 13 of file HTMLFormField.php.
Referenced by HTMLFancyCaptchaField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLNamespacesMultiselectField\getInputOOUI(), and HTMLTitlesMultiselectField\getInputOOUI().
|
protected |
Definition at line 11 of file HTMLFormField.php.
Referenced by filter().
|
protected |
Definition at line 18 of file HTMLFormField.php.
Referenced by getHelpTextHtmlTable().
|
protected |
Definition at line 25 of file HTMLFormField.php.
Referenced by HTMLFormFieldCloner\createFieldsForKey(), and getOOUI().
|
protected |
Definition at line 15 of file HTMLFormField.php.
Referenced by HTMLHiddenField\getHiddenFieldData(), HTMLCheckField\getInputHTML(), HTMLFancyCaptchaField\getInputHTML(), HTMLSelectAndOtherField\getInputHTML(), HTMLTextAreaField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLButtonField\getInputHTML(), Licenses\getInputHTML(), HTMLCheckField\getInputOOUI(), HTMLExpiryField\getInputOOUI(), HTMLNamespacesMultiselectField\getInputOOUI(), HTMLTitlesMultiselectField\getInputOOUI(), HTMLDateTimeField\getInputOOUI(), and getLabelHtml().
|
protected |
Definition at line 14 of file HTMLFormField.php.
Referenced by HTMLCheckField\getLabel().
|
protected |
Definition at line 12 of file HTMLFormField.php.
Referenced by HTMLHiddenField\getHiddenFieldData(), HTMLFancyCaptchaField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLButtonField\getInputHTML(), Licenses\getInputHTML(), HTMLCheckField\getInputOOUI(), HTMLUsersMultiselectField\getInputOOUI(), HTMLNamespacesMultiselectField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), HTMLTitlesMultiselectField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLDateTimeField\getInputOOUI(), and getNearestFieldByName().
Definition at line 23 of file HTMLFormField.php.
Referenced by HTMLSelectOrOtherField\__construct(), HTMLSelectAndOtherField\__construct(), and getOptions().
|
protected |
Definition at line 24 of file HTMLFormField.php.
HTMLFormField::$mParams |
Definition at line 8 of file HTMLFormField.php.
Referenced by HTMLExpiryField\getFieldByType().
Definition at line 36 of file HTMLFormField.php.
Referenced by validate().
|
protected |
If true will generate an empty div element with no label.
Definition at line 31 of file HTMLFormField.php.
|
protected |
Definition at line 10 of file HTMLFormField.php.
|
protected |
Definition at line 17 of file HTMLFormField.php.
Referenced by getDiv().