2013-11-19 12:55:50 +00:00
|
|
|
<?php
|
2013-11-19 13:08:16 +00:00
|
|
|
|
2024-02-08 15:30:18 +00:00
|
|
|
namespace MediaWiki\HTMLForm\Field;
|
|
|
|
|
|
2023-02-16 19:27:21 +00:00
|
|
|
use MediaWiki\Html\Html;
|
2024-02-08 15:30:18 +00:00
|
|
|
use MediaWiki\HTMLForm\HTMLFormField;
|
2023-09-07 11:46:15 +00:00
|
|
|
use MediaWiki\Request\WebRequest;
|
2024-05-16 10:52:03 +00:00
|
|
|
use MediaWiki\Xml\XmlSelect;
|
2023-02-16 19:27:21 +00:00
|
|
|
|
2013-11-19 12:55:50 +00:00
|
|
|
/**
|
|
|
|
|
* Select dropdown field, with an additional "other" textbox.
|
2015-11-08 15:21:58 +00:00
|
|
|
*
|
|
|
|
|
* HTMLComboboxField implements the same functionality using a single form field
|
|
|
|
|
* and should be used instead.
|
2020-07-10 19:23:59 +00:00
|
|
|
*
|
|
|
|
|
* @stable to extend
|
2013-11-19 12:55:50 +00:00
|
|
|
*/
|
|
|
|
|
class HTMLSelectOrOtherField extends HTMLTextField {
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
private const FIELD_CLASS = 'mw-htmlform-select-or-other';
|
2020-07-10 19:23:59 +00:00
|
|
|
|
2020-07-23 09:41:58 +00:00
|
|
|
/**
|
2020-07-10 19:23:59 +00:00
|
|
|
* @stable to call
|
2020-07-23 09:41:58 +00:00
|
|
|
* @inheritDoc
|
2020-07-10 19:23:59 +00:00
|
|
|
*/
|
2016-11-04 10:40:42 +00:00
|
|
|
public function __construct( $params ) {
|
2014-02-18 20:28:06 +00:00
|
|
|
parent::__construct( $params );
|
|
|
|
|
$this->getOptions();
|
|
|
|
|
if ( !in_array( 'other', $this->mOptions, true ) ) {
|
2013-11-19 13:08:16 +00:00
|
|
|
$msg =
|
2017-10-06 22:17:58 +00:00
|
|
|
$params['other'] ?? wfMessage( 'htmlform-selectorother-other' )->text();
|
2014-04-10 15:31:25 +00:00
|
|
|
// Have 'other' always as first element
|
2016-02-17 09:09:32 +00:00
|
|
|
$this->mOptions = [ $msg => 'other' ] + $this->mOptions;
|
2013-11-19 12:55:50 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-04 10:40:42 +00:00
|
|
|
public function getInputHTML( $value ) {
|
2013-11-19 12:55:50 +00:00
|
|
|
$valInSelect = false;
|
|
|
|
|
|
|
|
|
|
if ( $value !== false ) {
|
2014-03-05 20:15:41 +00:00
|
|
|
$value = strval( $value );
|
|
|
|
|
$valInSelect = in_array(
|
|
|
|
|
$value, HTMLFormField::flattenOptions( $this->getOptions() ), true
|
|
|
|
|
);
|
2013-11-19 12:55:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$selected = $valInSelect ? $value : 'other';
|
|
|
|
|
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
$select = new XmlSelect( $this->mName, false, $selected );
|
2014-02-18 20:28:06 +00:00
|
|
|
$select->addOptions( $this->getOptions() );
|
2013-11-19 12:55:50 +00:00
|
|
|
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
$tbAttribs = [ 'size' => $this->getSize() ];
|
2013-11-19 12:55:50 +00:00
|
|
|
|
2013-11-19 13:08:16 +00:00
|
|
|
if ( !empty( $this->mParams['disabled'] ) ) {
|
2013-11-19 12:55:50 +00:00
|
|
|
$select->setAttribute( 'disabled', 'disabled' );
|
2013-11-19 13:08:16 +00:00
|
|
|
$tbAttribs['disabled'] = 'disabled';
|
2013-11-19 12:55:50 +00:00
|
|
|
}
|
|
|
|
|
|
2013-05-02 18:27:44 +00:00
|
|
|
if ( isset( $this->mParams['tabindex'] ) ) {
|
|
|
|
|
$select->setAttribute( 'tabindex', $this->mParams['tabindex'] );
|
|
|
|
|
$tbAttribs['tabindex'] = $this->mParams['tabindex'];
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 12:55:50 +00:00
|
|
|
$select = $select->getHTML();
|
|
|
|
|
|
2013-11-19 13:08:16 +00:00
|
|
|
if ( isset( $this->mParams['maxlength'] ) ) {
|
|
|
|
|
$tbAttribs['maxlength'] = $this->mParams['maxlength'];
|
2013-11-19 12:55:50 +00:00
|
|
|
}
|
|
|
|
|
|
2022-12-07 20:42:39 +00:00
|
|
|
if ( isset( $this->mParams['minlength'] ) ) {
|
|
|
|
|
$tbAttribs['minlength'] = $this->mParams['minlength'];
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 12:55:50 +00:00
|
|
|
$textbox = Html::input( $this->mName . '-other', $valInSelect ? '' : $value, 'text', $tbAttribs );
|
|
|
|
|
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
$wrapperAttribs = [
|
|
|
|
|
'id' => $this->mID,
|
2022-06-03 16:21:38 +00:00
|
|
|
'class' => $this->getFieldClasses()
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
];
|
|
|
|
|
if ( $this->mClass !== '' ) {
|
2022-06-03 16:21:38 +00:00
|
|
|
$wrapperAttribs['class'][] = $this->mClass;
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
}
|
|
|
|
|
return Html::rawElement(
|
|
|
|
|
'div',
|
|
|
|
|
$wrapperAttribs,
|
|
|
|
|
"$select<br />\n$textbox"
|
|
|
|
|
);
|
2013-11-19 12:55:50 +00:00
|
|
|
}
|
|
|
|
|
|
2017-06-05 12:13:14 +00:00
|
|
|
protected function shouldInfuseOOUI() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function getOOUIModules() {
|
|
|
|
|
return [ 'mediawiki.widgets.SelectWithInputWidget' ];
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-04 10:40:42 +00:00
|
|
|
public function getInputOOUI( $value ) {
|
2017-06-05 12:13:14 +00:00
|
|
|
$this->mParent->getOutput()->addModuleStyles( 'mediawiki.widgets.SelectWithInputWidget.styles' );
|
|
|
|
|
|
|
|
|
|
$valInSelect = false;
|
|
|
|
|
if ( $value !== false ) {
|
|
|
|
|
$value = strval( $value );
|
|
|
|
|
$valInSelect = in_array(
|
|
|
|
|
$value, HTMLFormField::flattenOptions( $this->getOptions() ), true
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# DropdownInput
|
|
|
|
|
$dropdownAttribs = [
|
|
|
|
|
'name' => $this->mName,
|
|
|
|
|
'options' => $this->getOptionsOOUI(),
|
|
|
|
|
'value' => $valInSelect ? $value : 'other',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$allowedParams = [
|
|
|
|
|
'disabled',
|
|
|
|
|
'tabindex',
|
|
|
|
|
];
|
|
|
|
|
|
2024-02-08 15:30:18 +00:00
|
|
|
$dropdownAttribs += \OOUI\Element::configFromHtmlAttributes(
|
2017-06-05 12:13:14 +00:00
|
|
|
$this->getAttributes( $allowedParams )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
# TextInput
|
|
|
|
|
$textAttribs = [
|
|
|
|
|
'name' => $this->mName . '-other',
|
|
|
|
|
'size' => $this->getSize(),
|
|
|
|
|
'value' => $valInSelect ? '' : $value,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
$allowedParams = [
|
|
|
|
|
'required',
|
|
|
|
|
'autofocus',
|
|
|
|
|
'multiple',
|
|
|
|
|
'disabled',
|
|
|
|
|
'tabindex',
|
|
|
|
|
'maxlength',
|
2022-12-07 20:42:39 +00:00
|
|
|
'minlength',
|
2017-06-05 12:13:14 +00:00
|
|
|
];
|
|
|
|
|
|
2024-02-08 15:30:18 +00:00
|
|
|
$textAttribs += \OOUI\Element::configFromHtmlAttributes(
|
2017-06-05 12:13:14 +00:00
|
|
|
$this->getAttributes( $allowedParams )
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if ( $this->mPlaceholder !== '' ) {
|
|
|
|
|
$textAttribs['placeholder'] = $this->mPlaceholder;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-25 05:29:03 +00:00
|
|
|
$disabled = false;
|
|
|
|
|
if ( isset( $this->mParams[ 'disabled' ] ) && $this->mParams[ 'disabled' ] ) {
|
|
|
|
|
$disabled = true;
|
|
|
|
|
}
|
|
|
|
|
|
2022-06-03 16:21:38 +00:00
|
|
|
$inputClasses = $this->getFieldClasses();
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
if ( $this->mClass !== '' ) {
|
|
|
|
|
$inputClasses = array_merge( $inputClasses, explode( ' ', $this->mClass ) );
|
|
|
|
|
}
|
2017-06-05 12:13:14 +00:00
|
|
|
return $this->getInputWidget( [
|
2017-09-25 18:49:51 +00:00
|
|
|
'id' => $this->mID,
|
Apply ID and class more consistently in HTMLSelect(Or|And)OtherField
There were several inconsistencies in how ID vs cssclass vs own classes
were applied, both within the same widget + mode, between different
modes for the same widget, and different widgets. So uniform all of them
according to the plan detailed on phabricator. Include
HTMLSelectAndOtherField as well (that wasn't mentioned on phab) for
consistency. Also remove the select-or-other class from
HTMLAutoCompleteSelectField (which was only applied in HTML mode), since
the widget is not technically a SelectOrOther.
Adjust the logic in selectorother.js so that it works fine in HTML mode,
and disable it for OOUI mode since SelectWithInputWidget does that
already (and the field is autoinfused).
Also, in HTMLAutoCompleteSelectField, don't assign an array to
$this->mClass. This happens to be working right now, but it violates the
type definition of the property.
Luckily, according to codesearch this change seems to be
backwards-compatible because these fields are not commonly used, and
nobody seems to be passing cssclass to them.
Bug: T309883
Change-Id: If950f131d1c4bc1645de6021781045dccfc61966
2022-06-06 13:30:53 +00:00
|
|
|
'classes' => $inputClasses,
|
2018-07-25 05:29:03 +00:00
|
|
|
'disabled' => $disabled,
|
2017-06-05 12:13:14 +00:00
|
|
|
'textinput' => $textAttribs,
|
|
|
|
|
'dropdowninput' => $dropdownAttribs,
|
2019-07-22 22:53:14 +00:00
|
|
|
'required' => $this->mParams[ 'required' ] ?? false,
|
2017-06-05 12:13:14 +00:00
|
|
|
'or' => true,
|
|
|
|
|
] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getInputWidget( $params ) {
|
2024-02-08 15:30:18 +00:00
|
|
|
return new \MediaWiki\Widget\SelectWithInputWidget( $params );
|
2015-07-26 23:22:56 +00:00
|
|
|
}
|
|
|
|
|
|
2024-03-12 20:44:35 +00:00
|
|
|
public function getInputCodex( $value, $hasErrors ) {
|
|
|
|
|
// Figure out the value of the select.
|
|
|
|
|
$valInSelect = false;
|
|
|
|
|
if ( $value !== false ) {
|
|
|
|
|
$value = strval( $value );
|
|
|
|
|
$valInSelect = in_array(
|
|
|
|
|
$value, HTMLFormField::flattenOptions( $this->getOptions() ), true
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
$selected = $valInSelect ? $value : 'other';
|
|
|
|
|
|
|
|
|
|
// Create the <select> element.
|
|
|
|
|
$select = new XmlSelect( $this->mName, false, $selected );
|
|
|
|
|
// TODO: Add support for error class once it's implemented in the Codex CSS-only Select.
|
|
|
|
|
$select->setAttribute( 'class', 'cdx-select' );
|
|
|
|
|
$select->addOptions( $this->getOptions() );
|
|
|
|
|
|
|
|
|
|
// Set up attributes for the select and the text input.
|
|
|
|
|
$textInputAttribs = [ 'size' => $this->getSize() ];
|
|
|
|
|
$textInputAttribs['name'] = $this->mName . '-other';
|
|
|
|
|
|
|
|
|
|
if ( !empty( $this->mParams['disabled'] ) ) {
|
|
|
|
|
$select->setAttribute( 'disabled', 'disabled' );
|
|
|
|
|
$textInputAttribs['disabled'] = 'disabled';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $this->mParams['tabindex'] ) ) {
|
|
|
|
|
$select->setAttribute( 'tabindex', $this->mParams['tabindex'] );
|
|
|
|
|
$textInputAttribs['tabindex'] = $this->mParams['tabindex'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $this->mParams['maxlength'] ) ) {
|
|
|
|
|
$textInputAttribs['maxlength'] = $this->mParams['maxlength'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( isset( $this->mParams['minlength'] ) ) {
|
|
|
|
|
$textInputAttribs['minlength'] = $this->mParams['minlength'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Get HTML of the select and text input.
|
|
|
|
|
$select = $select->getHTML();
|
|
|
|
|
$textInput = parent::buildCodexComponent(
|
|
|
|
|
$valInSelect ? '' : $value,
|
|
|
|
|
$hasErrors,
|
|
|
|
|
'text',
|
|
|
|
|
$this->mName . '-other',
|
|
|
|
|
$textInputAttribs
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Set up the wrapper element and return the entire component.
|
|
|
|
|
$wrapperAttribs = [
|
|
|
|
|
'id' => $this->mID,
|
|
|
|
|
'class' => $this->getFieldClasses()
|
|
|
|
|
];
|
|
|
|
|
if ( $this->mClass !== '' ) {
|
|
|
|
|
$wrapperAttribs['class'][] = $this->mClass;
|
|
|
|
|
}
|
|
|
|
|
return Html::rawElement(
|
|
|
|
|
'div',
|
|
|
|
|
$wrapperAttribs,
|
2024-04-05 01:49:05 +00:00
|
|
|
"$select\n$textInput"
|
2024-03-12 20:44:35 +00:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-19 12:55:50 +00:00
|
|
|
/**
|
2014-04-20 21:33:05 +00:00
|
|
|
* @param WebRequest $request
|
2013-11-19 12:55:50 +00:00
|
|
|
*
|
2014-04-20 21:33:05 +00:00
|
|
|
* @return string
|
2013-11-19 12:55:50 +00:00
|
|
|
*/
|
2016-11-04 10:40:42 +00:00
|
|
|
public function loadDataFromRequest( $request ) {
|
2013-11-19 12:55:50 +00:00
|
|
|
if ( $request->getCheck( $this->mName ) ) {
|
|
|
|
|
$val = $request->getText( $this->mName );
|
|
|
|
|
|
2014-03-05 20:15:41 +00:00
|
|
|
if ( $val === 'other' ) {
|
2013-11-19 12:55:50 +00:00
|
|
|
$val = $request->getText( $this->mName . '-other' );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $val;
|
|
|
|
|
} else {
|
|
|
|
|
return $this->getDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-03 16:21:38 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Returns a list of classes that should be applied to the widget itself. Unfortunately, we can't use
|
|
|
|
|
* $this->mClass or the 'cssclass' config option, because they're also added to the outer field wrapper
|
|
|
|
|
* (which includes the label). This method exists a temporary workaround until HTMLFormField will have
|
|
|
|
|
* a stable way for subclasses to specify additional classes for the widget itself.
|
|
|
|
|
* @internal Should only be used in HTMLTimezoneField
|
|
|
|
|
* @return string[]
|
|
|
|
|
*/
|
|
|
|
|
protected function getFieldClasses(): array {
|
|
|
|
|
return [ self::FIELD_CLASS ];
|
|
|
|
|
}
|
2013-11-19 13:08:16 +00:00
|
|
|
}
|
2024-02-08 15:30:18 +00:00
|
|
|
|
2024-03-07 21:56:58 +00:00
|
|
|
/** @deprecated class alias since 1.42 */
|
2024-02-08 15:30:18 +00:00
|
|
|
class_alias( HTMLSelectOrOtherField::class, 'HTMLSelectOrOtherField' );
|