Add field attribute support for `TextFormField`
authorMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:13:16 +0000 (15:13 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:24:19 +0000 (15:24 +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 e8bc95df2dc4d837bf7bb645a3ad21af42c09a50..3d838fafa0e75f11507d20966708f72ff9716637 100644 (file)
@@ -13,6 +13,7 @@
        *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+       *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
 *}>
 
 {if $field->isI18n()}
index e8bc95df2dc4d837bf7bb645a3ad21af42c09a50..3d838fafa0e75f11507d20966708f72ff9716637 100644 (file)
@@ -13,6 +13,7 @@
        *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{*
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
+       *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
 *}>
 
 {if $field->isI18n()}
index 7294dc0b97014e83d683c80685b645e2a26c9567..1b544bb2573c13c0893771dac199950571a5d110 100644 (file)
@@ -13,7 +13,8 @@ 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, IPatternFormField, IPlaceholderFormField {
+class TextFormField extends AbstractFormField implements IAttributeFormField, IAutoCompleteFormField, IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IInputModeFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPatternFormField, IPlaceholderFormField {
+       use TInputAttributeFormField;
        use TTextAutoCompleteFormField;
        use TAutoFocusFormField;
        use TCssClassFormField;