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