Add pattern support for `EmailFormField`
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Dec 2020 13:02:19 +0000 (14:02 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 22 Dec 2020 13:02:19 +0000 (14:02 +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 d04f9b189b33c71675598eb829977e7b6c3bc2aa..938ece48eaaceca21b3a2dbd23949d0a14b1456b 100644 (file)
@@ -5,6 +5,7 @@
        *}maxlength="191"{*
        *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
        *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
+       *}{if $field->getPattern() !== null} pattern="{$field->getPattern()}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
index d04f9b189b33c71675598eb829977e7b6c3bc2aa..938ece48eaaceca21b3a2dbd23949d0a14b1456b 100644 (file)
@@ -5,6 +5,7 @@
        *}maxlength="191"{*
        *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
        *}{if $field->getAutoComplete() !== null} autocomplete="{$field->getAutoComplete()}"{/if}{*
+       *}{if $field->getPattern() !== null} pattern="{$field->getPattern()}"{/if}{*
        *}{if $field->isAutofocused()} autofocus{/if}{*
        *}{if $field->isRequired()} required{/if}{*
        *}{if $field->isImmutable()} disabled{/if}{*
index 465e4422ef0340d9a8688ec29cd8fbe318ce9409..1ba672abaf55b9d65abb1afacf83d81f42d33d0e 100644 (file)
@@ -16,7 +16,7 @@ use wcf\util\UserUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class EmailFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IInputModeFormField, IPlaceholderFormField {
+class EmailFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IInputModeFormField, IPatternFormField, IPlaceholderFormField {
        use TAutoCompleteFormField;
        use TAutoFocusFormField;
        use TCssClassFormField;
@@ -25,6 +25,7 @@ class EmailFormField extends AbstractFormField implements IAutoCompleteFormField
        use TI18nFormField {
                validate as protected i18nValidate;
        }
+       use TPatternFormField;
        use TPlaceholderFormField;
        
        /**