Add field CSS class support for `EmailFormField`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 20 Dec 2020 09:48:03 +0000 (10:48 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 20 Dec 2020 09:48:03 +0000 (10:48 +0100)
com.woltlab.wcf/templates/__emailFormField.tpl
wcfsetup/install/files/acp/templates/__emailFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/EmailFormField.class.php

index af84b97ea7832472744753017256faf22a47fefb..f183868abb3696d22ca53338aaee2afe229abef9 100644 (file)
@@ -2,8 +2,8 @@
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{if !$field->isI18n() || !$field->hasI18nValues()}{$field->getValue()}{/if}" {*
-       *}class="long" {*
        *}maxlength="191"{*
+       *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
index af84b97ea7832472744753017256faf22a47fefb..f183868abb3696d22ca53338aaee2afe229abef9 100644 (file)
@@ -2,8 +2,8 @@
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{if !$field->isI18n() || !$field->hasI18nValues()}{$field->getValue()}{/if}" {*
-       *}class="long" {*
        *}maxlength="191"{*
+       *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
index 23ae6506a1cc72a938646ae2ee8cfbe55c6a435d..1abb9644a229413426564aa1f051d2fb46ca4a08 100644 (file)
@@ -16,8 +16,9 @@ use wcf\util\UserUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class EmailFormField extends AbstractFormField implements IAutoFocusFormField, II18nFormField, IImmutableFormField, IPlaceholderFormField {
+class EmailFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IPlaceholderFormField {
        use TAutoFocusFormField;
+       use TCssClassFormField;
        use TImmutableFormField;
        use TI18nFormField {
                validate as protected i18nValidate;
@@ -39,6 +40,7 @@ class EmailFormField extends AbstractFormField implements IAutoFocusFormField, I
         */
        public function __construct() {
                $this->label('wcf.form.field.email');
+               $this->addFieldClass('long');
        }
        
        /**