From 3c5a7009f5f57bc4caed92efb5fa036fdd9d9073 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 10 Mar 2016 21:17:26 +0100 Subject: [PATCH] HTMLFormFieldWithButton: Don't make the button primary by default It results in multiple 'primary' buttons in forms, contrary to the guidelines, for example on Special:Export. Before: https://phabricator.wikimedia.org/F3605116 After: https://phabricator.wikimedia.org/F3605163 Changed Special:BotPasswords to explicitly use a 'primary' button, since as far as I can tell it only displays a single button. Change-Id: Ic647d2650ca635644245eb657cce045db9869fc5 --- includes/htmlform/HTMLFormFieldWithButton.php | 2 +- includes/specials/SpecialBotPasswords.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/htmlform/HTMLFormFieldWithButton.php b/includes/htmlform/HTMLFormFieldWithButton.php index 272af15479..1ebd280870 100644 --- a/includes/htmlform/HTMLFormFieldWithButton.php +++ b/includes/htmlform/HTMLFormFieldWithButton.php @@ -19,7 +19,7 @@ class HTMLFormFieldWithButton extends HTMLFormField { protected $mButtonValue; /** @var string $mButtonType Value for the button in this field */ - protected $mButtonFlags = [ 'primary', 'progressive' ]; + protected $mButtonFlags = [ 'progressive' ]; public function __construct( $info ) { if ( isset( $info['buttonclass'] ) ) { diff --git a/includes/specials/SpecialBotPasswords.php b/includes/specials/SpecialBotPasswords.php index 11357fbd0b..abb4e11121 100644 --- a/includes/specials/SpecialBotPasswords.php +++ b/includes/specials/SpecialBotPasswords.php @@ -192,6 +192,7 @@ class SpecialBotPasswords extends FormSpecialPage { 'type' => 'textwithbutton', 'label-message' => 'botpasswords-label-appid', 'buttondefault' => $this->msg( 'botpasswords-label-create' )->text(), + 'buttonflags' => [ 'progressive', 'primary' ], 'required' => true, 'size' => BotPassword::APPID_MAXLENGTH, 'maxlength' => BotPassword::APPID_MAXLENGTH, -- 2.20.1