MediaWiki REL1_37
|
Class for generating HTML <select> or <datalist> elements. More...
Public Member Functions | |
__construct ( $name=false, $id=false, $default=false) | |
addOption ( $label, $value=false) | |
addOptions ( $options) | |
This accepts an array of form label => value label => ( label => value, label => value ) | |
getAttribute ( $name) | |
getHTML () | |
setAttribute ( $name, $value) | |
setDefault ( $default) | |
setTagName ( $tagName) | |
Static Public Member Functions | |
static | formatOptions ( $options, $default=false) |
This accepts an array of form: label => value label => ( label => value, label => value ) | |
static | parseOptionsMessage (string $msg) |
Parse labels and values out of a comma- and colon-separated list of options, such as is used for expiry and duration lists. | |
Protected Attributes | |
$attributes = [] | |
$default = false | |
$options = [] | |
$tagName = 'select' | |
Class for generating HTML <select> or <datalist> elements.
Definition at line 26 of file XmlSelect.php.
XmlSelect::__construct | ( | $name = false , |
|
$id = false , |
|||
$default = false |
|||
) |
Definition at line 32 of file XmlSelect.php.
References $default, and setAttribute().
XmlSelect::addOption | ( | $label, | |
$value = false |
|||
) |
string | $label | |
string | false | $value | If not given, assumed equal to $label |
Definition at line 80 of file XmlSelect.php.
XmlSelect::addOptions | ( | $options | ) |
This accepts an array of form label => value label => ( label => value, label => value )
array | $options |
Definition at line 92 of file XmlSelect.php.
References $options.
|
static |
This accepts an array of form: label => value label => ( label => value, label => value )
array | $options | |
string | array | false | $default |
Definition at line 105 of file XmlSelect.php.
References $default, $options, and formatOptions().
Referenced by formatOptions(), and getHTML().
XmlSelect::getAttribute | ( | $name | ) |
XmlSelect::getHTML | ( | ) |
Definition at line 127 of file XmlSelect.php.
References $options, and formatOptions().
|
static |
Parse labels and values out of a comma- and colon-separated list of options, such as is used for expiry and duration lists.
Documentation of the format is on translatewiki.net.
Definition at line 146 of file XmlSelect.php.
References $options.
Referenced by ProtectionForm\buildForm(), SpecialBlock\getSuggestedDurations(), and UserrightsPage\groupCheckboxes().
XmlSelect::setAttribute | ( | $name, | |
$value | |||
) |
string | $name | |
string | $value |
Definition at line 64 of file XmlSelect.php.
Referenced by __construct(), and UserrightsPage\groupCheckboxes().
XmlSelect::setDefault | ( | $default | ) |
XmlSelect::setTagName | ( | $tagName | ) |
|
protected |
Definition at line 30 of file XmlSelect.php.
|
protected |
Definition at line 28 of file XmlSelect.php.
Referenced by __construct(), formatOptions(), and setDefault().
|
protected |
Definition at line 27 of file XmlSelect.php.
Referenced by addOptions(), formatOptions(), getHTML(), and parseOptionsMessage().
|
protected |
Definition at line 29 of file XmlSelect.php.
Referenced by setTagName().