From 760b7a11b1dff82ec4b9292c033dd373c0c56ef5 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 20 Dec 2020 10:57:38 +0100 Subject: [PATCH] Add field CSS class support for `MultipleSelectionFormField` --- com.woltlab.wcf/templates/__multipleSelectionFormField.tpl | 2 ++ .../files/acp/templates/__multipleSelectionFormField.tpl | 2 ++ .../form/builder/field/MultipleSelectionFormField.class.php | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/com.woltlab.wcf/templates/__multipleSelectionFormField.tpl b/com.woltlab.wcf/templates/__multipleSelectionFormField.tpl index c13cdd7bef..514fea2b30 100644 --- a/com.woltlab.wcf/templates/__multipleSelectionFormField.tpl +++ b/com.woltlab.wcf/templates/__multipleSelectionFormField.tpl @@ -22,6 +22,7 @@ *}type="checkbox" {* *}name="{@$field->getPrefixedId()}[]" {* *}value="{$__fieldNestedOption[value]}"{* + *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue() && $__fieldNestedOption[isSelectable]} checked{/if}{* *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{* *}> {@$__fieldNestedOption[label]} @@ -34,6 +35,7 @@ getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue() && $__fieldNestedOption[isSelectable]} checked{/if}{* *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{* *}> {@$__fieldNestedOption[label]} diff --git a/wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl b/wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl index c13cdd7bef..514fea2b30 100644 --- a/wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl @@ -22,6 +22,7 @@ *}type="checkbox" {* *}name="{@$field->getPrefixedId()}[]" {* *}value="{$__fieldNestedOption[value]}"{* + *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue() && $__fieldNestedOption[isSelectable]} checked{/if}{* *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{* *}> {@$__fieldNestedOption[label]} @@ -34,6 +35,7 @@ getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->getValue() !== null && $__fieldNestedOption[value]|in_array:$field->getValue() && $__fieldNestedOption[isSelectable]} checked{/if}{* *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{* *}> {@$__fieldNestedOption[label]} diff --git a/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php index 29ad395b50..247cdc4b17 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php @@ -13,7 +13,8 @@ use wcf\system\form\builder\IFormDocument; * @package WoltLabSuite\Core\System\Form\Builder\Field * @since 5.2 */ -class MultipleSelectionFormField extends AbstractFormField implements IFilterableSelectionFormField, IImmutableFormField { +class MultipleSelectionFormField extends AbstractFormField implements ICssClassFormField, IFilterableSelectionFormField, IImmutableFormField { + use TCssClassFormField; use TFilterableSelectionFormField; use TImmutableFormField; -- 2.20.1