From: Matthias Schmidt Date: Wed, 23 Dec 2020 14:38:07 +0000 (+0100) Subject: Add field attribute support for `RadioButtonFormField` X-Git-Tag: 5.4.0_Alpha_1~507^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f861e10637f496df9177dad949ee286a436a3549;p=GitHub%2FWoltLab%2FWCF.git Add field attribute support for `RadioButtonFormField` --- diff --git a/com.woltlab.wcf/templates/__radioButtonFormField.tpl b/com.woltlab.wcf/templates/__radioButtonFormField.tpl index e15f5f45ca..d9cb9e0000 100644 --- a/com.woltlab.wcf/templates/__radioButtonFormField.tpl +++ b/com.woltlab.wcf/templates/__radioButtonFormField.tpl @@ -7,6 +7,7 @@ *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->getValue() !== null && $field->getValue() == $__fieldValue} checked{/if}{* *}{if $field->isImmutable()} disabled{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}> {@$__fieldLabel} {/foreach} diff --git a/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl b/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl index e15f5f45ca..d9cb9e0000 100644 --- a/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl @@ -7,6 +7,7 @@ *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->getValue() !== null && $field->getValue() == $__fieldValue} checked{/if}{* *}{if $field->isImmutable()} disabled{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}> {@$__fieldLabel} {/foreach} diff --git a/wcfsetup/install/files/lib/system/form/builder/field/RadioButtonFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/RadioButtonFormField.class.php index b5d5e9460a..d01ab3661a 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/RadioButtonFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/RadioButtonFormField.class.php @@ -11,7 +11,8 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError; * @package WoltLabSuite\Core\System\Form\Builder\Field * @since 5.2 */ -class RadioButtonFormField extends AbstractFormField implements ICssClassFormField, IImmutableFormField, ISelectionFormField { +class RadioButtonFormField extends AbstractFormField implements IAttributeFormField, ICssClassFormField, IImmutableFormField, ISelectionFormField { + use TInputAttributeFormField; use TCssClassFormField; use TImmutableFormField; use TSelectionFormField;