summaryrefslogtreecommitdiff
path: root/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
committerPierre Schmitz <pierre@archlinux.de>2015-12-20 09:00:55 +0100
commita2190ac74dd4d7080b12bab90e552d7aa81209ef (patch)
tree8b31f38de9882d18df54cf8d9e0de74167a094eb /vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
parent15e69f7b20b6596b9148030acce5b59993b95a45 (diff)
parent257401d8b2cf661adf36c84b0e3fd1cf85e33c22 (diff)
Merge branch 'mw-1.26'
Diffstat (limited to 'vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php')
-rw-r--r--vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php b/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
index ae541a66..f8ea48a3 100644
--- a/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
+++ b/vendor/oojs/oojs-ui/php/widgets/DropdownInputWidget.php
@@ -23,6 +23,10 @@ class DropdownInputWidget extends InputWidget {
// Parent constructor
parent::__construct( $config );
+ // Mixins
+ $this->mixin( new TitledElement( $this,
+ array_merge( $config, array( 'titled' => $this->input ) ) ) );
+
// Initialization
$this->setOptions( isset( $config['options'] ) ? $config['options'] : array() );
$this->addClasses( array( 'oo-ui-dropdownInputWidget' ) );
@@ -60,11 +64,12 @@ class DropdownInputWidget extends InputWidget {
// Rebuild the dropdown menu
$this->input->clearContent();
foreach ( $options as $opt ) {
+ $optValue = $this->cleanUpValue( $opt['data'] );
$option = new Tag( 'option' );
- $option->setAttributes( array( 'value' => $opt['data'] ) );
- $option->appendContent( isset( $opt['label'] ) ? $opt['label'] : $opt['data'] );
+ $option->setAttributes( array( 'value' => $optValue ) );
+ $option->appendContent( isset( $opt['label'] ) ? $opt['label'] : $optValue );
- if ( $value === $opt['data'] ) {
+ if ( $value === $optValue ) {
$isValueAvailable = true;
}