MediaWiki fundraising/REL1_35
|
The parent class to generate form fields. More...
Public Member Functions | |
__construct ( $params) | |
Initialise the object. | |
cancelSubmit ( $value, $alldata) | |
Override this function if the control can somehow trigger a form submission that shouldn't actually submit the HTMLForm. | |
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. | |
filter ( $value, $alldata) | |
Stable to override. | |
getAttributes (array $list) | |
Returns the given attributes from the parameters Stable to override. | |
getDefault () | |
Stable to override. | |
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. | |
getErrorsRaw ( $value) | |
Determine form errors to display, returning them in an array. | |
getHelpText () | |
Determine the help text to display Stable to override. | |
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. | |
getInline ( $value) | |
Get the complete field as an inline element. | |
getInputHTML ( $value) | |
This function must be implemented to return the HTML to generate the input object itself. | |
getInputOOUI ( $value) | |
Same as getInputHTML, but returns an OOUI object. | |
getLabel () | |
Stable to override. | |
getLabelHtml ( $cellAttributes=[]) | |
Stable to override. | |
getOOUI ( $value) | |
Get the OOUI version of the div. | |
getOptions () | |
Fetch the array of options from the field's parameters. | |
getOptionsOOUI () | |
Get options and make them into arrays suitable for OOUI. | |
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, for Html::element() etc. | |
getTooltipAndAccessKeyOOUI () | |
Returns the attributes required for the tooltip and accesskey, for OOUI widgets' config. | |
getVForm ( $value) | |
Get the complete field for the input, including help text, labels, and whatever. | |
hasVisibleOutput () | |
If this field has a user-visible output or not. | |
isHelpInline () | |
Determine if the help text should be displayed inline. | |
isHidden ( $alldata) | |
Test whether this field is supposed to be hidden, based on the values of the other form fields. | |
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 ( $key,... $params) | |
Get a translated interface message. | |
needsJSForHtml5FormValidation () | |
Whether this field requires the user agent to have JavaScript enabled for the client-side HTML5 form validation to work correctly. | |
setShowEmptyLabel ( $show) | |
Tell the field whether to generate a separate label element if its label is blank. | |
skipLoadData ( $request) | |
Skip this field when collecting data. | |
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>". | |
static | forceToStringRecursive ( $array) |
Recursively forces values in an array to strings, because issues arise with integer 0 as a value. | |
Public Attributes | |
array array[] | $mParams |
HTMLForm null | $mParent |
Protected Member Functions | |
getClassName () | |
Gets the non namespaced class name. | |
getFieldLayoutOOUI ( $inputField, $config) | |
Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output. | |
getLabelAlignOOUI () | |
Get label alignment when generating field for OOUI. | |
getMessage ( $value) | |
Turns a *-message parameter (which could be a MessageSpecifier, or a message name, or a name + parameters array) into a Message. | |
getNearestFieldByName ( $alldata, $name) | |
Fetch a field value from $alldata for the closest field matching a given name. | |
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. | |
isHiddenRecurse (array $alldata, array $params) | |
Helper function for isHidden to handle recursive data structures. | |
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. | |
needsLabel () | |
Should this field have a label, or is there no input element with the appropriate id for the label to point to? Stable to override. | |
shouldInfuseOOUI () | |
Whether the field should be automatically infused. | |
Static Protected Member Functions | |
static | formatErrors ( $errors) |
Formats one or more errors as accepted by field validation-callback. | |
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. | |
$mValidationCallback | |
$mVFormClass = '' | |
Private Member Functions | |
lookupOptionsKeys ( $options) | |
Given an array of msg-key => value mappings, returns an array with keys being the message texts. | |
The parent class to generate form fields.
Any field type should be a subclass of this.
Stable to extend
Definition at line 9 of file HTMLFormField.php.
HTMLFormField::__construct | ( | $params | ) |
Initialise the object.
Stable to call
array | $params | Associative Array. See HTMLForm doc for syntax. |
MWException |
Reimplemented in HTMLButtonField, HTMLFormFieldWithButton, HTMLInfoField, HTMLSelectNamespaceWithButton, HTMLTextFieldWithButton, HTMLAutoCompleteSelectField, HTMLCheckMatrix, HTMLDateTimeField, HTMLFormFieldCloner, HTMLHiddenField, HTMLMultiSelectField, HTMLRadioField, HTMLSelectAndOtherField, HTMLSelectLanguageField, HTMLSelectNamespace, HTMLSelectOrOtherField, HTMLTextAreaField, HTMLTextField, HTMLTitlesMultiselectField, HTMLTitleTextField, HTMLUserTextField, and Licenses.
Definition at line 407 of file HTMLFormField.php.
References getMessage().
HTMLFormField::cancelSubmit | ( | $value, | |
$alldata ) |
Override this function if the control can somehow trigger a form submission that shouldn't actually submit the HTMLForm.
Stable to override
string | array | $value | The value the field was submitted with |
array | $alldata | The data collected from the form |
Reimplemented in HTMLFormFieldCloner.
Definition at line 293 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.
Stable to override
Reimplemented in HTMLHiddenField.
Definition at line 71 of file HTMLFormField.php.
References hasVisibleOutput().
HTMLFormField::filter | ( | $value, | |
$alldata ) |
Stable to override.
mixed | $value | |
HTMLFormField[] | $alldata |
Definition at line 336 of file HTMLFormField.php.
|
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 1147 of file HTMLFormField.php.
Referenced by HTMLSelectAndOtherField\__construct(), HTMLCheckMatrix\filterDataForSubmit(), HTMLMultiSelectField\filterDataForSubmit(), HTMLAutoCompleteSelectField\getInputHTML(), HTMLSelectOrOtherField\getInputHTML(), HTMLSelectOrOtherField\getInputOOUI(), HTMLAutoCompleteSelectField\validate(), HTMLMultiSelectField\validate(), HTMLRadioField\validate(), and HTMLSelectField\validate().
|
static |
Recursively forces values in an array to strings, because issues arise with integer 0 as a value.
array | string | $array |
Definition at line 1093 of file HTMLFormField.php.
Referenced by HTMLMultiSelectField\filterDataForSubmit(), and HTMLMultiSelectField\getInputHTML().
|
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 1174 of file HTMLFormField.php.
References $lines.
HTMLFormField::getAttributes | ( | array | $list | ) |
Returns the given attributes from the parameters Stable to override.
array | $list | List of attributes to get |
Reimplemented in HTMLAutoCompleteSelectField, HTMLComboboxField, and HTMLDateTimeField.
Definition at line 1051 of file HTMLFormField.php.
Referenced by HTMLMultiSelectField\formatOptions(), HTMLRadioField\formatOptions(), HTMLButtonField\getInputHTML(), HTMLCheckField\getInputHTML(), HTMLCheckMatrix\getInputHTML(), HTMLFormFieldWithButton\getInputHTML(), HTMLSelectAndOtherField\getInputHTML(), HTMLSelectField\getInputHTML(), HTMLTextAreaField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLButtonField\getInputOOUI(), HTMLCheckField\getInputOOUI(), HTMLCheckMatrix\getInputOOUI(), HTMLFormFieldWithButton\getInputOOUI(), HTMLMultiSelectField\getInputOOUI(), HTMLRadioField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLSelectField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), HTMLTextAreaField\getInputOOUI(), and HTMLTextField\getInputOOUI().
|
protected |
Gets the non namespaced class name.
Definition at line 676 of file HTMLFormField.php.
Referenced by HTMLFormFieldCloner\__construct(), getDiv(), getOOUI(), HTMLCheckMatrix\getTableRow(), and getTableRow().
HTMLFormField::getDefault | ( | ) |
Stable to override.
Reimplemented in HTMLCheckMatrix, HTMLFormFieldCloner, HTMLInfoField, HTMLMultiSelectField, HTMLRestrictionsField, and HTMLSelectAndOtherField.
Definition at line 1011 of file HTMLFormField.php.
Referenced by HTMLButtonField\getInputHTML(), HTMLButtonField\getInputOOUI(), HTMLAutoCompleteSelectField\loadDataFromRequest(), HTMLCheckField\loadDataFromRequest(), HTMLDateTimeField\loadDataFromRequest(), HTMLNamespacesMultiselectField\loadDataFromRequest(), HTMLSelectOrOtherField\loadDataFromRequest(), HTMLSizeFilterField\loadDataFromRequest(), HTMLTitlesMultiselectField\loadDataFromRequest(), HTMLUsersMultiselectField\loadDataFromRequest(), and loadDataFromRequest().
HTMLFormField::getDiv | ( | $value | ) |
Get the complete div for the input, including help text, labels, and whatever.
Stable to override
string | $value | The value to set the input to. |
Reimplemented in HTMLApiField, HTMLEditTools, HTMLHiddenField, HTMLInfoField, and HTMLTagFilter.
Definition at line 553 of file HTMLFormField.php.
References getClassName(), getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlDiv(), getInputHTML(), and getLabelHtml().
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 915 of file HTMLFormField.php.
References 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 936 of file HTMLFormField.php.
References validate().
Referenced by getOOUI().
|
protected |
Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output.
OOUI\\Widget | $inputField | |
array | $config |
Definition at line 697 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getHelpText | ( | ) |
Determine the help text to display Stable to override.
Reimplemented in HTMLRestrictionsField.
Definition at line 864 of file HTMLFormField.php.
References 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 827 of file HTMLFormField.php.
Referenced by getDiv(), getHelpTextHtmlRaw(), and getInline().
HTMLFormField::getHelpTextHtmlRaw | ( | $helptext | ) |
Generate help text HTML formatted for raw output.
string | null | $helptext |
Definition at line 854 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 798 of file HTMLFormField.php.
Referenced by HTMLCheckMatrix\getTableRow(), and getTableRow().
HTMLFormField::getInline | ( | $value | ) |
Get the complete field as an inline element.
Stable to override
string | $value | The value to set the input to. |
Definition at line 776 of file HTMLFormField.php.
References getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlDiv(), getInputHTML(), and getLabelHtml().
|
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.
mixed | $value | The value to set the input to; eg a default text for a text input. |
Reimplemented in HTMLApiField, HTMLAutoCompleteSelectField, HTMLButtonField, HTMLCheckField, HTMLCheckMatrix, HTMLComboboxField, HTMLEditTools, HTMLExpiryField, HTMLFormFieldWithButton, HTMLHiddenField, HTMLInfoField, HTMLMultiSelectField, HTMLNamespacesMultiselectField, HTMLRadioField, HTMLRestrictionsField, HTMLSelectAndOtherField, HTMLSelectField, HTMLSelectNamespace, HTMLSelectNamespaceWithButton, HTMLSelectOrOtherField, HTMLSizeFilterField, HTMLTagFilter, HTMLTextAreaField, HTMLTextField, HTMLTextFieldWithButton, HTMLTitlesMultiselectField, HTMLUsersMultiselectField, Licenses, and HTMLFormFieldCloner.
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" Stable to override
string | $value |
Reimplemented in HTMLAutoCompleteSelectField, HTMLButtonField, HTMLCheckField, HTMLCheckMatrix, HTMLComboboxField, HTMLDateTimeField, HTMLExpiryField, HTMLFormFieldWithButton, HTMLInfoField, HTMLMultiSelectField, HTMLNamespacesMultiselectField, HTMLRadioField, HTMLRestrictionsField, HTMLSelectAndOtherField, HTMLSelectField, HTMLSelectNamespace, HTMLSelectOrOtherField, HTMLTagFilter, HTMLTextAreaField, HTMLTextField, HTMLTitlesMultiselectField, HTMLUsersMultiselectField, and HTMLFormFieldCloner.
Definition at line 61 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getLabel | ( | ) |
Stable to override.
Reimplemented in HTMLCheckField.
Definition at line 959 of file HTMLFormField.php.
Referenced by getLabelHtml(), and getOOUI().
|
protected |
Get label alignment when generating field for OOUI.
Stable to override
Reimplemented in HTMLCheckField.
Definition at line 686 of file HTMLFormField.php.
Referenced by getOOUI().
HTMLFormField::getLabelHtml | ( | $cellAttributes = [] | ) |
Stable to override.
array | $cellAttributes |
Reimplemented in UploadSourceField.
Definition at line 969 of file HTMLFormField.php.
References 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 1208 of file HTMLFormField.php.
References Message\newFromSpecifier().
Referenced by HTMLButtonField\__construct(), HTMLAutoCompleteSelectField\__construct(), HTMLSelectAndOtherField\__construct(), HTMLTextAreaField\__construct(), HTMLTextField\__construct(), __construct(), HTMLEditTools\formatMsg(), 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 118 of file HTMLFormField.php.
References $keys.
Referenced by isHiddenRecurse().
HTMLFormField::getOOUI | ( | $value | ) |
Get the OOUI version of the div.
Falls back to getDiv by default. Stable to override
string | $value | The value to set the input to. |
Reimplemented in HTMLInfoField, and HTMLTagFilter.
Definition at line 603 of file HTMLFormField.php.
References $help, getClassName(), 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.
Stable to override
Reimplemented in HTMLCheckMatrix, HTMLDateTimeField, HTMLExpiryField, HTMLNamespacesMultiselectField, HTMLSelectAndOtherField, HTMLSelectNamespace, HTMLSelectOrOtherField, HTMLSizeFilterField, HTMLTitlesMultiselectField, HTMLTitleTextField, HTMLUsersMultiselectField, and HTMLUserTextField.
Definition at line 725 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 1107 of file HTMLFormField.php.
References getMessage(), and lookupOptionsKeys().
Referenced by HTMLAutoCompleteSelectField\__construct(), HTMLSelectAndOtherField\__construct(), HTMLSelectOrOtherField\__construct(), HTMLMultiSelectField\filterDataForSubmit(), HTMLAutoCompleteSelectField\getAttributes(), HTMLAutoCompleteSelectField\getInputHTML(), HTMLComboboxField\getInputHTML(), HTMLMultiSelectField\getInputHTML(), HTMLRadioField\getInputHTML(), HTMLSelectField\getInputHTML(), HTMLSelectOrOtherField\getInputHTML(), HTMLMultiSelectField\getInputOOUI(), HTMLRadioField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), getOptionsOOUI(), HTMLAutoCompleteSelectField\validate(), HTMLMultiSelectField\validate(), HTMLRadioField\validate(), and HTMLSelectField\validate().
HTMLFormField::getOptionsOOUI | ( | ) |
Get options and make them into arrays suitable for OOUI.
Stable to override
Reimplemented in HTMLMultiSelectField.
Definition at line 1130 of file HTMLFormField.php.
References getOptions().
Referenced by HTMLComboboxField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLSelectField\getInputOOUI(), and HTMLSelectOrOtherField\getInputOOUI().
HTMLFormField::getRaw | ( | $value | ) |
Get the complete raw fields for the input, including help text, labels, and whatever.
Stable to override
string | $value | The value to set the input to. |
Reimplemented in HTMLApiField, HTMLEditTools, HTMLHiddenField, and HTMLInfoField.
Definition at line 739 of file HTMLFormField.php.
References getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlRaw(), getInputHTML(), and getLabelHtml().
HTMLFormField::getTableRow | ( | $value | ) |
Get the complete table row for the input, including help text, labels, and whatever.
Stable to override
string | $value | The value to set the input to. |
Reimplemented in HTMLApiField, HTMLCheckMatrix, HTMLEditTools, HTMLHiddenField, HTMLInfoField, and HTMLTagFilter.
Definition at line 494 of file HTMLFormField.php.
References getClassName(), getErrorsAndErrorClass(), getHelpText(), getHelpTextHtmlTable(), getInputHTML(), and getLabelHtml().
HTMLFormField::getTooltipAndAccessKey | ( | ) |
Returns the attributes required for the tooltip and accesskey, for Html::element() etc.
Definition at line 1020 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 1033 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.
Stable to override
string | $value | The value to set the input to. |
Definition at line 763 of file HTMLFormField.php.
References getDiv().
HTMLFormField::hasVisibleOutput | ( | ) |
If this field has a user-visible output or not.
If not, it will not be rendered Stable to override
Reimplemented in HTMLApiField, and HTMLHiddenField.
Definition at line 101 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 899 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 274 of file HTMLFormField.php.
References isHiddenRecurse().
Referenced by HTMLRestrictionsField\validate(), and validate().
|
protected |
Helper function for isHidden to handle recursive data structures.
array | $alldata | |
array | $params |
MWException |
Definition at line 167 of file HTMLFormField.php.
References getNearestFieldByName(), and isHiddenRecurse().
Referenced by isHidden(), and isHiddenRecurse().
|
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 378 of file HTMLFormField.php.
References WebRequest\getCheck().
Referenced by HTMLCheckField\loadDataFromRequest(), HTMLCheckMatrix\loadDataFromRequest(), and HTMLMultiSelectField\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.
Stable to override
WebRequest | $request |
Reimplemented in HTMLAutoCompleteSelectField, HTMLCheckField, HTMLCheckMatrix, HTMLDateTimeField, HTMLExpiryField, HTMLFormFieldCloner, HTMLMultiSelectField, HTMLNamespacesMultiselectField, HTMLRestrictionsField, HTMLSelectAndOtherField, HTMLSelectOrOtherField, HTMLSizeFilterField, HTMLSubmitField, HTMLTitlesMultiselectField, and HTMLUsersMultiselectField.
Definition at line 390 of file HTMLFormField.php.
References 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 1075 of file HTMLFormField.php.
References lookupOptionsKeys(), and msg().
Referenced by getOptions(), and lookupOptionsKeys().
HTMLFormField::msg | ( | $key, | |
$params ) |
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().
string | string[] | MessageSpecifier | $key | |
mixed | ...$params |
Definition at line 87 of file HTMLFormField.php.
References wfMessage().
Referenced by HTMLAutoCompleteSelectField\__construct(), HTMLDateTimeField\__construct(), HTMLSelectAndOtherField\__construct(), Licenses\__construct(), HTMLRestrictionsField\__construct(), HTMLEditTools\formatMsg(), HTMLSelectAndOtherField\getDefault(), HTMLRestrictionsField\getHelpText(), getHelpText(), HTMLSizeFilterField\getInputHTML(), HTMLFormFieldCloner\getInputHTMLForKey(), HTMLNamespacesMultiselectField\getInputOOUI(), HTMLTitlesMultiselectField\getInputOOUI(), HTMLUsersMultiselectField\getInputOOUI(), HTMLUserTextField\isValidIPRange(), HTMLSelectAndOtherField\loadDataFromRequest(), lookupOptionsKeys(), Licenses\makeLines(), Licenses\outputOption(), HTMLAutoCompleteSelectField\validate(), HTMLCheckMatrix\validate(), HTMLDateTimeField\validate(), HTMLFloatField\validate(), HTMLIntField\validate(), HTMLMultiSelectField\validate(), HTMLNamespacesMultiselectField\validate(), HTMLRadioField\validate(), HTMLRestrictionsField\validate(), HTMLSelectAndOtherField\validate(), HTMLSelectField\validate(), HTMLTitlesMultiselectField\validate(), HTMLTitleTextField\validate(), HTMLUsersMultiselectField\validate(), HTMLUserTextField\validate(), validate(), and HTMLFormFieldCloner\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 1236 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? Stable to override.
Reimplemented in HTMLButtonField, HTMLCheckField, HTMLFormFieldCloner, HTMLInfoField, HTMLMultiSelectField, HTMLRadioField, and HTMLSizeFilterField.
Definition at line 351 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 364 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. Stable to override
Reimplemented in HTMLCheckMatrix, HTMLComboboxField, HTMLDateTimeField, HTMLExpiryField, HTMLNamespacesMultiselectField, HTMLSelectField, HTMLSelectNamespace, HTMLSelectOrOtherField, HTMLTitlesMultiselectField, HTMLTitleTextField, HTMLUsersMultiselectField, and HTMLUserTextField.
Definition at line 713 of file HTMLFormField.php.
References getHelpText(), and isHelpInline().
Referenced by getOOUI().
HTMLFormField::skipLoadData | ( | $request | ) |
Skip this field when collecting data.
Stable to override
WebRequest | $request |
Reimplemented in HTMLSubmitField.
Definition at line 1225 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 Stable to override
string | array | $value | The value the field was submitted with |
array | $alldata | The data collected from the form |
Reimplemented in HTMLAutoCompleteSelectField, HTMLButtonField, HTMLCheckMatrix, HTMLDateTimeField, HTMLFloatField, HTMLIntField, HTMLMultiSelectField, HTMLNamespacesMultiselectField, HTMLRadioField, HTMLRestrictionsField, HTMLSelectAndOtherField, HTMLSelectField, HTMLSelectLimitField, HTMLTitlesMultiselectField, HTMLTitleTextField, HTMLUsersMultiselectField, HTMLUserTextField, EditWatchlistCheckboxSeriesField, and HTMLFormFieldCloner.
Definition at line 309 of file HTMLFormField.php.
References isHidden(), and msg().
Referenced by getErrorsAndErrorClass(), getErrorsRaw(), and EditWatchlistCheckboxSeriesField\validate().
|
protected |
Definition at line 19 of file HTMLFormField.php.
Referenced by HTMLAutoCompleteSelectField\getInputHTML(), HTMLCheckField\getInputHTML(), HTMLSelectAndOtherField\getInputHTML(), HTMLSelectOrOtherField\getInputHTML(), HTMLTextField\getInputHTML(), HTMLButtonField\getInputOOUI(), HTMLCheckField\getInputOOUI(), HTMLComboboxField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLSelectField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), and HTMLTextField\getInputOOUI().
|
protected |
Definition at line 22 of file HTMLFormField.php.
Referenced by HTMLHiddenField\getHiddenFieldData().
|
protected |
Definition at line 16 of file HTMLFormField.php.
Referenced by HTMLTextField\getInputHTML(), HTMLNamespacesMultiselectField\getInputOOUI(), and HTMLTitlesMultiselectField\getInputOOUI().
|
protected |
Definition at line 14 of file HTMLFormField.php.
|
protected |
Definition at line 21 of file HTMLFormField.php.
|
protected |
Definition at line 28 of file HTMLFormField.php.
Referenced by HTMLFormFieldCloner\createFieldsForKey().
|
protected |
Definition at line 18 of file HTMLFormField.php.
Referenced by HTMLHiddenField\getHiddenFieldData(), HTMLButtonField\getInputHTML(), HTMLCheckField\getInputHTML(), HTMLSelectAndOtherField\getInputHTML(), HTMLTextAreaField\getInputHTML(), HTMLTextField\getInputHTML(), Licenses\getInputHTML(), HTMLButtonField\getInputOOUI(), HTMLCheckField\getInputOOUI(), HTMLDateTimeField\getInputOOUI(), HTMLNamespacesMultiselectField\getInputOOUI(), and HTMLTitlesMultiselectField\getInputOOUI().
|
protected |
Definition at line 17 of file HTMLFormField.php.
Referenced by HTMLCheckField\getLabel().
|
protected |
Definition at line 15 of file HTMLFormField.php.
Referenced by HTMLHiddenField\getHiddenFieldData(), HTMLButtonField\getInputHTML(), HTMLTextField\getInputHTML(), Licenses\getInputHTML(), HTMLCheckField\getInputOOUI(), HTMLDateTimeField\getInputOOUI(), HTMLNamespacesMultiselectField\getInputOOUI(), HTMLSelectAndOtherField\getInputOOUI(), HTMLSelectOrOtherField\getInputOOUI(), HTMLTitlesMultiselectField\getInputOOUI(), and HTMLUsersMultiselectField\getInputOOUI().
|
protected |
Definition at line 26 of file HTMLFormField.php.
Referenced by HTMLSelectAndOtherField\__construct(), and HTMLSelectOrOtherField\__construct().
|
protected |
Definition at line 27 of file HTMLFormField.php.
array array [] HTMLFormField::$mParams |
Definition at line 11 of file HTMLFormField.php.
Referenced by HTMLExpiryField\getFieldByType().
HTMLForm null HTMLFormField::$mParent |
Definition at line 39 of file HTMLFormField.php.
|
protected |
If true will generate an empty div element with no label.
Definition at line 34 of file HTMLFormField.php.
|
protected |
Definition at line 13 of file HTMLFormField.php.
|
protected |
Definition at line 20 of file HTMLFormField.php.