From 8b7187c25771a4fe3362839687154d8150aa44ef Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 21 Dec 2020 13:01:32 +0100 Subject: [PATCH] Add field CSS class support for `multifactor\totp\CodeFormField` --- com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl | 2 +- .../install/files/acp/templates/__multifactorTotpCodeField.tpl | 2 +- .../lib/system/user/multifactor/totp/CodeFormField.class.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl b/com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl index 9b46101f55..7b596894d9 100644 --- a/com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl +++ b/com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl @@ -2,7 +2,7 @@ *}id="{@$field->getPrefixedId()}" {* *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* - *}class="multifactorTotpCode" {* + *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* *}autocomplete="off" {* *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{* *}pattern="[0-9]*" {* diff --git a/wcfsetup/install/files/acp/templates/__multifactorTotpCodeField.tpl b/wcfsetup/install/files/acp/templates/__multifactorTotpCodeField.tpl index 9b46101f55..7b596894d9 100644 --- a/wcfsetup/install/files/acp/templates/__multifactorTotpCodeField.tpl +++ b/wcfsetup/install/files/acp/templates/__multifactorTotpCodeField.tpl @@ -2,7 +2,7 @@ *}id="{@$field->getPrefixedId()}" {* *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* - *}class="multifactorTotpCode" {* + *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* *}autocomplete="off" {* *}{if $field->getMaximumLength() !== null}size="{$field->getMaximumLength()}" {/if}{* *}pattern="[0-9]*" {* diff --git a/wcfsetup/install/files/lib/system/user/multifactor/totp/CodeFormField.class.php b/wcfsetup/install/files/lib/system/user/multifactor/totp/CodeFormField.class.php index 35aed91541..f35b497e97 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/totp/CodeFormField.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/totp/CodeFormField.class.php @@ -29,6 +29,7 @@ class CodeFormField extends TextFormField { public function __construct() { $this->minimumLength(Totp::CODE_LENGTH); $this->maximumLength(Totp::CODE_LENGTH); + $this->addFieldClass('multifactorTotpCode'); $placeholder = ''; $gen = Helper::digitStream(); -- 2.20.1