Localisation updates from https://translatewiki.net.
[mediawiki.git] / includes / htmlform / fields / HTMLTextFieldWithButton.php
blobc43c1530d57bdda9bad549362b3047b045272ae7
1 <?php
3 namespace MediaWiki\HTMLForm\Field;
5 use MediaWiki\HTMLForm\HTMLFormActionFieldLayout;
7 /**
8 * Creates a text input field with a button assigned to the input field.
10 * @stable to extend
12 class HTMLTextFieldWithButton extends HTMLTextField {
13 /** @var HTMLFormFieldWithButton */
14 protected $mClassWithButton = null;
16 /**
17 * @stable to call
18 * @inheritDoc
20 public function __construct( $info ) {
21 $this->mClassWithButton = new HTMLFormFieldWithButton( $info );
22 parent::__construct( $info );
25 public function getInputHTML( $value ) {
26 return $this->mClassWithButton->getElement( parent::getInputHTML( $value ) );
29 protected function getFieldLayoutOOUI( $inputField, $config ) {
30 $buttonWidget = $this->mClassWithButton->getInputOOUI( '' );
31 return new HTMLFormActionFieldLayout( $inputField, $buttonWidget, $config );
35 /** @deprecated class alias since 1.42 */
36 class_alias( HTMLTextFieldWithButton::class, 'HTMLTextFieldWithButton' );