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

index 20d135eb35bbf800a1d23c745dc052b0ef305550..f8e4d17009a41df6c70b0d88c9cb26d45590ac43 100644 (file)
@@ -3,4 +3,5 @@
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{$field->getValue()}"{*
+       *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
 *}>{$field->getButtonLabel()}</button>
index 20d135eb35bbf800a1d23c745dc052b0ef305550..f8e4d17009a41df6c70b0d88c9cb26d45590ac43 100644 (file)
@@ -3,4 +3,5 @@
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}value="{$field->getValue()}"{*
+       *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
 *}>{$field->getButtonLabel()}</button>
index 7de61e8061ed2531f7ccaf3f52734140257ff678..f64ccfe0e2a85aee0b00079c869a259418da49e5 100644 (file)
@@ -13,7 +13,9 @@ use wcf\system\WCF;
  * @package     WoltLabSuite\Core\System\Form\Builder\Field
  * @since       5.4
  */
-class ButtonFormField extends AbstractFormField {
+class ButtonFormField extends AbstractFormField implements ICssClassFormField {
+       use TCssClassFormField;
+       
        /**
         * text shown on the button
         * @var ?string