X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/includes/widget/SelectWithInputWidget.php diff --git a/includes/widget/SelectWithInputWidget.php b/includes/widget/SelectWithInputWidget.php new file mode 100644 index 00000000..d2dda75e --- /dev/null +++ b/includes/widget/SelectWithInputWidget.php @@ -0,0 +1,65 @@ + [], + 'dropdowninput' => [], + 'or' => false + ], + $config + ); + + // Parent constructor + parent::__construct( $config ); + + // Properties + $this->config = $config; + $this->textinput = new TextInputWidget( $config['textinput'] ); + $this->dropdowninput = new DropdownInputWidget( $config['dropdowninput'] ); + + // Initialization + $this + ->addClasses( [ 'mw-widget-selectWithInputWidget' ] ) + ->appendContent( $this->dropdowninput, $this->textinput ); + } + + protected function getJavaScriptClassName() { + return 'mw.widgets.SelectWithInputWidget'; + } + + public function getConfig( &$config ) { + $config['textinput'] = $this->config['textinput']; + $config['dropdowninput'] = $this->config['dropdowninput']; + $config['or'] = $this->config['or']; + return parent::getConfig( $config ); + } +}