<?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 {
* - 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
+ * or dropdown OR input
*/
public function __construct( array $config = [] ) {
// Configuration initialization
$config
);
+ if ( isset( $config['disabled'] ) && $config['disabled'] ) {
+ $config['textinput']['disabled'] = true;
+ $config['dropdowninput']['disabled'] = true;
+ }
+
parent::__construct( $config );
// Properties