From: Bartosz DziewoƄski Date: Thu, 10 Mar 2016 20:17:26 +0000 (+0100) Subject: HTMLFormFieldWithButton: Don't make the button primary by default X-Git-Tag: 1.31.0-rc.0~7660^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=3c5a7009f5f57bc4caed92efb5fa036fdd9d9073;p=lhc%2Fweb%2Fwiklou.git 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 --- 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,