2015-04-17 16:56:32 +00:00
|
|
|
<?php
|
2024-02-08 15:30:18 +00:00
|
|
|
|
|
|
|
|
namespace MediaWiki\HTMLForm\Field;
|
|
|
|
|
|
|
|
|
|
use MediaWiki\HTMLForm\HTMLFormActionFieldLayout;
|
|
|
|
|
|
2015-04-17 16:56:32 +00:00
|
|
|
/**
|
|
|
|
|
* Creates a Html::namespaceSelector input field with a button assigned to the input field.
|
2020-07-10 19:23:59 +00:00
|
|
|
*
|
|
|
|
|
* @stable to extend
|
2015-04-17 16:56:32 +00:00
|
|
|
*/
|
|
|
|
|
class HTMLSelectNamespaceWithButton extends HTMLSelectNamespace {
|
2019-11-29 13:33:43 +00:00
|
|
|
/** @var HTMLFormFieldWithButton */
|
2015-04-17 16:56:32 +00:00
|
|
|
protected $mClassWithButton = null;
|
|
|
|
|
|
2020-07-23 09:41:58 +00:00
|
|
|
/**
|
2020-07-10 19:23:59 +00:00
|
|
|
* @stable to call
|
2020-07-23 09:41:58 +00:00
|
|
|
* @inheritDoc
|
2020-07-10 19:23:59 +00:00
|
|
|
*/
|
2015-04-17 16:56:32 +00:00
|
|
|
public function __construct( $info ) {
|
|
|
|
|
$this->mClassWithButton = new HTMLFormFieldWithButton( $info );
|
|
|
|
|
parent::__construct( $info );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getInputHTML( $value ) {
|
|
|
|
|
return $this->mClassWithButton->getElement( parent::getInputHTML( $value ) );
|
|
|
|
|
}
|
2022-06-17 15:59:21 +00:00
|
|
|
|
|
|
|
|
protected function getFieldLayoutOOUI( $inputField, $config ) {
|
|
|
|
|
$buttonWidget = $this->mClassWithButton->getInputOOUI( '' );
|
|
|
|
|
return new HTMLFormActionFieldLayout( $inputField, $buttonWidget, $config );
|
|
|
|
|
}
|
2015-06-23 03:31:22 +00:00
|
|
|
}
|
2024-02-08 15:30:18 +00:00
|
|
|
|
2024-03-07 21:56:58 +00:00
|
|
|
/** @deprecated class alias since 1.42 */
|
2024-02-08 15:30:18 +00:00
|
|
|
class_alias( HTMLSelectNamespaceWithButton::class, 'HTMLSelectNamespaceWithButton' );
|