From bd95941ffc6c60b81ccad2d8a06973c24e90c29f Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 20 Dec 2020 10:45:30 +0100 Subject: [PATCH] Add field CSS class support for `TextFormField` --- com.woltlab.wcf/templates/__textFormField.tpl | 4 ++-- .../install/files/acp/templates/__textFormField.tpl | 4 ++-- .../system/form/builder/field/TextFormField.class.php | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/com.woltlab.wcf/templates/__textFormField.tpl b/com.woltlab.wcf/templates/__textFormField.tpl index 8d73e00153..a918a0175d 100644 --- a/com.woltlab.wcf/templates/__textFormField.tpl +++ b/com.woltlab.wcf/templates/__textFormField.tpl @@ -1,8 +1,8 @@ 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}{* diff --git a/wcfsetup/install/files/acp/templates/__textFormField.tpl b/wcfsetup/install/files/acp/templates/__textFormField.tpl index 8d73e00153..a918a0175d 100644 --- a/wcfsetup/install/files/acp/templates/__textFormField.tpl +++ b/wcfsetup/install/files/acp/templates/__textFormField.tpl @@ -1,8 +1,8 @@ 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}{* diff --git a/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php b/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php index ff2f58caae..aabc0bd1d1 100644 --- a/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php +++ b/wcfsetup/install/files/lib/system/form/builder/field/TextFormField.class.php @@ -13,8 +13,9 @@ use wcf\system\language\LanguageFactory; * @package WoltLabSuite\Core\System\Form\Builder\Field * @since 5.2 */ -class TextFormField extends AbstractFormField implements IAutoFocusFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField { +class TextFormField extends AbstractFormField implements IAutoFocusFormField, ICssClassFormField, II18nFormField, IImmutableFormField, IMaximumLengthFormField, IMinimumLengthFormField, IPlaceholderFormField { use TAutoFocusFormField; + use TCssClassFormField; use TImmutableFormField; use TI18nFormField { validate as protected i18nValidate; @@ -33,6 +34,13 @@ class TextFormField extends AbstractFormField implements IAutoFocusFormField, II */ protected $templateName = '__textFormField'; + /** + * Creates a new instance of `TextFormField`. + */ + public function __construct() { + $this->addFieldClass('long'); + } + /** * @inheritDoc */ -- 2.20.1