From 78431d4fba127ede73bb143cf614a6ffcc2ad721 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 11 Apr 2019 17:39:16 +0100 Subject: [PATCH] HTMLFormFieldWithButton: Allow passing 'inputtype' and pass through 'buttonid' Change-Id: Ib1c94ac66caf6243631aa9d2b9f7fd2e6ca7a367 --- includes/htmlform/fields/HTMLFormFieldWithButton.php | 1 + includes/htmlform/fields/HTMLTextField.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/includes/htmlform/fields/HTMLFormFieldWithButton.php b/includes/htmlform/fields/HTMLFormFieldWithButton.php index 03e479bd92..93f5363d7b 100644 --- a/includes/htmlform/fields/HTMLFormFieldWithButton.php +++ b/includes/htmlform/fields/HTMLFormFieldWithButton.php @@ -59,6 +59,7 @@ class HTMLFormFieldWithButton extends HTMLFormField { 'type' => $this->mButtonType, 'label' => $this->mButtonValue, 'flags' => $this->mButtonFlags, + 'id' => $this->mButtonId, ] + OOUI\Element::configFromHtmlAttributes( $this->getAttributes( [ 'disabled', 'tabindex' ] ) ) ); diff --git a/includes/htmlform/fields/HTMLTextField.php b/includes/htmlform/fields/HTMLTextField.php index 60c63d6a07..56589b054c 100644 --- a/includes/htmlform/fields/HTMLTextField.php +++ b/includes/htmlform/fields/HTMLTextField.php @@ -131,6 +131,9 @@ class HTMLTextField extends HTMLFormField { case 'url': $type = $this->mParams['type']; break; + case 'textwithbutton': + $type = $this->mParams['inputtype'] ?? 'text'; + break; } } -- 2.20.1