selectedArray = $config['default'] ?? []; $this->inputName = $config['name'] ?? null; $this->inputPlaceholder = $config['placeholder'] ?? null; $this->input = $config['input'] ?? []; $this->tagLimit = $config['tagLimit'] ?? null; $textarea = new MultilineTextInputWidget( array_merge( [ 'name' => $this->inputName, 'value' => implode( "\n", $this->selectedArray ), 'rows' => 10, 'classes' => [ 'mw-widgets-tagMultiselectWidget-multilineTextInputWidget' ], ], $this->input ) ); $pending = new PendingTextInputWidget(); $this->appendContent( $textarea, $pending ); $this->addClasses( [ 'mw-widgets-tagMultiselectWidget' ] ); } public function getConfig( &$config ) { if ( $this->selectedArray !== null ) { $config['selected'] = $this->selectedArray; } if ( $this->inputName !== null ) { $config['name'] = $this->inputName; } if ( $this->inputPlaceholder !== null ) { $config['placeholder'] = $this->inputPlaceholder; } if ( $this->input !== null ) { $config['input'] = $this->input; } if ( $this->tagLimit !== null ) { $config['tagLimit'] = $this->tagLimit; } $config['$overlay'] = true; return parent::getConfig( $config ); } }