diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/htmlform/HTMLSelectField.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
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 ); + } } |