|
MediaWiki master
|
Object handling generic submission, CSRF protection, layout and other logic for UI forms in a reusable manner. More...
Inherits MediaWiki\Context\ContextSource.
Inherited by MediaWiki\HTMLForm\CodexHTMLForm, MediaWiki\HTMLForm\OOUIHTMLForm, and MediaWiki\Specials\Forms\UploadForm.

Public Member Functions | |
| __construct ( $descriptor, IContextSource $context, $messagePrefix='') | |
| Build a new HTMLForm from an array of field attributes. | |
| addButton ( $data) | |
| Add a button to the form. | |
| addFields ( $descriptor) | |
| Add fields to the form. | |
| addFooterHtml ( $html, $section=null) | |
| Add footer HTML, inside the form. | |
| addHeaderHtml ( $html, $section=null) | |
| Add HTML to the header, inside the form. | |
| addHiddenField ( $name, $value, array $attribs=[]) | |
| Add a hidden field to the output Array values are discarded for security reasons (per WebRequest::getVal). | |
| addHiddenFields (array $fields) | |
| Add an array of hidden fields to the output Array values are discarded for security reasons (per WebRequest::getVal). | |
| addPostHtml ( $html) | |
| Add HTML to the end of the display. | |
| addPreHtml ( $html) | |
| Add HTML to introductory message. | |
| displayForm ( $submitResult) | |
| Display the form (sending to the context's OutputPage object), with an appropriate error message or stack of messages, and any validation errors, etc. | |
| displaySection ( $fields, $sectionName='', $fieldsetIDPrefix='', &$hasUserVisibleFields=false) | |
| filterDataForSubmit ( $data) | |
| Overload this if you want to apply special filtration routines to the form as a whole, after it's submitted but before it's processed. | |
| formatErrors ( $errors) | |
| Format a stack of error messages into a single HTML string. | |
| getAction () | |
| Get the value for the action attribute of the form. | |
| getBody () | |
| Get the whole body of the form. | |
| getButtons () | |
| Get the submit and (potentially) reset buttons. | |
| getDisplayFormat () | |
| Getter for displayFormat. | |
| getErrorsOrWarnings ( $elements, $elementsType) | |
| Returns a formatted list of errors or warnings from the given elements. | |
| getField ( $fieldname) | |
| getFooterHtml ( $section=null) | |
| Get footer HTML. | |
| getHeaderHtml ( $section=null) | |
| Get header HTML. | |
| getHiddenFields () | |
| Get the hidden fields that should go inside the form. | |
| getHTML ( $submitResult) | |
| Returns the raw HTML generated by the form. | |
| getLegend ( $key) | |
| Get a string to go in the "<legend>" of a section fieldset. | |
| getMethod () | |
| getPostHtml () | |
| Get HTML at the end of the display. | |
| getPreHtml () | |
| Get the introductory message HTML. | |
| getSubmitText () | |
| Get the text for the submit button, either customised or a default. | |
| getTitle () | |
| hasField ( $fieldname) | |
| loadData () | |
| needsJSForHtml5FormValidation () | |
| Whether this form, with its current fields, requires the user agent to have JavaScript enabled for the client-side HTML5 form validation to work correctly. | |
| prepareForm () | |
| Prepare form for submission. | |
| requestIsAuthorized () | |
| Return true if the http request passes identity and csrf checks. | |
| setAction ( $action) | |
| Set the value for the action attribute of the form. | |
| setAutocomplete ( $autocomplete) | |
| Set the value for the autocomplete attribute of the form. | |
| setCancelTarget ( $target) | |
| Sets the target where the user is redirected to after clicking cancel. | |
| setCollapsibleOptions ( $collapsedByDefault=false) | |
| Enable collapsible mode, and set whether the form is collapsed by default. | |
| setDisplayFormat ( $format) | |
| Set format in which to display the form. | |
| setFooterHtml ( $html, $section=null) | |
| Set footer HTML, inside the form. | |
| setFormIdentifier (string $ident, bool $single=false) | |
| Set an internal identifier for this form. | |
| setHeaderHtml ( $html, $section=null) | |
| Set header HTML, inside the form. | |
| setId ( $id) | |
| setMessagePrefix ( $p) | |
| Set the prefix for various default messages. | |
| setMethod ( $method='post') | |
| Set the method used to submit the form. | |
| setName ( $name) | |
| setPostHtml ( $html) | |
| Set HTML at the end of the display. | |
| setPreHtml ( $html) | |
| Set the introductory message HTML, overwriting any existing message. | |
| setSections ( $sections) | |
| Set an array of information about sections. | |
| setSubmitCallback ( $cb) | |
| Set a callback to a function to do something with the form once it's been successfully validated. | |
| setSubmitDestructive () | |
| Identify that the submit button in the form has a destructive action. | |
| setSubmitID ( $t) | |
| Set the id for the submit button. | |
| setSubmitLockIcon () | |
| Attach a "lock" OOUI icon to the submit button. | |
| setSubmitName ( $name) | |
| setSubmitText ( $t) | |
| Set the text for the submit button. | |
| setSubmitTextMsg ( $msg) | |
| Set the text for the submit button to a message. | |
| setSubmitTooltip ( $name) | |
| setTableId ( $id) | |
| Set the id of the \<table\> or outermost \<div\> element. | |
| setTitle ( $t) | |
| Set the title for form submission. | |
| setTokenSalt ( $salt) | |
| Set the salt for the edit token. | |
| setValidationErrorMessage ( $msg) | |
| Set a message to display on a validation error. | |
| setWrapperAttributes ( $attributes) | |
| For internal use only. | |
| setWrapperLegend ( $legend) | |
| Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element. | |
| setWrapperLegendMsg ( $msg) | |
| Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element. | |
| show () | |
| The here's-one-I-made-earlier option: do the submission if posted, or display the form with or without funky validation errors. | |
| showAlways () | |
| Same as self::show with the difference, that the form will be added to the output, no matter, if the validation was good or not. | |
| showCancel ( $show=true) | |
| Show a cancel button (or prevent it). | |
| suppressDefaultSubmit ( $suppressSubmit=true) | |
| Stop a default submit button being shown for this form. | |
| tryAuthorizedSubmit () | |
| Try submitting, with edit token check first. | |
| trySubmit () | |
| Validate all the fields, and call the submission callback function if everything is kosher. | |
| wasSubmitted () | |
| Test whether the form was considered to have been submitted or not, i.e. | |
| wrapForm ( $html) | |
| Wrap the form innards in an actual "<form>" element. | |
| Public Member Functions inherited from MediaWiki\Context\ContextSource | |
| canUseWikiPage () | |
| Check whether a WikiPage object can be get with getWikiPage(). | |
| exportSession () | |
| Export the resolved user IP, HTTP headers, user ID, and session ID. | |
| getActionName () | |
| Get the action name for the current web request. | |
| getAuthority () | |
| getConfig () | |
| getContext () | |
| Get the base IContextSource object. | |
| getCsrfTokenSet () | |
| Get a repository to obtain and match CSRF tokens. | |
| getLanguage () | |
| getLanguageCode () | |
| getOutput () | |
| getRequest () | |
| getSkin () | |
| getTiming () | |
| getUser () | |
| getWikiPage () | |
| Get the WikiPage object. | |
| msg ( $key,... $params) | |
| Get a Message object with context set Parameters are the same as wfMessage(). | |
| setContext (IContextSource $context) | |
Static Public Member Functions | |
| static | factory ( $displayFormat, $descriptor, IContextSource $context, $messagePrefix='') |
| Construct a HTMLForm object for given display type. | |
| static | getClassFromDescriptor ( $fieldname, &$descriptor) |
| Get the HTMLFormField subclass for this descriptor. | |
| static | loadInputFromParameters ( $fieldname, $descriptor, self $parent) |
| Initialise a new Object for the field. | |
Public Attributes | |
| array | $mFieldData |
Static Public Attributes | |
| static string[] | $typeMappings |
| A mapping of 'type' inputs onto standard HTMLFormField subclasses. | |
Protected Member Functions | |
| formatField (HTMLFormField $field, $value) | |
| Generate the HTML for an individual field in the current display format. | |
| formatSection (array $fieldsHtml, $sectionName, $anyFieldHasLabel) | |
| Put a form section together from the individual fields' HTML, merging it and wrapping. | |
| getCancelTargetURL () | |
| getFormAttributes () | |
| Get HTML attributes for the <form> tag. | |
| getMessage ( $value) | |
| Turns a *-message parameter (which could be a MessageSpecifier, or a message name, or a name + parameters array) into a Message. | |
| loadFieldData () | |
| Load data of form fields from the request. | |
| wrapFieldSetSection ( $legend, $section, $attributes, $isRoot) | |
| Wraps the given $section into a user-visible fieldset. | |
Protected Attributes | |
| array | $availableDisplayFormats |
| Available formats in which to display the form. | |
| array | $availableSubclassDisplayFormats |
| Available formats in which to display the form. | |
| string | $displayFormat = 'table' |
| Format in which to display form. | |
| string false | $mAction = false |
| Form action URL. | |
| string null | $mAutocomplete = null |
| Form attribute autocomplete. | |
| array[] | $mButtons = [] |
| LinkTarget string null | $mCancelTarget |
| bool | $mCollapsed = false |
| Whether the form is collapsed by default. | |
| bool | $mCollapsible = false |
| Whether the form can be collapsed. | |
| array | $mFieldTree = [] |
| HTMLFormField[] | $mFlatFields = [] |
| string | $mFooter = '' |
| string null | $mFormIdentifier |
| string | $mHeader = '' |
| array[] | $mHiddenFields = [] |
| string null | $mId |
| string | $mMessagePrefix |
| string | $mMethod = 'post' |
| string null | $mName |
| string | $mPost = '' |
| string | $mPre = '' |
| string[] | $mSectionFooters = [] |
| string[] | $mSectionHeaders = [] |
| array[] | $mSections = [] |
| Additional information about form sections. | |
| bool | $mShowCancel = false |
| bool | $mShowSubmit = true |
| bool | $mSingleForm = false |
| callable null | $mSubmitCallback |
| string[] | $mSubmitFlags = [ 'primary', 'progressive' ] |
| string null | $mSubmitID |
| bool bool | $mSubmitLockIcon = false |
| Whether a lock icon should be attached to the submit button. | |
| string null | $mSubmitName |
| string null | $mSubmitText |
| string null | $mSubmitTooltip |
| bool | $mSubSectionBeforeFields = true |
| If true, sections that contain both fields and subsections will render their subsections before their fields. | |
| string | $mTableId = '' |
| Title null | $mTitle |
| string array | $mTokenSalt = '' |
| Salt for the edit token. | |
| bool | $mUseMultipart = false |
| array[] | $mValidationErrorMessage |
| bool | $mWasSubmitted = false |
| array | $mWrapperAttributes = [] |
| string false | $mWrapperLegend = false |
Object handling generic submission, CSRF protection, layout and other logic for UI forms in a reusable manner.
In order to generate the form, the HTMLForm object takes an array structure detailing the form fields available. Each element of the array is a basic property-list, including the type of field, the label it is to be given in the form, callbacks for validation and 'filtering', and other pertinent information.
Field types are implemented as subclasses of the generic HTMLFormField object, and typically implement at least getInputHTML, which generates the HTML for the input field to be placed in the table.
You can find extensive documentation on the www.mediawiki.org wiki:
The constructor input is an associative array of $fieldname => $info, where $info is an Associative Array with any of the following:
'class' – the subclass of HTMLFormField that will be used to create the object. NOT the CSS class! 'type' – roughly translates into the <select> type attribute. if 'class' is not specified, this is used as a map through HTMLForm::$typeMappings to get the class name. 'default' – default value when the form is displayed 'nodata' – if set (to any value, which casts to true), the data for this field will not be loaded from the actual request. Instead, always the default data is set as the value of this field. 'id' – HTML id attribute 'cssclass' – CSS class 'csshelpclass' – CSS class used to style help text 'dir' – Direction of the element. 'options' – associative array mapping raw HTML labels to values. Some field types support multi-level arrays. Overwrites 'options-message'. 'options-messages' – associative array mapping message keys to values. Some field types support multi-level arrays. Overwrites 'options' and 'options-message'. 'options-messages-parse' – Flag to parse the messages in 'options-messages'. 'options-message' – message key or object to be parsed to extract the list of options (like 'ipbreason-dropdown'). 'label-message' – message key or object for a message to use as the label. can be an array of msg key and then parameters to the message. 'label' – alternatively, a raw text message. Overridden by label-message 'description-raw' – message text for a message to use as a description text. 'description-message' – message key or object for a message to use as a description text. can be an array of msg key and then parameters to the message. Overwrites 'description-messages' and 'description-raw'. 'description-messages'– array of message keys/objects. As above, each item can be an array of msg key and then parameters. Overwrites 'description-raw'. 'help-raw' – message text for a message to use as a help text. 'help-message' – message key or object for a message to use as a help text. can be an array of msg key and then parameters to the message. Overwrites 'help-messages' and 'help-raw'. 'help-messages' – array of message keys/objects. As above, each item can be an array of msg key and then parameters. Overwrites 'help-raw'. 'help-inline' – Whether help text (defined using options above) will be shown inline after the input field, rather than in a popup. Defaults to true. Only used by OOUI form fields. 'notices' – Array of plain text notices to display below the input field. Only used by OOUI form fields. 'required' – passed through to the object, indicating that it is a required field. 'show-optional-flag' – (Codex-only) adds an "(optional)" flag to the title to indicate that a field is not required. Must not have required=true. 'optional-message' – alternative message key to use for the flag shown with show-optional-flag 'size' – the length of text fields; (Codex-only) use large/medium/small for buttons 'filter-callback' – a function name to give you the chance to massage the inputted value before it's processed. See HTMLFormField::filter 'validation-callback' – a function name to give you the chance to impose extra validation on the field input. The signature should be as documented in HTMLFormField::$mValidationCallback. See HTMLFormField::validate 'name' – By default, the 'name' attribute of the input field is "wp{$fieldname}". If you want a different name (eg one without the "wp" prefix), specify it here and it will be used without modification. 'hide-if' – expression given as an array stating when the field should be hidden. The first array value has to be the expression's logic operator. Supported expressions: 'NOT' [ 'NOT', array $expression ] To hide a field if a given expression is not true. '===' [ '===', string $fieldName, string $value ] To hide a field if another field identified by $field has the value $value. '!==' [ '!==', string $fieldName, string $value ] Same as [ 'NOT', [ '===', $fieldName, $value ] 'OR', 'AND', 'NOR', 'NAND' [ 'XXX', array $expression1, ..., array $expressionN ] To hide a field if one or more (OR), all (AND), neither (NOR) or not all (NAND) given expressions are evaluated as true. The expressions will be given to a JavaScript frontend module which will continually update the field's visibility. 'disable-if' – expression given as an array stating when the field should be disabled. See 'hide-if' for supported expressions. The 'hide-if' logic would also disable fields, you don't need to set this attribute with the same condition manually. You can pass both 'disabled' and this attribute to omit extra check, but this would function only for not 'disabled' fields. 'hide-if-nojs', 'disable-if-nojs' – The 'hide-if' and 'disable-if' options documented above do not affect the initial HTML form rendering, to allow no-JavaScript users a full use of the form (even fields that would be initially hidden or disabled). If you want fields to be conditionally hidden or disabled in the initial HTML, requiring no-JS users to submit the form in order to access them, use these options instead. 'section' – A string name for the section of the form to which the field belongs. Subsections may be added using the separator '/', e.g.: 'section' => 'section1/subsection1' More levels may be added, e.g.: 'section' => 'section1/subsection2/subsubsection1' The message key for a section or subsection header is built from its name and the form's message prefix (if present).
Since 1.20, you can chain mutators to ease the form generation:
Definition at line 214 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::__construct | ( | $descriptor, | |
| IContextSource | $context, | ||
| $messagePrefix = '' ) |
Build a new HTMLForm from an array of field attributes.
| array | $descriptor | Array of Field constructs, as described in the class documentation |
| IContextSource | $context | Context used to fetch submitted form fields and generate localisation messages |
| string | $messagePrefix | A prefix to go in front of default messages |
Definition at line 485 of file HTMLForm.php.
References addFields(), and MediaWiki\Context\ContextSource\setContext().
| MediaWiki\HTMLForm\HTMLForm::addButton | ( | $data | ) |
Add a button to the form.
| array | $data | Data to define the button:
|
Definition at line 1154 of file HTMLForm.php.
Referenced by MediaWiki\Actions\McrUndoAction\alterForm(), and MediaWiki\Specials\SpecialBotPasswords\alterForm().
| MediaWiki\HTMLForm\HTMLForm::addFields | ( | $descriptor | ) |
Add fields to the form.
| array | $descriptor | Array of Field constructs, as described in the class documentation |
Reimplemented in MediaWiki\Specials\Forms\PreferencesFormOOUI.
Definition at line 502 of file HTMLForm.php.
Referenced by __construct(), and MediaWiki\Specials\SpecialWhatLinksHere\alterForm().
| MediaWiki\HTMLForm\HTMLForm::addFooterHtml | ( | $html, | |
| $section = null ) |
Add footer HTML, inside the form.
| string | $html | Complete text of message to display |
| string | null | $section | The section to add the footer text to |
Definition at line 988 of file HTMLForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct().
| MediaWiki\HTMLForm\HTMLForm::addHeaderHtml | ( | $html, | |
| $section = null ) |
Add HTML to the header, inside the form.
| string | $html | Additional HTML to display in header |
| string | null | $section | The section to add the header to |
Definition at line 937 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialBlock\alterForm(), MediaWiki\Specials\SpecialChangeEmail\alterForm(), MediaWiki\Specials\SpecialUserLogout\alterForm(), and MediaWiki\Specials\Forms\UploadForm\getDescriptionSection().
| MediaWiki\HTMLForm\HTMLForm::addHiddenField | ( | $name, | |
| $value, | |||
| array | $attribs = [] ) |
Add a hidden field to the output Array values are discarded for security reasons (per WebRequest::getVal).
| string | $name | Field name. This will be used exactly as entered |
| mixed | $value | Field value |
| array | $attribs |
Definition at line 1098 of file HTMLForm.php.
Referenced by MediaWiki\Actions\McrRestoreAction\addStatePropagationFields(), MediaWiki\Actions\McrUndoAction\addStatePropagationFields(), MediaWiki\Actions\MarkpatrolledAction\alterForm(), MediaWiki\Actions\RevertAction\alterForm(), and MediaWiki\Actions\RollbackAction\alterForm().
| MediaWiki\HTMLForm\HTMLForm::addHiddenFields | ( | array | $fields | ) |
Add an array of hidden fields to the output Array values are discarded for security reasons (per WebRequest::getVal).
| array | $fields | Associative array of fields to add; mapping names to their values |
Definition at line 1119 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialChangeEmail\alterForm(), MediaWiki\Specials\SpecialPasswordReset\alterForm(), and MediaWiki\Specials\SpecialUserLogout\alterForm().
| MediaWiki\HTMLForm\HTMLForm::addPostHtml | ( | $html | ) |
Add HTML to the end of the display.
| string | $html | Complete text of message to display |
Definition at line 1037 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialUnblock\execute().
| MediaWiki\HTMLForm\HTMLForm::addPreHtml | ( | $html | ) |
Add HTML to introductory message.
| string | $html | Complete HTML of message to display |
Definition at line 912 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::displayForm | ( | $submitResult | ) |
Display the form (sending to the context's OutputPage object), with an appropriate error message or stack of messages, and any validation errors, etc.
| bool | string | array | Status | $submitResult | Output from HTMLForm::trySubmit() |
Definition at line 1215 of file HTMLForm.php.
References getHTML(), and MediaWiki\Context\ContextSource\getOutput().
Referenced by show(), and showAlways().
| MediaWiki\HTMLForm\HTMLForm::displaySection | ( | $fields, | |
| $sectionName = '', | |||
| $fieldsetIDPrefix = '', | |||
| & | $hasUserVisibleFields = false ) |
Throws an exception when called on uninitialized field data, e.g. when HTMLForm::displayForm was called without calling HTMLForm::prepareForm first.
| array[] | HTMLFormField[] | $fields | Array of fields (either arrays or objects). |
| string | $sectionName | ID attribute of the "<table>" tag for this section, ignored if empty. |
| string | $fieldsetIDPrefix | ID prefix for the "<fieldset>" tag of each subsection, ignored if empty. |
| bool | &$hasUserVisibleFields | Whether the section had user-visible fields. |
Reimplemented in MediaWiki\Specials\Forms\EditWatchlistNormalHTMLForm.
Definition at line 1891 of file HTMLForm.php.
References displaySection(), formatField(), formatSection(), getFooterHtml(), getHeaderHtml(), getLegend(), and wrapFieldSetSection().
Referenced by displaySection(), and getBody().
|
static |
Construct a HTMLForm object for given display type.
May return a HTMLForm subclass.
| string | $displayFormat | |
| array | $descriptor | Array of Field constructs, as described in the class documentation |
| IContextSource | $context | Context used to fetch submitted form fields and generate localisation messages |
| string | $messagePrefix | A prefix to go in front of default messages |
Definition at line 459 of file HTMLForm.php.
References $displayFormat.
| MediaWiki\HTMLForm\HTMLForm::filterDataForSubmit | ( | $data | ) |
Overload this if you want to apply special filtration routines to the form as a whole, after it's submitted but before it's processed.
| array | $data |
Reimplemented in MediaWiki\Specials\Forms\PreferencesFormOOUI.
Definition at line 2089 of file HTMLForm.php.
Referenced by trySubmit().
| MediaWiki\HTMLForm\HTMLForm::formatErrors | ( | $errors | ) |
Format a stack of error messages into a single HTML string.
| array | $errors | Array of message keys/values |
Definition at line 1513 of file HTMLForm.php.
References getMessage().
Referenced by getErrorsOrWarnings().
|
protected |
Generate the HTML for an individual field in the current display format.
| HTMLFormField | $field | |
| mixed | $value |
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm, and MediaWiki\HTMLForm\OOUIHTMLForm.
Definition at line 1980 of file HTMLForm.php.
References $displayFormat, getDisplayFormat(), MediaWiki\HTMLForm\HTMLFormField\getDiv(), MediaWiki\HTMLForm\HTMLFormField\getInline(), MediaWiki\HTMLForm\HTMLFormField\getRaw(), and MediaWiki\HTMLForm\HTMLFormField\getTableRow().
Referenced by displaySection().
|
protected |
Put a form section together from the individual fields' HTML, merging it and wrapping.
| array | $fieldsHtml | Array of outputs from formatField() |
| string | $sectionName | |
| bool | $anyFieldHasLabel |
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm, and MediaWiki\HTMLForm\OOUIHTMLForm.
Definition at line 2004 of file HTMLForm.php.
References $displayFormat, and getDisplayFormat().
Referenced by displaySection().
| MediaWiki\HTMLForm\HTMLForm::getAction | ( | ) |
Get the value for the action attribute of the form.
Definition at line 2129 of file HTMLForm.php.
References MediaWiki\MainConfigNames\ArticlePath, MediaWiki\Context\ContextSource\getConfig(), getMethod(), getTitle(), and MediaWiki\MainConfigNames\Script.
Referenced by getFormAttributes().
| MediaWiki\HTMLForm\HTMLForm::getBody | ( | ) |
Get the whole body of the form.
Reimplemented in MediaWiki\HTMLForm\OOUIHTMLForm, and MediaWiki\Specials\Forms\PreferencesFormOOUI.
Definition at line 1459 of file HTMLForm.php.
References displaySection().
Referenced by getHTML().
| MediaWiki\HTMLForm\HTMLForm::getButtons | ( | ) |
Get the submit and (potentially) reset buttons.
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm, and MediaWiki\HTMLForm\OOUIHTMLForm.
Definition at line 1383 of file HTMLForm.php.
References MediaWiki\Html\element(), getCancelTargetURL(), getMessage(), getSubmitText(), and MediaWiki\Context\ContextSource\msg().
Referenced by getHTML().
|
protected |
Definition at line 1704 of file HTMLForm.php.
Referenced by MediaWiki\HTMLForm\CodexHTMLForm\getButtons(), getButtons(), and MediaWiki\HTMLForm\OOUIHTMLForm\getButtons().
|
static |
Get the HTMLFormField subclass for this descriptor.
The descriptor can be passed either 'class' which is the name of a HTMLFormField subclass, or a shorter 'type' which is an alias. This makes sure the 'class' is always set, and also is returned by this function for ease.
| string | $fieldname | Name of the field |
| array | &$descriptor | Input Descriptor, as described in the class documentation |
Definition at line 610 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::getDisplayFormat | ( | ) |
Getter for displayFormat.
Definition at line 590 of file HTMLForm.php.
References $displayFormat.
Referenced by formatField(), formatSection(), MediaWiki\HTMLForm\Field\HTMLCheckField\getLabel(), and setSections().
| MediaWiki\HTMLForm\HTMLForm::getErrorsOrWarnings | ( | $elements, | |
| $elementsType ) |
Returns a formatted list of errors or warnings from the given elements.
| string | array | Status | $elements | The set of errors/warnings to process. |
| string | $elementsType | Should warnings or errors be returned. This is meant for Status objects, all other valid types are always considered as errors. |
Reimplemented in MediaWiki\HTMLForm\OOUIHTMLForm.
Definition at line 1472 of file HTMLForm.php.
References formatErrors().
Referenced by getHTML().
| MediaWiki\HTMLForm\HTMLForm::getField | ( | $fieldname | ) |
| string | $fieldname |
| DomainException | on invalid field name |
Definition at line 544 of file HTMLForm.php.
References hasField().
| MediaWiki\HTMLForm\HTMLForm::getFooterHtml | ( | $section = null | ) |
Get footer HTML.
| string | null | $section | The section to get the footer text for |
Definition at line 1025 of file HTMLForm.php.
Referenced by displaySection(), and getHTML().
|
protected |
Get HTML attributes for the <form> tag.
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm.
Definition at line 1294 of file HTMLForm.php.
References getAction(), getMethod(), and needsJSForHtml5FormValidation().
Referenced by wrapForm(), and MediaWiki\HTMLForm\OOUIHTMLForm\wrapForm().
| MediaWiki\HTMLForm\HTMLForm::getHeaderHtml | ( | $section = null | ) |
Get header HTML.
| string | null | $section | The section to get the header text for |
Reimplemented in MediaWiki\HTMLForm\OOUIHTMLForm.
Definition at line 975 of file HTMLForm.php.
Referenced by displaySection(), and getHTML().
| MediaWiki\HTMLForm\HTMLForm::getHiddenFields | ( | ) |
Get the hidden fields that should go inside the form.
Definition at line 1350 of file HTMLForm.php.
References getMethod(), and MediaWiki\Context\ContextSource\getUser().
Referenced by getHTML().
| MediaWiki\HTMLForm\HTMLForm::getHTML | ( | $submitResult | ) |
Returns the raw HTML generated by the form.
| bool | string | array | Status | $submitResult | Output from HTMLForm::trySubmit() |
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm.
Definition at line 1247 of file HTMLForm.php.
References getBody(), getButtons(), getErrorsOrWarnings(), getFooterHtml(), getHeaderHtml(), getHiddenFields(), MediaWiki\Context\ContextSource\getOutput(), and wrapForm().
Referenced by displayForm().
| MediaWiki\HTMLForm\HTMLForm::getLegend | ( | $key | ) |
Get a string to go in the "<legend>" of a section fieldset.
Override this if you want something more complicated.
| string | $key |
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm, MediaWiki\Specials\Forms\EditWatchlistNormalHTMLForm, and MediaWiki\Specials\Forms\PreferencesFormOOUI.
Definition at line 2102 of file HTMLForm.php.
References MediaWiki\Context\ContextSource\msg().
Referenced by displaySection().
|
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 2170 of file HTMLForm.php.
References MediaWiki\Message\Message\newFromSpecifier().
Referenced by formatErrors(), MediaWiki\HTMLForm\CodexHTMLForm\getButtons(), getButtons(), MediaWiki\HTMLForm\OOUIHTMLForm\getButtons(), and MediaWiki\HTMLForm\OOUIHTMLForm\getErrorsOrWarnings().
| MediaWiki\HTMLForm\HTMLForm::getMethod | ( | ) |
Definition at line 1851 of file HTMLForm.php.
Referenced by getAction(), getFormAttributes(), getHiddenFields(), prepareForm(), and trySubmit().
| MediaWiki\HTMLForm\HTMLForm::getPostHtml | ( | ) |
Get HTML at the end of the display.
Definition at line 1063 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::getPreHtml | ( | ) |
Get the introductory message HTML.
Definition at line 924 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::getSubmitText | ( | ) |
Get the text for the submit button, either customised or a default.
Definition at line 1574 of file HTMLForm.php.
References MediaWiki\Context\ContextSource\msg().
Referenced by MediaWiki\HTMLForm\CodexHTMLForm\getButtons(), getButtons(), and MediaWiki\HTMLForm\OOUIHTMLForm\getButtons().
| MediaWiki\HTMLForm\HTMLForm::getTitle | ( | ) |
Reimplemented from MediaWiki\Context\ContextSource.
Definition at line 1831 of file HTMLForm.php.
References MediaWiki\Context\ContextSource\getContext().
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct(), MediaWiki\Specials\Forms\PreferencesFormOOUI\addFields(), getAction(), and MediaWiki\Preferences\DefaultPreferencesFactory\submitForm().
| MediaWiki\HTMLForm\HTMLForm::hasField | ( | $fieldname | ) |
| string | $fieldname |
Definition at line 535 of file HTMLForm.php.
Referenced by getField().
| MediaWiki\HTMLForm\HTMLForm::loadData | ( | ) |
Definition at line 2039 of file HTMLForm.php.
References prepareForm().
|
protected |
Load data of form fields from the request.
Definition at line 2046 of file HTMLForm.php.
References $request, and MediaWiki\Context\ContextSource\getRequest().
Referenced by prepareForm().
|
static |
Initialise a new Object for the field.
| string | $fieldname | Name of the field |
| array | $descriptor | Input Descriptor, as described in the class documentation |
| self | $parent | Parent instance of HTMLForm |
Definition at line 639 of file HTMLForm.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLFormFieldCloner\createFieldsForKey().
| MediaWiki\HTMLForm\HTMLForm::needsJSForHtml5FormValidation | ( | ) |
Whether this form, with its current fields, requires the user agent to have JavaScript enabled for the client-side HTML5 form validation to work correctly.
If this function returns true, a 'novalidate' attribute will be added on the <form> element. It will be removed if the user agent has JavaScript support, in htmlform.js.
Definition at line 2183 of file HTMLForm.php.
Referenced by getFormAttributes().
| MediaWiki\HTMLForm\HTMLForm::prepareForm | ( | ) |
Prepare form for submission.
Definition at line 659 of file HTMLForm.php.
References getMethod(), MediaWiki\Context\ContextSource\getRequest(), and loadFieldData().
Referenced by loadData(), show(), and showAlways().
| MediaWiki\HTMLForm\HTMLForm::requestIsAuthorized | ( | ) |
Return true if the http request passes identity and csrf checks.
Definition at line 694 of file HTMLForm.php.
References if.
Referenced by tryAuthorizedSubmit().
| MediaWiki\HTMLForm\HTMLForm::setAction | ( | $action | ) |
Set the value for the action attribute of the form.
When set to false (which is the default state), the set title is used.
| string | bool | $action |
Definition at line 2116 of file HTMLForm.php.
Referenced by MediaWiki\Actions\DeleteAction\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setAutocomplete | ( | $autocomplete | ) |
Set the value for the autocomplete attribute of the form.
A typical value is "off". When set to null (which is the default state), the attribute get not set.
| string | null | $autocomplete |
Definition at line 2158 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setCancelTarget | ( | $target | ) |
Sets the target where the user is redirected to after clicking cancel.
| LinkTarget | PageReference | string | $target | Target as an object or an URL |
Definition at line 1691 of file HTMLForm.php.
Referenced by MediaWiki\Actions\McrUndoAction\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setCollapsibleOptions | ( | $collapsedByDefault = false | ) |
Enable collapsible mode, and set whether the form is collapsed by default.
| bool | $collapsedByDefault | Whether the form is collapsed by default (optional). |
Definition at line 1283 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setDisplayFormat | ( | $format | ) |
Set format in which to display the form.
| string | $format | The name of the format to use, must be one of $this->availableDisplayFormats |
Definition at line 560 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setFooterHtml | ( | $html, | |
| $section = null ) |
Set footer HTML, inside the form.
| string | $html | Complete text of message to display |
| string | null | $section | The section to add the footer text to |
Definition at line 1008 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setFormIdentifier | ( | string | $ident, |
| bool | $single = false ) |
Set an internal identifier for this form.
It will be submitted as a hidden form field, allowing HTMLForm to determine whether the form was submitted (or merely viewed). Setting this serves two purposes:
| string | $ident | |
| bool | $single | Only work with GET form, see above. (since 1.41) |
Definition at line 1651 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialChangeContentModel\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setHeaderHtml | ( | $html, | |
| $section = null ) |
Set header HTML, inside the form.
| string | $html | Complete HTML of header to display |
| string | null | $section | The section to add the header to |
Definition at line 957 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialBlock\alterForm(), and MediaWiki\Specials\SpecialPasswordReset\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setId | ( | $id | ) |
| string | $id | DOM id for the form |
Definition at line 1734 of file HTMLForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct(), MediaWiki\Actions\McrUndoAction\alterForm(), MediaWiki\Specials\SpecialBlock\alterForm(), MediaWiki\Specials\SpecialBotPasswords\alterForm(), MediaWiki\Specials\SpecialChangeEmail\alterForm(), and MediaWiki\Specials\SpecialPageLanguage\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setMessagePrefix | ( | $p | ) |
Set the prefix for various default messages.
| string | $p |
Definition at line 1808 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setMethod | ( | $method = 'post' | ) |
Set the method used to submit the form.
| string | $method |
Definition at line 1842 of file HTMLForm.php.
Referenced by MediaWiki\Specials\Redirects\SpecialTalkPage\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setName | ( | $name | ) |
| string | $name | 'name' attribute for the form |
Definition at line 1744 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setPostHtml | ( | $html | ) |
Set HTML at the end of the display.
| string | $html | Complete text of message to display |
Definition at line 1051 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setPreHtml | ( | $html | ) |
Set the introductory message HTML, overwriting any existing message.
| string | $html | Complete HTML of message to display |
Definition at line 898 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setSections | ( | $sections | ) |
Set an array of information about sections.
| array[] | $sections | Array of section information, keyed on section name. |
Definition at line 1076 of file HTMLForm.php.
References getDisplayFormat().
| MediaWiki\HTMLForm\HTMLForm::setSubmitCallback | ( | $cb | ) |
Set a callback to a function to do something with the form once it's been successfully validated.
| callable | $cb | The function will be passed the output from HTMLForm::filterDataForSubmit and this HTMLForm object, and must return as documented for HTMLForm::trySubmit |
Definition at line 869 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setSubmitDestructive | ( | ) |
Identify that the submit button in the form has a destructive action.
Definition at line 1547 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialBlock\alterForm(), and MediaWiki\Specials\SpecialResetTokens\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setSubmitID | ( | $t | ) |
Set the id for the submit button.
| string | $t |
Definition at line 1608 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialChangeEmail\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setSubmitLockIcon | ( | ) |
Attach a "lock" OOUI icon to the submit button.
OOUI display mode only. Loads the icons-moderation styles module. Guard the call with your own reauth-required state.
For a hand-built OOUI button (not through HTMLForm), see DataStashTrait::getReauthLockButtonAttribs(). For a standalone icon not on a button, see DataStashTrait::getReauthLockOOUIIcon().
Definition at line 1626 of file HTMLForm.php.
References MediaWiki\Context\ContextSource\getOutput().
Referenced by MediaWiki\Specials\SpecialChangeContentModel\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setSubmitName | ( | $name | ) |
| string | $name | Submit button name |
Definition at line 1583 of file HTMLForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct(), and MediaWiki\Actions\McrUndoAction\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setSubmitText | ( | $t | ) |
Set the text for the submit button.
| string | $t | Plaintext |
Definition at line 1535 of file HTMLForm.php.
Referenced by setSubmitTextMsg().
| MediaWiki\HTMLForm\HTMLForm::setSubmitTextMsg | ( | $msg | ) |
Set the text for the submit button to a message.
| string | Message | $msg | Message key or Message object |
Definition at line 1561 of file HTMLForm.php.
References MediaWiki\Context\ContextSource\msg(), and setSubmitText().
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct(), MediaWiki\Actions\MarkpatrolledAction\alterForm(), MediaWiki\Actions\McrUndoAction\alterForm(), MediaWiki\Actions\PurgeAction\alterForm(), MediaWiki\Actions\RevertAction\alterForm(), MediaWiki\Actions\RollbackAction\alterForm(), MediaWiki\Actions\UnwatchAction\alterForm(), MediaWiki\Actions\WatchAction\alterForm(), MediaWiki\Specials\Redirects\SpecialTalkPage\alterForm(), MediaWiki\Specials\SpecialBlock\alterForm(), MediaWiki\Specials\SpecialChangeContentModel\alterForm(), MediaWiki\Specials\SpecialChangeEmail\alterForm(), MediaWiki\Specials\SpecialPasswordReset\alterForm(), MediaWiki\Specials\SpecialRandomInCategory\alterForm(), MediaWiki\Specials\SpecialRedirect\alterForm(), MediaWiki\Specials\SpecialResetTokens\alterForm(), and MediaWiki\Specials\SpecialUserLogout\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setSubmitTooltip | ( | $name | ) |
| string | $name | Tooltip for the submit button |
Definition at line 1594 of file HTMLForm.php.
Referenced by MediaWiki\Specials\Forms\UploadForm\__construct(), and MediaWiki\Actions\McrUndoAction\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setTableId | ( | $id | ) |
Set the id of the \<table\> or outermost \<div\> element.
| string | $id | New value of the id attribute, or "" to remove |
Definition at line 1723 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialBotPasswords\alterForm(), and MediaWiki\Specials\SpecialChangeEmail\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setTitle | ( | $t | ) |
Set the title for form submission.
| PageReference | $t | The page the form is on/should be posted to |
Definition at line 1821 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setTokenSalt | ( | $salt | ) |
Set the salt for the edit token.
Only useful when the method is "post".
| string | array | $salt | Salt to use |
Definition at line 1195 of file HTMLForm.php.
Referenced by MediaWiki\Actions\MarkpatrolledAction\alterForm(), MediaWiki\Actions\RevertAction\alterForm(), MediaWiki\Actions\RollbackAction\alterForm(), MediaWiki\Actions\WatchAction\alterForm(), and MediaWiki\Specials\SpecialUserLogout\alterForm().
| MediaWiki\HTMLForm\HTMLForm::setValidationErrorMessage | ( | $msg | ) |
Set a message to display on a validation error.
| array[] | $msg | Array of valid inputs to wfMessage() (so each entry must itself be an array of arguments) |
Definition at line 884 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setWrapperAttributes | ( | $attributes | ) |
For internal use only.
Use is discouraged, and should only be used where support for gadgets/user scripts is warranted.
| array | $attributes |
Definition at line 1775 of file HTMLForm.php.
| MediaWiki\HTMLForm\HTMLForm::setWrapperLegend | ( | $legend | ) |
Prompt the whole form to be wrapped in a "<fieldset>", with this text as its "<legend>" element.
| string | bool | $legend | If false, no wrapper or legend will be displayed. If true, a wrapper will be displayed, but no legend. If a string, a wrapper will be displayed with that string as a legend. The string will be escaped before being output (this doesn't support HTML). |
Definition at line 1762 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialLockdb\alterForm(), MediaWiki\Specials\SpecialUnlockdb\alterForm(), and setWrapperLegendMsg().
| MediaWiki\HTMLForm\HTMLForm::setWrapperLegendMsg | ( | $msg | ) |
Prompt the whole form to be wrapped in a "<fieldset>", with this message as its "<legend>" element.
| string | Message | $msg | Message key or Message object |
Definition at line 1790 of file HTMLForm.php.
References MediaWiki\Context\ContextSource\msg(), and setWrapperLegend().
Referenced by MediaWiki\Actions\McrRestoreAction\alterForm(), MediaWiki\Actions\McrUndoAction\alterForm(), MediaWiki\Actions\PurgeAction\alterForm(), MediaWiki\Actions\RevertAction\alterForm(), MediaWiki\Actions\RollbackAction\alterForm(), MediaWiki\Actions\UnwatchAction\alterForm(), MediaWiki\Actions\WatchAction\alterForm(), MediaWiki\Specials\SpecialBotPasswords\alterForm(), and MediaWiki\Specials\SpecialWhatLinksHere\alterForm().
| MediaWiki\HTMLForm\HTMLForm::show | ( | ) |
The here's-one-I-made-earlier option: do the submission if posted, or display the form with or without funky validation errors.
Reimplemented in MediaWiki\Specials\Forms\UploadForm.
Definition at line 727 of file HTMLForm.php.
References displayForm(), StatusValue\isGood(), prepareForm(), and tryAuthorizedSubmit().
Referenced by MediaWiki\Specials\SpecialUnblock\execute().
| MediaWiki\HTMLForm\HTMLForm::showAlways | ( | ) |
Same as self::show with the difference, that the form will be added to the output, no matter, if the validation was good or not.
Definition at line 745 of file HTMLForm.php.
References displayForm(), prepareForm(), and tryAuthorizedSubmit().
| MediaWiki\HTMLForm\HTMLForm::showCancel | ( | $show = true | ) |
Show a cancel button (or prevent it).
The button is not shown by default.
| bool | $show |
Definition at line 1680 of file HTMLForm.php.
Referenced by MediaWiki\Actions\McrUndoAction\alterForm().
| MediaWiki\HTMLForm\HTMLForm::suppressDefaultSubmit | ( | $suppressSubmit = true | ) |
Stop a default submit button being shown for this form.
This implies that an alternate submit method must be provided manually.
| bool | $suppressSubmit | Set to false to re-enable the button again |
Definition at line 1668 of file HTMLForm.php.
Referenced by MediaWiki\Specials\SpecialBotPasswords\alterForm(), MediaWiki\Specials\SpecialResetTokens\alterForm(), MediaWiki\Specials\Forms\PreferencesFormOOUI\setOptionsEditable(), and MediaWiki\Specials\Forms\PreferencesFormOOUI\setPrivateInfoEditable().
| MediaWiki\HTMLForm\HTMLForm::tryAuthorizedSubmit | ( | ) |
Try submitting, with edit token check first.
Definition at line 678 of file HTMLForm.php.
References requestIsAuthorized(), and trySubmit().
Referenced by show(), and showAlways().
| MediaWiki\HTMLForm\HTMLForm::trySubmit | ( | ) |
Validate all the fields, and call the submission callback function if everything is kosher.
Reimplemented in MediaWiki\Specials\Forms\UploadForm.
Definition at line 766 of file HTMLForm.php.
References filterDataForSubmit(), getMethod(), and MediaWiki\Context\ContextSource\getRequest().
Referenced by tryAuthorizedSubmit().
| MediaWiki\HTMLForm\HTMLForm::wasSubmitted | ( | ) |
Test whether the form was considered to have been submitted or not, i.e.
whether the last call to tryAuthorizedSubmit or trySubmit returned non-false.
This will return false until HTMLForm::tryAuthorizedSubmit or HTMLForm::trySubmit is called.
Definition at line 855 of file HTMLForm.php.
|
protected |
Wraps the given $section into a user-visible fieldset.
| string | $legend | Legend text for the fieldset |
| string | $section | The section content in plain Html |
| array | $attributes | Additional attributes for the fieldset |
| bool | $isRoot | Section is at the root of the tree |
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm, MediaWiki\HTMLForm\OOUIHTMLForm, and MediaWiki\Specials\Forms\PreferencesFormOOUI.
Definition at line 1865 of file HTMLForm.php.
References MediaWiki\Html\element().
Referenced by displaySection().
| MediaWiki\HTMLForm\HTMLForm::wrapForm | ( | $html | ) |
Wrap the form innards in an actual "<form>" element.
| string | $html | HTML contents to wrap. |
Reimplemented in MediaWiki\HTMLForm\CodexHTMLForm, MediaWiki\HTMLForm\OOUIHTMLForm, and MediaWiki\Specials\Forms\PreferencesFormOOUI.
Definition at line 1328 of file HTMLForm.php.
References MediaWiki\Html\element(), and getFormAttributes().
Referenced by getHTML().
|
protected |
Available formats in which to display the form.
Definition at line 424 of file HTMLForm.php.
|
protected |
Available formats in which to display the form.
Definition at line 435 of file HTMLForm.php.
|
protected |
Format in which to display form.
For viable options,
Definition at line 418 of file HTMLForm.php.
Referenced by factory(), formatField(), formatSection(), and getDisplayFormat().
|
protected |
Form action URL.
false means we will use the URL to set Title
Definition at line 342 of file HTMLForm.php.
|
protected |
Form attribute autocomplete.
A typical value is "off". null does not set the attribute
Definition at line 363 of file HTMLForm.php.
|
protected |
Definition at line 376 of file HTMLForm.php.
|
protected |
Definition at line 285 of file HTMLForm.php.
|
protected |
|
protected |
| array MediaWiki\HTMLForm\HTMLForm::$mFieldData |
Definition at line 269 of file HTMLForm.php.
|
protected |
Definition at line 277 of file HTMLForm.php.
|
protected |
Definition at line 275 of file HTMLForm.php.
|
protected |
Definition at line 300 of file HTMLForm.php.
|
protected |
Definition at line 326 of file HTMLForm.php.
|
protected |
Definition at line 298 of file HTMLForm.php.
|
protected |
Definition at line 371 of file HTMLForm.php.
|
protected |
Definition at line 308 of file HTMLForm.php.
|
protected |
Definition at line 272 of file HTMLForm.php.
|
protected |
Definition at line 333 of file HTMLForm.php.
|
protected |
Definition at line 310 of file HTMLForm.php.
|
protected |
Definition at line 306 of file HTMLForm.php.
|
protected |
Definition at line 296 of file HTMLForm.php.
|
protected |
Definition at line 304 of file HTMLForm.php.
|
protected |
Definition at line 302 of file HTMLForm.php.
|
protected |
Additional information about form sections.
Only supported by CodexHTMLForm.
Array is keyed on section name. Options per section include: 'description' – Description text placed below the section label. 'description-message' – The same, but a message key. 'description-message-parse' – Whether to parse the 'description-message' 'optional' – Whether the section should be marked as optional.
Definition at line 401 of file HTMLForm.php.
|
protected |
Definition at line 283 of file HTMLForm.php.
|
protected |
Definition at line 279 of file HTMLForm.php.
|
protected |
Definition at line 328 of file HTMLForm.php.
|
protected |
Definition at line 288 of file HTMLForm.php.
|
protected |
Definition at line 281 of file HTMLForm.php.
Referenced by MediaWiki\HTMLForm\CodexHTMLForm\getButtons(), and MediaWiki\HTMLForm\OOUIHTMLForm\getButtons().
|
protected |
Definition at line 315 of file HTMLForm.php.
Referenced by MediaWiki\HTMLForm\CodexHTMLForm\getButtons(), and MediaWiki\HTMLForm\OOUIHTMLForm\getButtons().
|
protected |
Whether a lock icon should be attached to the submit button.
Definition at line 323 of file HTMLForm.php.
|
protected |
Definition at line 317 of file HTMLForm.php.
Referenced by MediaWiki\HTMLForm\CodexHTMLForm\getButtons(), and MediaWiki\HTMLForm\OOUIHTMLForm\getButtons().
|
protected |
Definition at line 319 of file HTMLForm.php.
|
protected |
Definition at line 321 of file HTMLForm.php.
|
protected |
If true, sections that contain both fields and subsections will render their subsections before their fields.
Subclasses may set this to false to render subsections after fields instead.
Definition at line 411 of file HTMLForm.php.
|
protected |
Definition at line 312 of file HTMLForm.php.
|
protected |
Definition at line 331 of file HTMLForm.php.
|
protected |
Salt for the edit token.
Definition at line 387 of file HTMLForm.php.
|
protected |
Definition at line 366 of file HTMLForm.php.
|
protected |
Definition at line 293 of file HTMLForm.php.
|
protected |
Definition at line 335 of file HTMLForm.php.
|
protected |
Definition at line 381 of file HTMLForm.php.
|
protected |
Definition at line 379 of file HTMLForm.php.
|
static |
A mapping of 'type' inputs onto standard HTMLFormField subclasses.
Definition at line 218 of file HTMLForm.php.
Referenced by MediaWiki\HTMLForm\Field\HTMLExpiryField\getFieldByType().