Add field CSS class support for `multifactor\totp\CodeFormField`
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 12:01:32 +0000 (13:01 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2020 12:01:32 +0000 (13:01 +0100)
com.woltlab.wcf/templates/__multifactorTotpCodeField.tpl
wcfsetup/install/files/acp/templates/__multifactorTotpCodeField.tpl
wcfsetup/install/files/lib/system/user/multifactor/totp/CodeFormField.class.php

index 9b46101f55f26ae099cb14992cc056b6e61cd8dc..7b596894d9cfd5593b858651920bb4c72c6d6929 100644 (file)
@@ -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]*" {*
index 9b46101f55f26ae099cb14992cc056b6e61cd8dc..7b596894d9cfd5593b858651920bb4c72c6d6929 100644 (file)
@@ -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]*" {*
index 35aed91541b0000d3ea68da67e2b6324420232d2..f35b497e972049ebe0768041a7791b4f34b3c59c 100644 (file)
@@ -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();