Add field CSS class support for `MultipleSelectionFormField`
authorMatthias Schmidt <gravatronics@live.com>
Sun, 20 Dec 2020 09:57:38 +0000 (10:57 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sun, 20 Dec 2020 09:57:38 +0000 (10:57 +0100)
com.woltlab.wcf/templates/__multipleSelectionFormField.tpl
wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/MultipleSelectionFormField.class.php

index c13cdd7bef5f13bec5ed0100501fa81d94b8baa4..514fea2b30cfdfbae9fdacbca4975f3a9a80036e 100644 (file)
@@ -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]}</label>
@@ -34,6 +35,7 @@
                        <input 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]}
index c13cdd7bef5f13bec5ed0100501fa81d94b8baa4..514fea2b30cfdfbae9fdacbca4975f3a9a80036e 100644 (file)
@@ -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]}</label>
@@ -34,6 +35,7 @@
                        <input 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]}
index 29ad395b50bfd47218855c90fa1eca53358922bd..247cdc4b1792c74360f6bc7553c8b843c7e782fd 100644 (file)
@@ -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;