21 if (
isset( $this->mParams[
'disabled-options'] ) ===
false ) {
22 $this->mParams[
'disabled-options'] = [];
26 $this->mClass .=
' mw-htmlform-dropdown';
30 $this->mClass .=
' mw-htmlform-flatlist';
35 $p = parent::validate(
$value, $alldata );
45 # If all options are valid, array_intersect of the valid options
46 # and the provided options will return the provided options.
50 if ( count( $validValues ) == count(
$value ) ) {
53 return $this->
msg(
'htmlform-select-badoption' );
58 if (
isset( $this->mParams[
'dropdown'] ) ) {
59 $this->mParent->getOutput()->addModules(
'jquery.chosen' );
73 foreach (
$options as $label => $info ) {
75 $html .= Html::rawElement(
'h1', [], $label ) .
"\n";
79 'id' =>
"{$this->mID}-$info",
82 if (
in_array( $info, $this->mParams[
'disabled-options'],
true ) ) {
83 $thisAttribs[
'disabled'] =
'disabled';
89 $html .=
' ' . Html::rawElement(
91 [
'class' =>
'mw-htmlform-flatlist-item' ],
102 throw new MWException(
'HTMLMultiSelectField#getOneCheckbox() is not supported' );
104 $elementFunc = [ Html::class, $this->mOptionsLabelsNotFromMessage ?
'rawElement' :
'element' ];
106 Xml::check(
"{$this->mName}[]", $checked,
$attribs ) .
113 if ( $this->mParent->getConfig()->get(
'UseMediaWikiUIEverywhere' ) ) {
114 $checkbox = Html::openElement(
'div', [
'class' =>
'mw-ui-checkbox' ] ) .
116 Html::closeElement(
'div' );
128 throw new MWException(
'HTMLMultiSelectField#getOptionsOOUI() is not supported' );
142 $this->mParent->getOutput()->addModules(
'oojs-ui-widgets' );
144 $hasSections =
false;
145 $optionsOouiSections = [];
151 $optionsOouiSections[ $label ] = Xml::listDropDownOptionsOoui(
$section );
160 [
'' => Xml::listDropDownOptionsOoui(
$options ) ],
166 foreach ( $optionsOouiSections as $sectionLabel => $optionsOoui ) {
168 $attr[
'name'] =
"{$this->mName}[]";
173 foreach ( $attr[
'options'] as &$option ) {
174 $option[
'disabled'] =
in_array( $option[
'data'], $this->mParams[
'disabled-options'],
true );
176 if ( $this->mOptionsLabelsNotFromMessage ) {
177 foreach ( $attr[
'options'] as &$option ) {
182 $attr += OOUI\Element::configFromHtmlAttributes(
186 if ( $this->mClass !==
'' ) {
191 if ( $sectionLabel ) {
193 'items' => [ $widget ],
201 if ( !$hasSections ) {
207 return implode(
'',
$out );
216 $fromRequest =
$request->getArray( $this->mName, [] );
231 return $this->mDefault ?? [];
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
validate( $value, $alldata)
Override this function to add specific validation checks on the field input.
needsLabel()
Should this field have a label, or is there no input element with the appropriate id for the label to...
getOneCheckbox( $checked, $attribs, $label)
filterDataForSubmit( $data)
Support for separating multi-option preferences into multiple preferences Due to lack of array suppor...
getInputHTML( $value)
This function must be implemented to return the HTML to generate the input object itself.
getInputOOUI( $value)
Get the OOUI version of this field.
formatOptions( $options, $value)
getOptionsOOUI()
Get options and make them into arrays suitable for OOUI.
loadDataFromRequest( $request)
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that When $user is not it can be in the form of< username >< more info > e g for bot passwords intended to be added to log contexts Fields it might only if the login was with a bot password it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped & $options
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
$data
Utility to generate mapping file used in mw.Title (phpCharToUpper.json)