From 113ad388b4a44456dd08192d615759e2d8e52d9c Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Wed, 23 Dec 2020 15:22:08 +0100 Subject: [PATCH] Add field attribute support for `ButtonFormField` --- com.woltlab.wcf/templates/__buttonFormField.tpl | 1 + wcfsetup/install/files/acp/templates/__buttonFormField.tpl | 1 + .../lib/system/form/builder/field/ButtonFormField.class.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/__buttonFormField.tpl b/com.woltlab.wcf/templates/__buttonFormField.tpl index f8e4d17009..9e1bf13304 100644 --- a/com.woltlab.wcf/templates/__buttonFormField.tpl +++ b/com.woltlab.wcf/templates/__buttonFormField.tpl @@ -4,4 +4,5 @@ *}name="{@$field->getPrefixedId()}" {* *}value="{$field->getValue()}"{* *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}>{$field->getButtonLabel()} diff --git a/wcfsetup/install/files/acp/templates/__buttonFormField.tpl b/wcfsetup/install/files/acp/templates/__buttonFormField.tpl index f8e4d17009..9e1bf13304 100644 --- a/wcfsetup/install/files/acp/templates/__buttonFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__buttonFormField.tpl @@ -4,4 +4,5 @@ *}name="{@$field->getPrefixedId()}" {* *}value="{$field->getValue()}"{* *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}>{$field->getButtonLabel()} diff --git a/wcfsetup/install/files/lib/system/form/builder/field/ButtonFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/ButtonFormField.class.php index f64ccfe0e2..b6edc8e3ae 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/ButtonFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/ButtonFormField.class.php @@ -13,7 +13,8 @@ use wcf\system\WCF; * @package WoltLabSuite\Core\System\Form\Builder\Field * @since 5.4 */ -class ButtonFormField extends AbstractFormField implements ICssClassFormField { +class ButtonFormField extends AbstractFormField implements IAttributeFormField, ICssClassFormField { + use TInputAttributeFormField; use TCssClassFormField; /** -- 2.20.1