From c10fe0128048c98c4ea5cb15cb2bc7dc51eb15dc Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 22 Dec 2020 14:00:52 +0100 Subject: [PATCH] Add pattern support for `TextFormField` --- com.woltlab.wcf/templates/__textFormField.tpl | 1 + wcfsetup/install/files/acp/templates/__textFormField.tpl | 1 + .../lib/system/form/builder/field/TextFormField.class.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/__textFormField.tpl b/com.woltlab.wcf/templates/__textFormField.tpl index a87d857afd..e8bc95df2d 100644 --- a/com.woltlab.wcf/templates/__textFormField.tpl +++ b/com.woltlab.wcf/templates/__textFormField.tpl @@ -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}{* diff --git a/wcfsetup/install/files/acp/templates/__textFormField.tpl b/wcfsetup/install/files/acp/templates/__textFormField.tpl index a87d857afd..e8bc95df2d 100644 --- a/wcfsetup/install/files/acp/templates/__textFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__textFormField.tpl @@ -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}{* diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php index 28439b9cd7..7294dc0b97 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php @@ -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; /** -- 2.20.1