Merge "Prefill username in form when calling Special:Log/<username>"
[lhc/web/wiklou.git] / includes / widget / SelectWithInputWidget.php
index 994906a..262903d 100644 (file)
@@ -1,17 +1,15 @@
 <?php
-/**
- * MediaWiki Widgets – SelectWithInputWidget class.
- *
- * @copyright 2011-2017 MediaWiki Widgets Team and others; see AUTHORS.txt
- * @license The MIT License (MIT); see LICENSE.txt
- */
+
 namespace MediaWiki\Widget;
 
-use \OOUI\TextInputWidget;
-use \OOUI\DropdownInputWidget;
+use OOUI\DropdownInputWidget;
+use OOUI\TextInputWidget;
 
 /**
  * Select and input widget.
+ *
+ * @copyright 2011-2017 MediaWiki Widgets Team and others; see AUTHORS.txt
+ * @license MIT
  */
 class SelectWithInputWidget extends \OOUI\Widget {
 
@@ -38,6 +36,11 @@ class SelectWithInputWidget extends \OOUI\Widget {
                        $config
                );
 
+               if ( isset( $config['disabled'] ) && $config['disabled'] == true ) {
+                       $config['textinput']['disabled'] = true;
+                       $config['dropdowninput']['disabled'] = true;
+               }
+
                parent::__construct( $config );
 
                // Properties