From 83891d46f1f1c8961c0a993e4188d38bc8ed5af8 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 21 Dec 2020 13:01:06 +0100 Subject: [PATCH] Add field CSS class support for `multifactor\backup\CodeFormField` --- com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl | 2 +- .../files/acp/templates/__multifactorBackupCodeField.tpl | 2 +- .../lib/system/user/multifactor/backup/CodeFormField.class.php | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl b/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl index d76256140e..1dde538f16 100644 --- a/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl +++ b/com.woltlab.wcf/templates/__multifactorBackupCodeField.tpl @@ -2,7 +2,7 @@ *}id="{@$field->getPrefixedId()}" {* *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* - *}class="multifactorBackupCode" {* + *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* *}autocomplete="off" {* *}pattern="[0-9\s]*" {* *}inputmode="numeric"{* diff --git a/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl b/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl index d76256140e..1dde538f16 100644 --- a/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl +++ b/wcfsetup/install/files/acp/templates/__multifactorBackupCodeField.tpl @@ -2,7 +2,7 @@ *}id="{@$field->getPrefixedId()}" {* *}name="{@$field->getPrefixedId()}" {* *}value="{if !$field->isI18n() || !$field->hasI18nValues() || $availableLanguages|count === 1}{$field->getValue()}{/if}" {* - *}class="multifactorBackupCode" {* + *}{if !$field->getFieldClasses()|empty}class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}" {/if}{* *}autocomplete="off" {* *}pattern="[0-9\s]*" {* *}inputmode="numeric"{* diff --git a/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php b/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php index 62617bf9fa..1d42feee8d 100644 --- a/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php +++ b/wcfsetup/install/files/lib/system/user/multifactor/backup/CodeFormField.class.php @@ -36,6 +36,7 @@ class CodeFormField extends TextFormField { $this->chunks(BackupMultifactorMethod::CHUNKS); $this->chunkLength(BackupMultifactorMethod::CHUNK_LENGTH); $this->minimumLength($this->getChunks() * $this->getChunkLength()); + $this->addFieldClass('multifactorBackupCode'); $placeholder = ''; $gen = Helper::digitStream(); -- 2.20.1