titlesArray = $config['default']; } if ( isset( $config['name'] ) ) { $this->inputName = $config['name']; } if ( isset( $config['placeholder'] ) ) { $this->inputPlaceholder = $config['placeholder']; } $textarea = new MultilineTextInputWidget( [ 'name' => $this->inputName, 'value' => implode( "\n", $this->titlesArray ), 'rows' => 10, ] ); $this->appendContent( $textarea ); $this->addClasses( [ 'mw-widgets-titlesMultiselectWidget' ] ); } protected function getJavaScriptClassName() { return 'mw.widgets.TitlesMultiselectWidget'; } public function getConfig( &$config ) { if ( $this->titlesArray !== null ) { $config['selected'] = $this->titlesArray; } if ( $this->inputName !== null ) { $config['name'] = $this->inputName; } if ( $this->inputPlaceholder !== null ) { $config['placeholder'] = $this->inputPlaceholder; } $config['$overlay'] = true; return parent::getConfig( $config ); } }