Add pattern support for `TextFormField`
authorMatthias Schmidt <gravatronics@live.com>
Tue, 22 Dec 2020 13:00:52 +0000 (14:00 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 22 Dec 2020 13:00:52 +0000 (14:00 +0100)
com.woltlab.wcf/templates/__textFormField.tpl
wcfsetup/install/files/acp/templates/__textFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php

index a87d857afd64f96f1088a57b3c2d30f3461cafce..e8bc95df2dc4d837bf7bb645a3ad21af42c09a50 100644 (file)
@@ -5,6 +5,7 @@
        *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
        *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/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 a87d857afd64f96f1088a57b3c2d30f3461cafce..e8bc95df2dc4d837bf7bb645a3ad21af42c09a50 100644 (file)
@@ -5,6 +5,7 @@
        *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
        *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/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 28439b9cd7c3c527c3495a3b423359985c71584f..7294dc0b97014e83d683c80685b645e2a26c9567 100644 (file)
@@ -13,7 +13,7 @@ use wcf\system\language\LanguageFactory;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field
  * @since      5.2
  */
-class TextFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IInputModeFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField {
+class TextFormField extends AbstractFormField implements IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IInputModeFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPatternFormField, IPlaceholderFormField {
        use TTextAutoCompleteFormField;
        use TAutoFocusFormField;
        use TCssClassFormField;
@@ -24,6 +24,7 @@ class TextFormField extends AbstractFormField implements IAutoCompleteFormField,
        }
        use TMaximumLengthFormField;
        use TMinimumLengthFormField;
+       use TPatternFormField;
        use TPlaceholderFormField;
        
        /**