Add field attribute support for `TagFormField`
authorMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:49:18 +0000 (15:49 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 23 Dec 2020 14:49:18 +0000 (15:49 +0100)
com.woltlab.wcf/templates/__tagFormField.tpl
wcfsetup/install/files/acp/templates/__tagFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/tag/TagFormField.class.php

index 09d380ab4d977812651b919f4b4bf7973e34d594..566556151d2be61ad4d9e159b851172df933662f 100644 (file)
@@ -1,4 +1,9 @@
-<input id="{@$field->getPrefixedId()}" type="text" value="" class="long">
+<input id="{@$field->getPrefixedId()}" {*
+       *}type="text" {*
+       *}value="" {*
+       *}class="long"{*
+       *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
+*}>
 
 <script data-relocate="true">
        require(['WoltLabSuite/Core/Ui/ItemList'], function(UiItemList) {
index 09d380ab4d977812651b919f4b4bf7973e34d594..566556151d2be61ad4d9e159b851172df933662f 100644 (file)
@@ -1,4 +1,9 @@
-<input id="{@$field->getPrefixedId()}" type="text" value="" class="long">
+<input id="{@$field->getPrefixedId()}" {*
+       *}type="text" {*
+       *}value="" {*
+       *}class="long"{*
+       *}{foreach from=$field->getFieldAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{*
+*}>
 
 <script data-relocate="true">
        require(['WoltLabSuite/Core/Ui/ItemList'], function(UiItemList) {
index 133b15174fdcbb4319d4b7da49cbfef7e28a338b..f67ad59bc1c0ab3a9f5db0e6d254865517c560f0 100644 (file)
@@ -4,7 +4,9 @@ use wcf\data\IStorableObject;
 use wcf\data\tag\Tag;
 use wcf\system\form\builder\data\processor\CustomFormDataProcessor;
 use wcf\system\form\builder\field\AbstractFormField;
+use wcf\system\form\builder\field\IAttributeFormField;
 use wcf\system\form\builder\field\TDefaultIdFormField;
+use wcf\system\form\builder\field\TInputAttributeFormField;
 use wcf\system\form\builder\IFormDocument;
 use wcf\system\form\builder\IObjectTypeFormNode;
 use wcf\system\form\builder\TObjectTypeFormNode;
@@ -24,7 +26,8 @@ use wcf\util\ArrayUtil;
  * @package    WoltLabSuite\Core\System\Form\Builder\Field\Tag
  * @since      5.2
  */
-class TagFormField extends AbstractFormField implements IObjectTypeFormNode {
+class TagFormField extends AbstractFormField implements IAttributeFormField, IObjectTypeFormNode {
+       use TInputAttributeFormField;
        use TDefaultIdFormField;
        use TObjectTypeFormNode;