MediaWiki master
|
The parent class to generate form fields. More...
Inherited by Licenses, MediaWiki\HTMLForm\Field\HTMLApiField, MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLEditTools, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLFileField, MediaWiki\HTMLForm\Field\HTMLFormFieldCloner, MediaWiki\HTMLForm\Field\HTMLFormFieldWithButton, MediaWiki\HTMLForm\Field\HTMLHiddenField, MediaWiki\HTMLForm\Field\HTMLInfoField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLRadioField, MediaWiki\HTMLForm\Field\HTMLRestrictionsField, MediaWiki\HTMLForm\Field\HTMLSelectField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLTagFilter, MediaWiki\HTMLForm\Field\HTMLTextAreaField, and MediaWiki\HTMLForm\Field\HTMLTextField.
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) | |
getAttributes (array $list) | |
Returns the given attributes from the parameters. | |
getCodex ( $value) | |
Get the Codex version of the div. | |
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. | |
getErrorsRaw ( $value) | |
Determine form errors to display, returning them in an array. | |
getHelpText () | |
Determine the help text to display. | |
getHelpTextHtmlDiv ( $helptext, $cssClasses=[]) | |
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. | |
getInputCodex ( $value, $hasErrors) | |
Same as getInputHTML, but for Codex. | |
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 () | |
getLabelHtml ( $cellAttributes=[]) | |
getName () | |
Get the field name that will be used for submission. | |
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. | |
isDisabled ( $alldata) | |
Test whether this field is supposed to be disabled, based on the values of the other form fields. | |
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 | |
checkStateRecurse (array $alldata, array $params) | |
Helper function for isHidden and isDisabled to handle recursive data structures. | |
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. | |
getNearestField ( $name, $backCompat=false) | |
Get the closest field matching a given name. | |
getNearestFieldByName ( $alldata, $name, $asDisplay=false) | |
Fetch a field value from $alldata for the closest field matching a given name. | |
getNearestFieldValue ( $alldata, $name, $asDisplay=false, $backCompat=false) | |
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. | |
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? | |
parseCondState ( $params) | |
Parse the cond-state array to use the field name for submission, since the key in the form descriptor is never known in HTML. | |
parseCondStateForClient () | |
Parse the cond-state array for client-side. | |
shouldInfuseOOUI () | |
Whether the field should be automatically infused. | |
validateCondState ( $params) | |
Validate the cond-state params, the existence check of fields should be done later. | |
Static Protected Member Functions | |
static | formatErrors ( $errors) |
Formats one or more errors as accepted by field validation-callback. | |
Protected Attributes | |
string | $mClass = '' |
array | $mCondState = [] |
Array to hold params for 'hide-if' or 'disable-if' statements. | |
array | $mCondStateClass = [] |
mixed | $mDefault |
string | $mDir |
string false | $mHelpClass = false |
string | $mID |
string | $mLabel |
String label, as HTML. | |
string | $mName |
array null false | $mOptions = false |
bool | $mOptionsLabelsNotFromMessage = false |
bool | $mShowEmptyLabels = true |
If true will generate an empty div element with no label. | |
string | $mVFormClass = '' |
The parent class to generate form fields.
Any field type should be a subclass of this.
Definition at line 26 of file HTMLFormField.php.
MediaWiki\HTMLForm\HTMLFormField::__construct | ( | $params | ) |
Initialise the object.
array | $params | Associative Array. See HTMLForm doc for syntax. |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLFormFieldWithButton, MediaWiki\HTMLForm\Field\HTMLInfoField, MediaWiki\HTMLForm\Field\HTMLSelectNamespaceWithButton, MediaWiki\HTMLForm\Field\HTMLTextFieldWithButton, MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLDateTimeField, MediaWiki\HTMLForm\Field\HTMLFileField, MediaWiki\HTMLForm\Field\HTMLHiddenField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLRadioField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectLanguageField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLTextAreaField, MediaWiki\HTMLForm\Field\HTMLTextField, MediaWiki\HTMLForm\Field\HTMLTimezoneField, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitleTextField, MediaWiki\HTMLForm\Field\HTMLUserTextField, and Licenses.
Definition at line 546 of file HTMLFormField.php.
References $params, MediaWiki\HTMLForm\HTMLFormField\getMessage(), MediaWiki\HTMLForm\HTMLFormField\validateCondState(), and wfDeprecatedMsg().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLFormFieldCloner.
Definition at line 421 of file HTMLFormField.php.
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLHiddenField.
Definition at line 123 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\hasVisibleOutput().
|
protected |
Helper function for isHidden and isDisabled to handle recursive data structures.
array | $alldata | |
array | $params |
Definition at line 303 of file HTMLFormField.php.
References $params, MediaWiki\HTMLForm\HTMLFormField\checkStateRecurse(), and MediaWiki\HTMLForm\HTMLFormField\getNearestFieldValue().
Referenced by MediaWiki\HTMLForm\HTMLFormField\checkStateRecurse(), MediaWiki\HTMLForm\HTMLFormField\isDisabled(), and MediaWiki\HTMLForm\HTMLFormField\isHidden().
MediaWiki\HTMLForm\HTMLFormField::filter | ( | $value, | |
$alldata ) |
mixed | $value | |
mixed[] | $alldata |
Definition at line 472 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 1366 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\__construct(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\filterDataForSubmit(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\filterDataForSubmit(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLRadioField\validate(), and MediaWiki\HTMLForm\Field\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 1308 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLMultiSelectField\filterDataForSubmit(), and MediaWiki\HTMLForm\Field\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. |
Definition at line 1393 of file HTMLFormField.php.
References MediaWiki\Message\Message\parse().
MediaWiki\HTMLForm\HTMLFormField::getAttributes | ( | array | $list | ) |
Returns the given attributes from the parameters.
array | $list | List of attributes to get |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField, MediaWiki\HTMLForm\Field\HTMLComboboxField, and MediaWiki\HTMLForm\Field\HTMLDateTimeField.
Definition at line 1250 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLMultiSelectField\formatOptions(), MediaWiki\HTMLForm\Field\HTMLRadioField\formatOptions(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLRadioField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFormFieldWithButton\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLFormFieldWithButton\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLRadioField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputOOUI(), and MediaWiki\HTMLForm\Field\HTMLToggleSwitchField\getInputOOUI().
|
protected |
Gets the non namespaced class name.
Definition at line 904 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getOOUI(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getTableRow(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
MediaWiki\HTMLForm\HTMLFormField::getCodex | ( | $value | ) |
Get the Codex version of the div.
string | $value | The value to set the input to. |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLHiddenField, and MediaWiki\HTMLForm\Field\HTMLInfoField.
Definition at line 824 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\$mClass, MediaWiki\HTMLForm\HTMLFormField\$mID, MediaWiki\HTMLForm\HTMLFormField\getErrorsAndErrorClass(), MediaWiki\HTMLForm\HTMLFormField\getHelpText(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlDiv(), MediaWiki\HTMLForm\HTMLFormField\getInputCodex(), MediaWiki\HTMLForm\HTMLFormField\getLabel(), MediaWiki\HTMLForm\HTMLFormField\needsLabel(), and MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient().
Referenced by MediaWiki\HTMLForm\CodexHTMLForm\formatField().
MediaWiki\HTMLForm\HTMLFormField::getDefault | ( | ) |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLFormFieldCloner, MediaWiki\HTMLForm\Field\HTMLInfoField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLRestrictionsField, and MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField.
Definition at line 1210 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLButtonField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLDateTimeField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLTagMultiselectField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField\loadDataFromRequest(), and MediaWiki\HTMLForm\HTMLFormField\loadDataFromRequest().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLApiField, MediaWiki\HTMLForm\Field\HTMLEditTools, MediaWiki\HTMLForm\Field\HTMLHiddenField, MediaWiki\HTMLForm\Field\HTMLInfoField, and MediaWiki\HTMLForm\Field\HTMLTagFilter.
Definition at line 695 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\$mClass, MediaWiki\HTMLForm\HTMLFormField\$mVFormClass, MediaWiki\HTMLForm\HTMLFormField\getClassName(), MediaWiki\HTMLForm\HTMLFormField\getErrorsAndErrorClass(), MediaWiki\HTMLForm\HTMLFormField\getHelpText(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlDiv(), MediaWiki\HTMLForm\HTMLFormField\getInputHTML(), MediaWiki\HTMLForm\HTMLFormField\getLabelHtml(), and MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient().
Referenced by MediaWiki\HTMLForm\HTMLForm\formatField(), MediaWiki\HTMLForm\HTMLFormField\getOOUI(), and MediaWiki\HTMLForm\HTMLFormField\getVForm().
MediaWiki\HTMLForm\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 1128 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getInline(), MediaWiki\HTMLForm\HTMLFormField\getRaw(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getTableRow(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
MediaWiki\HTMLForm\HTMLFormField::getErrorsRaw | ( | $value | ) |
Determine form errors to display, returning them in an array.
string | $value | The value of the input |
Definition at line 1145 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI().
|
protected |
Get a FieldLayout (or subclass thereof) to wrap this field in when using OOUI output.
\\OOUI\\Widget | $inputField | |
array | $config |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLSelectNamespaceWithButton, and MediaWiki\HTMLForm\Field\HTMLTextFieldWithButton.
Definition at line 924 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI().
MediaWiki\HTMLForm\HTMLFormField::getHelpText | ( | ) |
Determine the help text to display.
Definition at line 1087 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getInline(), MediaWiki\HTMLForm\HTMLFormField\getOOUI(), MediaWiki\HTMLForm\HTMLFormField\getRaw(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getTableRow(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
MediaWiki\HTMLForm\HTMLFormField::getHelpTextHtmlDiv | ( | $helptext, | |
$cssClasses = [] ) |
Generate help text HTML in div format.
string | null | $helptext | |
string[] | $cssClasses |
Definition at line 1037 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\$mHelpClass, and MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient().
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlRaw(), and MediaWiki\HTMLForm\HTMLFormField\getInline().
MediaWiki\HTMLForm\HTMLFormField::getHelpTextHtmlRaw | ( | $helptext | ) |
Generate help text HTML formatted for raw output.
string | null | $helptext |
Definition at line 1062 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlDiv().
Referenced by MediaWiki\HTMLForm\HTMLFormField\getRaw().
MediaWiki\HTMLForm\HTMLFormField::getHelpTextHtmlTable | ( | $helptext | ) |
Generate help text HTML in table format.
string | null | $helptext |
Definition at line 1008 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\$mCondStateClass, MediaWiki\HTMLForm\HTMLFormField\$mHelpClass, and MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient().
Referenced by MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getTableRow(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
MediaWiki\HTMLForm\HTMLFormField::getInline | ( | $value | ) |
Get the complete field as an inline element.
string | $value | The value to set the input to. |
Definition at line 992 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getErrorsAndErrorClass(), MediaWiki\HTMLForm\HTMLFormField\getHelpText(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlDiv(), MediaWiki\HTMLForm\HTMLFormField\getInputHTML(), and MediaWiki\HTMLForm\HTMLFormField\getLabelHtml().
Referenced by MediaWiki\HTMLForm\HTMLForm\formatField().
MediaWiki\HTMLForm\HTMLFormField::getInputCodex | ( | $value, | |
$hasErrors ) |
Same as getInputHTML, but for Codex.
This is called by CodexHTMLForm.
If not overridden, falls back to getInputHTML.
string | $value | The value to set the input to |
bool | $hasErrors | Whether there are validation errors. If set to true, this method should apply a CSS class for the error status (e.g. cdx-text-input–status-error) if the component used supports that. |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLRadioField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLTextAreaField, MediaWiki\HTMLForm\Field\HTMLTextField, and MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField.
Definition at line 112 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getInputHTML().
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex().
|
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 MediaWiki\HTMLForm\Field\HTMLApiField, MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField, MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLComboboxField, MediaWiki\HTMLForm\Field\HTMLEditTools, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLFileField, MediaWiki\HTMLForm\Field\HTMLFormFieldWithButton, MediaWiki\HTMLForm\Field\HTMLHiddenField, MediaWiki\HTMLForm\Field\HTMLInfoField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLRadioField, MediaWiki\HTMLForm\Field\HTMLRestrictionsField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLSelectNamespaceWithButton, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLSizeFilterField, MediaWiki\HTMLForm\Field\HTMLTagFilter, MediaWiki\HTMLForm\Field\HTMLTagMultiselectField, MediaWiki\HTMLForm\Field\HTMLTextAreaField, MediaWiki\HTMLForm\Field\HTMLTextField, MediaWiki\HTMLForm\Field\HTMLTextFieldWithButton, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField, Licenses, and MediaWiki\HTMLForm\Field\HTMLFormFieldCloner.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getInline(), MediaWiki\HTMLForm\HTMLFormField\getInputCodex(), MediaWiki\HTMLForm\HTMLFormField\getRaw(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField, MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLComboboxField, MediaWiki\HTMLForm\Field\HTMLDateTimeField, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLFileField, MediaWiki\HTMLForm\Field\HTMLFormFieldWithButton, MediaWiki\HTMLForm\Field\HTMLInfoField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLRadioField, MediaWiki\HTMLForm\Field\HTMLRestrictionsField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLTagFilter, MediaWiki\HTMLForm\Field\HTMLTagMultiselectField, MediaWiki\HTMLForm\Field\HTMLTextAreaField, MediaWiki\HTMLForm\Field\HTMLTextField, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, MediaWiki\HTMLForm\Field\HTMLToggleSwitchField, MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField, and MediaWiki\HTMLForm\Field\HTMLFormFieldCloner.
Definition at line 97 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI().
MediaWiki\HTMLForm\HTMLFormField::getLabel | ( | ) |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLCheckField.
Definition at line 1168 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), and MediaWiki\HTMLForm\HTMLFormField\getOOUI().
|
protected |
Get label alignment when generating field for OOUI.
Reimplemented in MediaWiki\HTMLForm\Field\HTMLCheckField.
Definition at line 914 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI().
MediaWiki\HTMLForm\HTMLFormField::getLabelHtml | ( | $cellAttributes = [] | ) |
array | $cellAttributes |
Reimplemented in UploadSourceField.
Definition at line 1178 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getInline(), MediaWiki\HTMLForm\HTMLFormField\getRaw(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\getTableRow(), and MediaWiki\HTMLForm\HTMLFormField\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 1418 of file HTMLFormField.php.
References MediaWiki\Message\Message\newFromSpecifier().
Referenced by MediaWiki\HTMLForm\Field\HTMLButtonField\__construct(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\__construct(), MediaWiki\HTMLForm\Field\HTMLFileField\__construct(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\__construct(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\__construct(), MediaWiki\HTMLForm\Field\HTMLTextField\__construct(), MediaWiki\HTMLForm\HTMLFormField\__construct(), and MediaWiki\HTMLForm\Field\HTMLEditTools\formatMsg().
MediaWiki\HTMLForm\HTMLFormField::getName | ( | ) |
Get the field name that will be used for submission.
Definition at line 163 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\$mName.
|
protected |
Get the closest field matching a given name.
It can 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.
string | $name | |
bool | $backCompat | Whether to try striping the 'wp' prefix. |
Definition at line 178 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getNearestFieldValue(), and MediaWiki\HTMLForm\HTMLFormField\parseCondState().
|
protected |
Fetch a field value from $alldata for the closest field matching a given name.
array | $alldata | |
string | $name | |
bool | $asDisplay |
Definition at line 239 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getNearestFieldValue().
|
protected |
Fetch a field value from $alldata for the closest field matching a given name.
array | $alldata | |
string | $name | |
bool | $asDisplay | Whether the reverting logic of HTMLCheckField should be ignored. |
bool | $backCompat | Whether to try striping the 'wp' prefix. |
Definition at line 208 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getNearestField().
Referenced by MediaWiki\HTMLForm\HTMLFormField\checkStateRecurse(), and MediaWiki\HTMLForm\HTMLFormField\getNearestFieldByName().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLInfoField, and MediaWiki\HTMLForm\Field\HTMLTagFilter.
Definition at line 744 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\$mClass, MediaWiki\HTMLForm\HTMLFormField\getClassName(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getErrorsRaw(), MediaWiki\HTMLForm\HTMLFormField\getFieldLayoutOOUI(), MediaWiki\HTMLForm\HTMLFormField\getHelpText(), MediaWiki\HTMLForm\HTMLFormField\getInputOOUI(), MediaWiki\HTMLForm\HTMLFormField\getLabel(), MediaWiki\HTMLForm\HTMLFormField\getLabelAlignOOUI(), MediaWiki\HTMLForm\HTMLFormField\getOOUIModules(), MediaWiki\HTMLForm\HTMLFormField\isHelpInline(), MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient(), and MediaWiki\HTMLForm\HTMLFormField\shouldInfuseOOUI().
Referenced by MediaWiki\HTMLForm\OOUIHTMLForm\formatField().
|
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 MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLDateTimeField, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLSizeFilterField, MediaWiki\HTMLForm\Field\HTMLTagMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitleTextField, MediaWiki\HTMLForm\Field\HTMLToggleSwitchField, MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField, and MediaWiki\HTMLForm\Field\HTMLUserTextField.
Definition at line 948 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI().
MediaWiki\HTMLForm\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 1322 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\__construct(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\__construct(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\__construct(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\filterDataForSubmit(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\getAttributes(), MediaWiki\HTMLForm\Field\HTMLRadioField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLComboboxField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLRadioField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLRadioField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLRadioField\validate(), and MediaWiki\HTMLForm\Field\HTMLSelectField\validate().
MediaWiki\HTMLForm\HTMLFormField::getOptionsOOUI | ( | ) |
Get options and make them into arrays suitable for OOUI.
Reimplemented in MediaWiki\HTMLForm\Field\HTMLMultiSelectField.
Definition at line 1349 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLComboboxField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputOOUI(), and MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputOOUI().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLApiField, MediaWiki\HTMLForm\Field\HTMLEditTools, MediaWiki\HTMLForm\Field\HTMLHiddenField, and MediaWiki\HTMLForm\Field\HTMLInfoField.
Definition at line 962 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getErrorsAndErrorClass(), MediaWiki\HTMLForm\HTMLFormField\getHelpText(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlRaw(), MediaWiki\HTMLForm\HTMLFormField\getInputHTML(), and MediaWiki\HTMLForm\HTMLFormField\getLabelHtml().
Referenced by MediaWiki\HTMLForm\HTMLForm\formatField().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLApiField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLEditTools, MediaWiki\HTMLForm\Field\HTMLHiddenField, MediaWiki\HTMLForm\Field\HTMLInfoField, and MediaWiki\HTMLForm\Field\HTMLTagFilter.
Definition at line 637 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getClassName(), MediaWiki\HTMLForm\HTMLFormField\getErrorsAndErrorClass(), MediaWiki\HTMLForm\HTMLFormField\getHelpText(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlTable(), MediaWiki\HTMLForm\HTMLFormField\getInputHTML(), MediaWiki\HTMLForm\HTMLFormField\getLabelHtml(), and MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient().
Referenced by MediaWiki\HTMLForm\HTMLForm\formatField().
MediaWiki\HTMLForm\HTMLFormField::getTooltipAndAccessKey | ( | ) |
Returns the attributes required for the tooltip and accesskey, for Html::element() etc.
Definition at line 1219 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLCheckField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), and MediaWiki\HTMLForm\Field\HTMLTextField\getInputHTML().
MediaWiki\HTMLForm\HTMLFormField::getTooltipAndAccessKeyOOUI | ( | ) |
Returns the attributes required for the tooltip and accesskey, for OOUI widgets' config.
Definition at line 1232 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLCheckField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputOOUI(), and MediaWiki\HTMLForm\Field\HTMLToggleSwitchField\getInputOOUI().
MediaWiki\HTMLForm\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 979 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getDiv().
Referenced by MediaWiki\HTMLForm\VFormHTMLForm\formatField().
MediaWiki\HTMLForm\HTMLFormField::hasVisibleOutput | ( | ) |
If this field has a user-visible output or not.
If not, it will not be rendered
Reimplemented in MediaWiki\HTMLForm\Field\HTMLApiField, and MediaWiki\HTMLForm\Field\HTMLHiddenField.
Definition at line 153 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\canDisplayErrors().
MediaWiki\HTMLForm\HTMLFormField::isDisabled | ( | $alldata | ) |
Test whether this field is supposed to be disabled, based on the values of the other form fields.
array | $alldata | The data collected from the form |
Definition at line 403 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\checkStateRecurse(), and MediaWiki\HTMLForm\HTMLFormField\isHidden().
MediaWiki\HTMLForm\HTMLFormField::isHelpInline | ( | ) |
Determine if the help text should be displayed inline.
Only applies to OOUI forms.
Definition at line 1112 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI(), and MediaWiki\HTMLForm\HTMLFormField\shouldInfuseOOUI().
MediaWiki\HTMLForm\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 390 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\checkStateRecurse().
Referenced by MediaWiki\HTMLForm\HTMLFormField\isDisabled(), MediaWiki\HTMLForm\Field\HTMLRestrictionsField\validate(), and MediaWiki\HTMLForm\HTMLFormField\validate().
|
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 was posted and has a field for a CSRF token (wpEditToken), or has a form identifier (wpFormIdentifier).
WebRequest | $request |
Definition at line 515 of file HTMLFormField.php.
References MediaWiki\Request\WebRequest\getCheck(), and MediaWiki\Request\WebRequest\wasPosted().
Referenced by MediaWiki\HTMLForm\Field\HTMLCheckField\loadDataFromRequest(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\loadDataFromRequest(), and MediaWiki\HTMLForm\Field\HTMLMultiSelectField\loadDataFromRequest().
MediaWiki\HTMLForm\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 MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField, MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLDateTimeField, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLFileField, MediaWiki\HTMLForm\Field\HTMLFormFieldCloner, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLRestrictionsField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLSizeFilterField, MediaWiki\HTMLForm\Field\HTMLSubmitField, MediaWiki\HTMLForm\Field\HTMLTagMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, and MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField.
Definition at line 530 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\getDefault().
MediaWiki\HTMLForm\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 139 of file HTMLFormField.php.
References $params, and wfMessage().
Referenced by MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\__construct(), MediaWiki\HTMLForm\Field\HTMLDateTimeField\__construct(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\__construct(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\__construct(), Licenses\__construct(), MediaWiki\HTMLForm\Field\HTMLEditTools\formatMsg(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getDefault(), MediaWiki\HTMLForm\Field\HTMLSizeFilterField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFormFieldCloner\getInputHTMLForKey(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTagMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLRadioField\getOptionDescriptions(), MediaWiki\HTMLForm\Field\HTMLUserTextField\isValidIPRange(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\loadDataFromRequest(), Licenses\makeLines(), Licenses\outputOption(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLCheckMatrix\validate(), MediaWiki\HTMLForm\Field\HTMLDateTimeField\validate(), MediaWiki\HTMLForm\Field\HTMLFloatField\validate(), MediaWiki\HTMLForm\Field\HTMLIntField\validate(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\validate(), MediaWiki\HTMLForm\Field\HTMLRadioField\validate(), MediaWiki\HTMLForm\Field\HTMLRestrictionsField\validate(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\validate(), MediaWiki\HTMLForm\Field\HTMLSelectField\validate(), MediaWiki\HTMLForm\Field\HTMLTagMultiselectField\validate(), MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField\validate(), MediaWiki\HTMLForm\Field\HTMLTitleTextField\validate(), MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField\validate(), MediaWiki\HTMLForm\Field\HTMLUserTextField\validate(), MediaWiki\HTMLForm\HTMLFormField\validate(), and MediaWiki\HTMLForm\Field\HTMLFormFieldCloner\validate().
MediaWiki\HTMLForm\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 1446 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 MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLCheckField, MediaWiki\HTMLForm\Field\HTMLFormFieldCloner, MediaWiki\HTMLForm\Field\HTMLInfoField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLRadioField, and MediaWiki\HTMLForm\Field\HTMLSizeFilterField.
Definition at line 487 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex().
|
protected |
Parse the cond-state array to use the field name for submission, since the key in the form descriptor is never known in HTML.
Also check for field existence here.
array | $params |
Definition at line 344 of file HTMLFormField.php.
References $params, MediaWiki\HTMLForm\HTMLFormField\getNearestField(), and MediaWiki\HTMLForm\HTMLFormField\parseCondState().
Referenced by MediaWiki\HTMLForm\HTMLFormField\parseCondState(), and MediaWiki\HTMLForm\HTMLFormField\parseCondStateForClient().
|
protected |
Parse the cond-state array for client-side.
Definition at line 374 of file HTMLFormField.php.
References $params, and MediaWiki\HTMLForm\HTMLFormField\parseCondState().
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlDiv(), MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlTable(), MediaWiki\HTMLForm\HTMLFormField\getOOUI(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
MediaWiki\HTMLForm\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 500 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\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 MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLComboboxField, MediaWiki\HTMLForm\Field\HTMLDateTimeField, MediaWiki\HTMLForm\Field\HTMLExpiryField, MediaWiki\HTMLForm\Field\HTMLFileField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLSelectField, MediaWiki\HTMLForm\Field\HTMLSelectNamespace, MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField, MediaWiki\HTMLForm\Field\HTMLTagFilter, MediaWiki\HTMLForm\Field\HTMLTagMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitleTextField, MediaWiki\HTMLForm\Field\HTMLToggleSwitchField, MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField, and MediaWiki\HTMLForm\Field\HTMLUserTextField.
Definition at line 936 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\isHelpInline().
Referenced by MediaWiki\HTMLForm\HTMLFormField\getOOUI().
MediaWiki\HTMLForm\HTMLFormField::skipLoadData | ( | $request | ) |
Skip this field when collecting data.
WebRequest | $request |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLSubmitField.
Definition at line 1435 of file HTMLFormField.php.
MediaWiki\HTMLForm\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
mixed | $value | The value the field was submitted with |
array | $alldata | The data collected from the form |
Reimplemented in MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField, MediaWiki\HTMLForm\Field\HTMLButtonField, MediaWiki\HTMLForm\Field\HTMLCheckMatrix, MediaWiki\HTMLForm\Field\HTMLDateTimeField, MediaWiki\HTMLForm\Field\HTMLFloatField, MediaWiki\HTMLForm\Field\HTMLIntField, MediaWiki\HTMLForm\Field\HTMLMultiSelectField, MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField, MediaWiki\HTMLForm\Field\HTMLRadioField, MediaWiki\HTMLForm\Field\HTMLRestrictionsField, MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField, MediaWiki\HTMLForm\Field\HTMLSelectField, MediaWiki\HTMLForm\Field\HTMLSelectLimitField, MediaWiki\HTMLForm\Field\HTMLTagMultiselectField, MediaWiki\HTMLForm\Field\HTMLTimezoneField, MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField, MediaWiki\HTMLForm\Field\HTMLTitleTextField, MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField, MediaWiki\HTMLForm\Field\HTMLUserTextField, EditWatchlistCheckboxSeriesField, and MediaWiki\HTMLForm\Field\HTMLFormFieldCloner.
Definition at line 437 of file HTMLFormField.php.
References MediaWiki\HTMLForm\HTMLFormField\isHidden(), and MediaWiki\HTMLForm\HTMLFormField\msg().
|
protected |
Validate the cond-state params, the existence check of fields should be done later.
array | $params |
Definition at line 249 of file HTMLFormField.php.
References $params, and MediaWiki\HTMLForm\HTMLFormField\validateCondState().
Referenced by MediaWiki\HTMLForm\HTMLFormField\__construct(), and MediaWiki\HTMLForm\HTMLFormField\validateCondState().
|
protected |
Definition at line 43 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLAutoCompleteSelectField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLComboboxField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLMultiSelectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLToggleSwitchField\getInputOOUI(), and MediaWiki\HTMLForm\HTMLFormField\getOOUI().
|
protected |
Array to hold params for 'hide-if' or 'disable-if' statements.
Definition at line 62 of file HTMLFormField.php.
|
protected |
Definition at line 64 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlTable().
|
protected |
Definition at line 49 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLCheckField\getDefault(), and MediaWiki\HTMLForm\Field\HTMLHiddenField\getHiddenFieldData().
|
protected |
Definition at line 37 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLTextField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\getInputOOUI(), and MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField\getInputOOUI().
|
protected |
Definition at line 47 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlDiv(), and MediaWiki\HTMLForm\HTMLFormField\getHelpTextHtmlTable().
|
protected |
Definition at line 41 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getCodex(), MediaWiki\HTMLForm\Field\HTMLHiddenField\getHiddenFieldData(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextAreaField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputHTML(), Licenses\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLDateTimeField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField\getInputOOUI(), and MediaWiki\HTMLForm\Field\HTMLToggleSwitchField\getInputOOUI().
|
protected |
|
protected |
Definition at line 35 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLHiddenField\getHiddenFieldData(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLRadioField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputCodex(), MediaWiki\HTMLForm\Field\HTMLButtonField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLFileField\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLTextField\getInputHTML(), Licenses\getInputHTML(), MediaWiki\HTMLForm\Field\HTMLCheckField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLDateTimeField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLNamespacesMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTagMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLTitlesMultiselectField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLToggleSwitchField\getInputOOUI(), MediaWiki\HTMLForm\Field\HTMLUsersMultiselectField\getInputOOUI(), and MediaWiki\HTMLForm\HTMLFormField\getName().
|
protected |
Definition at line 56 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLSelectAndOtherField\__construct(), and MediaWiki\HTMLForm\Field\HTMLSelectOrOtherField\__construct().
|
protected |
Definition at line 58 of file HTMLFormField.php.
array array [] MediaWiki\HTMLForm\HTMLFormField::$mParams |
Definition at line 28 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLExpiryField\getFieldByType().
HTMLForm null MediaWiki\HTMLForm\HTMLFormField::$mParent |
Definition at line 75 of file HTMLFormField.php.
|
protected |
If true will generate an empty div element with no label.
Definition at line 70 of file HTMLFormField.php.
|
protected |
Definition at line 45 of file HTMLFormField.php.
Referenced by MediaWiki\HTMLForm\HTMLFormField\getDiv().