Add field CSS class support for `RadioButtonFormField`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 20 Dec 2020 09:56:33 +0000 (10:56 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 20 Dec 2020 09:56:33 +0000 (10:56 +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 8ca9eef8a6ff292e46dd9609110f8d90e2247836..e15f5f45ca1b5d94250625fbdd2aab31f8407a30 100644 (file)
@@ -4,6 +4,7 @@
                        *}type="radio" {*
                        *}name="{@$field->getPrefixedId()}" {*
                        *}value="{$__fieldValue}"{*
+                       *}{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}{*
                *}> {@$__fieldLabel}
index 8ca9eef8a6ff292e46dd9609110f8d90e2247836..e15f5f45ca1b5d94250625fbdd2aab31f8407a30 100644 (file)
@@ -4,6 +4,7 @@
                        *}type="radio" {*
                        *}name="{@$field->getPrefixedId()}" {*
                        *}value="{$__fieldValue}"{*
+                       *}{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}{*
                *}> {@$__fieldLabel}
index 00b022cc648897b0c3f7e9f609f4001d8506e1c0..b5d5e9460a96d797a653e12320aff7e6a81c8bc9 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 IImmutableFormField, ISelectionFormField {
+class RadioButtonFormField extends AbstractFormField implements ICssClassFormField, IImmutableFormField, ISelectionFormField {
+       use TCssClassFormField;
        use TImmutableFormField;
        use TSelectionFormField;