From: Matthias Schmidt Date: Wed, 23 Dec 2020 14:17:35 +0000 (+0100) Subject: Add field attribute support for `MultilineTextFormField` X-Git-Tag: 5.4.0_Alpha_1~507^2~16 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ef6cd5b4fa0cf0f1264c84537069578d003cccce;p=GitHub%2FWoltLab%2FWCF.git Add field attribute support for `MultilineTextFormField` --- 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', + ] + ); + } }