From ef6cd5b4fa0cf0f1264c84537069578d003cccce Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 23 Dec 2020 15:17:35 +0100 Subject: [PATCH] Add field attribute support for `MultilineTextFormField` --- .../templates/__multilineTextFormField.tpl | 1 + .../acp/templates/__multilineTextFormField.tpl | 1 + .../builder/field/MultilineTextFormField.class.php | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/com.woltlab.wcf/templates/__multilineTextFormField.tpl b/com.woltlab.wcf/templates/__multilineTextFormField.tpl index acad308507..7a934287b5 100644 --- a/com.woltlab.wcf/templates/__multilineTextFormField.tpl +++ b/com.woltlab.wcf/templates/__multilineTextFormField.tpl @@ -11,6 +11,7 @@ *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{* *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}>{$field->getValue()} {if $field->isI18n()} diff --git a/wcfsetup/install/files/acp/templates/__multilineTextFormField.tpl b/wcfsetup/install/files/acp/templates/__multilineTextFormField.tpl index acad308507..7a934287b5 100644 --- a/wcfsetup/install/files/acp/templates/__multilineTextFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__multilineTextFormField.tpl @@ -11,6 +11,7 @@ *}{if $field->getMaximumLength() !== null} maxlength="{$field->getMaximumLength()}"{/if}{* *}{if $field->getInputMode() !== null} inputmode="{$field->getInputMode()}"{/if}{* *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}>{$field->getValue()} {if $field->isI18n()} diff --git a/wcfsetup/install/files/lib/system/form/builder/field/MultilineTextFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/MultilineTextFormField.class.php index 63805bf300..32fcea5c79 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/MultilineTextFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/MultilineTextFormField.class.php @@ -60,4 +60,17 @@ class MultilineTextFormField extends TextFormField { return $this; } + + /** + * @inheritDoc + * @since 5.4 + */ + protected static function getReservedFieldAttributes(): array { + return array_merge( + parent::getReservedFieldAttributes(), + [ + 'rows', + ] + ); + } } -- 2.20.1