From: Matthias Schmidt Date: Wed, 23 Dec 2020 14:26:58 +0000 (+0100) Subject: Add field attribute support for `BooleanFormField` X-Git-Tag: 5.4.0_Alpha_1~507^2~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a0bff0067c3b6c67614ee076d7f7c50444e20053;p=GitHub%2FWoltLab%2FWCF.git Add field attribute support for `BooleanFormField` --- diff --git a/com.woltlab.wcf/templates/__booleanFormField.tpl b/com.woltlab.wcf/templates/__booleanFormField.tpl index a67c96ff64..9acc4daa2e 100644 --- a/com.woltlab.wcf/templates/__booleanFormField.tpl +++ b/com.woltlab.wcf/templates/__booleanFormField.tpl @@ -10,6 +10,7 @@ *}{if $field->isRequired()} required{/if}{* *}{if $field->isImmutable()} disabled{/if}{* *}{if $field->getValue()} checked{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}> @@ -21,6 +22,7 @@ *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->isImmutable()} disabled{/if}{* *}{if !$field->getValue()} checked{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}> diff --git a/wcfsetup/install/files/acp/templates/__booleanFormField.tpl b/wcfsetup/install/files/acp/templates/__booleanFormField.tpl index a67c96ff64..9acc4daa2e 100644 --- a/wcfsetup/install/files/acp/templates/__booleanFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__booleanFormField.tpl @@ -10,6 +10,7 @@ *}{if $field->isRequired()} required{/if}{* *}{if $field->isImmutable()} disabled{/if}{* *}{if $field->getValue()} checked{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}> @@ -21,6 +22,7 @@ *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{* *}{if $field->isImmutable()} disabled{/if}{* *}{if !$field->getValue()} checked{/if}{* + *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{* *}> 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 6d9373b25d..5096f9b36c 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,7 +11,8 @@ use wcf\system\form\builder\field\validation\FormFieldValidationError; * @package WoltLabSuite\Core\System\Form\Builder\Field * @since 5.2 */ -class BooleanFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, IImmutableFormField { +class BooleanFormField extends AbstractFormField implements IAttributeFormField, IAutoFocusFormField, ICssClassFormField, IImmutableFormField { + use TInputAttributeFormField; use TAutoFocusFormField; use TCssClassFormField; use TImmutableFormField;