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

index 331481b5b7b615888da190a807ad5f3613eb2d35..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="multifactorEmailCode" {*
+       *}{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 331481b5b7b615888da190a807ad5f3613eb2d35..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="multifactorEmailCode" {*
+       *}{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 0e288b06b507714d28342470dcb99ac394cde380..24b111539d816d37be0f4155b2f55f048e23fb2a 100644 (file)
@@ -25,6 +25,7 @@ class CodeFormField extends TextFormField {
        public function __construct() {
                $this->minimumLength(EmailMultifactorMethod::LENGTH);
                $this->maximumLength(EmailMultifactorMethod::LENGTH);
+               $this->addFieldClass('multifactorEmailCode');
                
                $placeholder = '';
                $gen = Helper::digitStream();