From: Matthias Schmidt Date: Sun, 20 Dec 2020 09:49:01 +0000 (+0100) Subject: Add field CSS class support for `BooleanFormField` X-Git-Tag: 5.4.0_Alpha_1~525^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7162e7b45e5f71477ba0b6568b61747885527a79;p=GitHub%2FWoltLab%2FWCF.git Add field CSS class support for `BooleanFormField` --- diff --git a/com.woltlab.wcf/templates/__booleanFormField.tpl b/com.woltlab.wcf/templates/__booleanFormField.tpl index 8902d12b4c..a67c96ff64 100644 --- a/com.woltlab.wcf/templates/__booleanFormField.tpl +++ b/com.woltlab.wcf/templates/__booleanFormField.tpl @@ -1,10 +1,27 @@
  1. - isAutofocused()} autofocus{/if}{if $field->isRequired()} required{/if}{if $field->isImmutable()} disabled{/if}{if $field->getValue()} checked{/if}> + getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* + *}{if $field->isAutofocused()} autofocus{/if}{* + *}{if $field->isRequired()} required{/if}{* + *}{if $field->isImmutable()} disabled{/if}{* + *}{if $field->getValue()} checked{/if}{* + *}>
  2. - isImmutable()} disabled{/if}{if !$field->getValue()} checked{/if}> + getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* + *}{if $field->isImmutable()} disabled{/if}{* + *}{if !$field->getValue()} checked{/if}{* + *}>
diff --git a/wcfsetup/install/files/acp/templates/__booleanFormField.tpl b/wcfsetup/install/files/acp/templates/__booleanFormField.tpl index 8902d12b4c..a67c96ff64 100644 --- a/wcfsetup/install/files/acp/templates/__booleanFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__booleanFormField.tpl @@ -1,10 +1,27 @@
  1. - isAutofocused()} autofocus{/if}{if $field->isRequired()} required{/if}{if $field->isImmutable()} disabled{/if}{if $field->getValue()} checked{/if}> + getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* + *}{if $field->isAutofocused()} autofocus{/if}{* + *}{if $field->isRequired()} required{/if}{* + *}{if $field->isImmutable()} disabled{/if}{* + *}{if $field->getValue()} checked{/if}{* + *}>
  2. - isImmutable()} disabled{/if}{if !$field->getValue()} checked{/if}> + getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* + *}{if $field->isImmutable()} disabled{/if}{* + *}{if !$field->getValue()} checked{/if}{* + *}>
diff --git a/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php index 665acba3f6..6d9373b25d 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/BooleanFormField.class.php @@ -11,8 +11,9 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError; * @package WoltLabSuite\Core\System\Form\Builder\Field * @since 5.2 */ -class BooleanFormField extends AbstractFormField implements IAutoFocusFormField, IImmutableFormField { +class BooleanFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, IImmutableFormField { use TAutoFocusFormField; + use TCssClassFormField; use TImmutableFormField; /**