| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\HTMLForm\Field; |
| 4 |
|
| 5 |
use MediaWiki\HTMLForm\HTMLFormActionFieldLayout; |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
class HTMLSelectNamespaceWithButton extends HTMLSelectNamespace { |
| 13 |
|
| 14 |
protected $mClassWithButton = null; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
public function __construct( $info ) { |
| 21 |
$this->mClassWithButton = new HTMLFormFieldWithButton( $info ); |
| 22 |
parent::__construct( $info ); |
| 23 |
} |
| 24 |
|
| 25 |
public function getInputHTML( $value ) { |
| 26 |
return $this->mClassWithButton->getElement( parent::getInputHTML( $value ) ); |
| 27 |
} |
| 28 |
|
| 29 |
protected function getFieldLayoutOOUI( $inputField, $config ) { |
| 30 |
$buttonWidget = $this->mClassWithButton->getInputOOUI( '' ); |
| 31 |
return new HTMLFormActionFieldLayout( $inputField, $buttonWidget, $config ); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
class_alias( HTMLSelectNamespaceWithButton::class, 'HTMLSelectNamespaceWithButton' ); |