From: Matthias Schmidt Date: Sun, 20 Dec 2020 09:56:33 +0000 (+0100) Subject: Add field CSS class support for `RadioButtonFormField` X-Git-Tag: 5.4.0_Alpha_1~525^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4a3a1caf12ba60e68a346ae545b4af06c32f1636;p=GitHub%2FWoltLab%2FWCF.git Add field CSS class support for `RadioButtonFormField` --- 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;