diff options
Diffstat (limited to 'includes/htmlform/HTMLSelectField.php')
-rw-r--r-- | includes/htmlform/HTMLSelectField.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/includes/htmlform/HTMLSelectField.php b/includes/htmlform/HTMLSelectField.php index a198037a..6ba69666 100644 --- a/includes/htmlform/HTMLSelectField.php +++ b/includes/htmlform/HTMLSelectField.php @@ -41,4 +41,26 @@ class HTMLSelectField extends HTMLFormField { return $select->getHTML(); } + + function getInputOOUI( $value ) { + $disabled = false; + $allowedParams = array( 'tabindex' ); + $attribs = $this->getAttributes( $allowedParams, array( 'tabindex' => 'tabIndex' ) ); + + if ( $this->mClass !== '' ) { + $attribs['classes'] = array( $this->mClass ); + } + + if ( !empty( $this->mParams['disabled'] ) ) { + $disabled = true; + } + + return new OOUI\DropdownInputWidget( array( + 'name' => $this->mName, + 'id' => $this->mID, + 'options' => $this->getOptionsOOUI(), + 'value' => strval( $value ), + 'disabled' => $disabled, + ) + $attribs ); + } } |