<?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 {
* A version of the SelectWithInputWidget, with `or` set to true.
*
* @param array $config Configuration options
- * @param array $config['textinput'] Configuration for the TextInputWidget
- * @param array $config['dropdowninput'] Configuration for the DropdownInputWidget
- * @param bool $config['or'] Configuration for whether the widget is dropdown AND input
+ * - array $config['textinput'] Configuration for the TextInputWidget
+ * - array $config['dropdowninput'] Configuration for the DropdownInputWidget
+ * - bool $config['or'] Configuration for whether the widget is dropdown AND input
* or dropdown OR input
*/
public function __construct( array $config = [] ) {
$config
);
+ if ( isset( $config['disabled'] ) && $config['disabled'] == true ) {
+ $config['textinput']['disabled'] = true;
+ $config['dropdowninput']['disabled'] = true;
+ }
+
parent::__construct( $config );
// Properties
public function getConfig( &$config ) {
$config['textinput'] = $this->config['textinput'];
$config['dropdowninput'] = $this->config['dropdowninput'];
+ $config['dropdowninput']['dropdown']['$overlay'] = true;
$config['or'] = $this->config['or'];
return parent::getConfig( $config );
}