Add field attribute support for `RadioButtonFormField`
authorMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:38:07 +0000 (15:38 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:38:07 +0000 (15:38 +0100)
com.woltlab.wcf/templates/__radioButtonFormField.tpl
wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/RadioButtonFormField.class.php

index e15f5f45ca1b5d94250625fbdd2aab31f8407a30..d9cb9e0000e1c07eed2fad67b58308945374d7f5 100644 (file)
@@ -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}
        </label>
 {/foreach}
index e15f5f45ca1b5d94250625fbdd2aab31f8407a30..d9cb9e0000e1c07eed2fad67b58308945374d7f5 100644 (file)
@@ -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}
        </label>
 {/foreach}
index b5d5e9460a96d797a653e12320aff7e6a81c8bc9..d01ab3661a120bfde142ff1bd672867ddf60bf6e 100644 (file)
@@ -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;