From 4a3a1caf12ba60e68a346ae545b4af06c32f1636 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 20 Dec 2020 10:56:33 +0100 Subject: [PATCH] Add field CSS class support for `RadioButtonFormField` --- com.woltlab.wcf/templates/__radioButtonFormField.tpl | 1 + .../install/files/acp/templates/__radioButtonFormField.tpl | 1 + .../system/form/builder/field/RadioButtonFormField.class.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/__radioButtonFormField.tpl b/com.woltlab.wcf/templates/__radioButtonFormField.tpl index 8ca9eef8a6..e15f5f45ca 100644 --- a/com.woltlab.wcf/templates/__radioButtonFormField.tpl +++ b/com.woltlab.wcf/templates/__radioButtonFormField.tpl @@ -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} diff --git a/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl b/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl index 8ca9eef8a6..e15f5f45ca 100644 --- a/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl @@ -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} 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 00b022cc64..b5d5e9460a 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 IImmutableFormField, ISelectionFormField { +class RadioButtonFormField extends AbstractFormField implements ICssClassFormField, IImmutableFormField, ISelectionFormField { + use TCssClassFormField; use TImmutableFormField; use TSelectionFormField; -- 2.20.1