Rename `__multilineItemListFormField` template to `shared_multilineItemListFormField`
authorOlaf Braun <info@braun-development.de>
Thu, 25 Apr 2024 14:45:09 +0000 (16:45 +0200)
committerOlaf Braun <info@braun-development.de>
Thu, 25 Apr 2024 14:45:09 +0000 (16:45 +0200)
com.woltlab.wcf/acpTemplateDelete.xml
com.woltlab.wcf/templateDelete.xml
com.woltlab.wcf/templates/__multilineItemListFormField.tpl [deleted file]
com.woltlab.wcf/templates/shared_multilineItemListFormField.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/__multilineItemListFormField.tpl [deleted file]
wcfsetup/install/files/lib/system/form/builder/field/MultilineItemListFormField.class.php

index 42ea52a926a9dc34e5b05c9930c2aa0d8d0e9f01..f5cb5c16cf3e1b139223b3ca6469c0f93e4e1ca6 100644 (file)
                <template>__videoAttachmentBBCode</template>
                <template>__audioAttachmentBBCode</template>
                <template>__multiPageCondition</template>
+               <template>__multilineItemListFormField</template>
        </delete>
 </data>
index 980aeda43c135eb5113720dff0128e73cb26a566..41c1d2ae3b3b06530ffd8df2d22622f3dfb6fd4f 100644 (file)
                <template>__videoAttachmentBBCode</template>
                <template>__audioAttachmentBBCode</template>
                <template>__multiPageCondition</template>
+               <template>__multilineItemListFormField</template>
        </delete>
 </data>
diff --git a/com.woltlab.wcf/templates/__multilineItemListFormField.tpl b/com.woltlab.wcf/templates/__multilineItemListFormField.tpl
deleted file mode 100644 (file)
index 340637a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<ul class="scrollableCheckboxList" {*
-    *}id="lineBreakSeparatedTextOption_{$field->getPrefixedId()}"{*
-    *}{if $field->getValue()|empty} style="display: none"{/if}{*
-*}>
-       {foreach from=$field->getValue() item=value}
-               <li data-value="{$value}">
-                       <button class="jsDeleteItem jsTooltip" type="button" title="{lang}wcf.global.button.delete{/lang}">
-                               {icon name='trash'}
-                       </button>
-                       <button class="jsEditItem jsTooltip" type="button" title="{lang}wcf.global.button.edit{/lang}">
-                               {icon name='edit'}
-                       </button>
-                       <span>{$value}</span>
-               </li>
-       {/foreach}
-</ul>
-
-<script data-relocate="true">
-       require(["WoltLabSuite/Core/Form/Builder/Field/Controller/MultilineItemList"], ({ MultilineItemListFormField }) => {
-               {jsphrase name='wcf.acp.option.type.lineBreakSeparatedText.placeholder'}
-               {jsphrase name='wcf.acp.option.type.lineBreakSeparatedText.clearList.confirmMessage'}
-               {jsphrase name='wcf.global.button.save'}
-               {jsphrase name='wcf.global.button.cancel'}
-               {jsphrase name='wcf.global.button.edit'}
-               WoltLabLanguage.registerPhrase("wcf.acp.option.type.lineBreakSeparatedText.error.duplicate", '{jslang __literal=true}wcf.acp.option.type.lineBreakSeparatedText.error.duplicate{/jslang}');
-
-               new MultilineItemListFormField(document.getElementById('lineBreakSeparatedTextOption_{@$field->getPrefixedId()|encodeJS}'), {
-                       submitFieldName: '{@$field->getPrefixedId()|encodeJS}[]',
-               });
-       });
-       {if $field->isFilterable()}
-       require(["WoltLabSuite/Core/Ui/ItemList/Filter"], (UiItemListFilter) => {
-               {jsphrase name='wcf.global.filter.button.visibility'}
-               {jsphrase name='wcf.global.filter.button.clear'}
-               {jsphrase name='wcf.global.filter.error.noMatches'}
-               {jsphrase name='wcf.global.filter.placeholder'}
-               {jsphrase name='wcf.global.filter.visibility.activeOnly'}
-               {jsphrase name='wcf.global.filter.visibility.highlightActive'}
-               {jsphrase name='wcf.global.filter.visibility.showAll'}
-
-               new UiItemListFilter('lineBreakSeparatedTextOption_{@$field->getPrefixedId()|encodeJS}');
-       });
-       {/if}
-</script>
diff --git a/com.woltlab.wcf/templates/shared_multilineItemListFormField.tpl b/com.woltlab.wcf/templates/shared_multilineItemListFormField.tpl
new file mode 100644 (file)
index 0000000..340637a
--- /dev/null
@@ -0,0 +1,44 @@
+<ul class="scrollableCheckboxList" {*
+    *}id="lineBreakSeparatedTextOption_{$field->getPrefixedId()}"{*
+    *}{if $field->getValue()|empty} style="display: none"{/if}{*
+*}>
+       {foreach from=$field->getValue() item=value}
+               <li data-value="{$value}">
+                       <button class="jsDeleteItem jsTooltip" type="button" title="{lang}wcf.global.button.delete{/lang}">
+                               {icon name='trash'}
+                       </button>
+                       <button class="jsEditItem jsTooltip" type="button" title="{lang}wcf.global.button.edit{/lang}">
+                               {icon name='edit'}
+                       </button>
+                       <span>{$value}</span>
+               </li>
+       {/foreach}
+</ul>
+
+<script data-relocate="true">
+       require(["WoltLabSuite/Core/Form/Builder/Field/Controller/MultilineItemList"], ({ MultilineItemListFormField }) => {
+               {jsphrase name='wcf.acp.option.type.lineBreakSeparatedText.placeholder'}
+               {jsphrase name='wcf.acp.option.type.lineBreakSeparatedText.clearList.confirmMessage'}
+               {jsphrase name='wcf.global.button.save'}
+               {jsphrase name='wcf.global.button.cancel'}
+               {jsphrase name='wcf.global.button.edit'}
+               WoltLabLanguage.registerPhrase("wcf.acp.option.type.lineBreakSeparatedText.error.duplicate", '{jslang __literal=true}wcf.acp.option.type.lineBreakSeparatedText.error.duplicate{/jslang}');
+
+               new MultilineItemListFormField(document.getElementById('lineBreakSeparatedTextOption_{@$field->getPrefixedId()|encodeJS}'), {
+                       submitFieldName: '{@$field->getPrefixedId()|encodeJS}[]',
+               });
+       });
+       {if $field->isFilterable()}
+       require(["WoltLabSuite/Core/Ui/ItemList/Filter"], (UiItemListFilter) => {
+               {jsphrase name='wcf.global.filter.button.visibility'}
+               {jsphrase name='wcf.global.filter.button.clear'}
+               {jsphrase name='wcf.global.filter.error.noMatches'}
+               {jsphrase name='wcf.global.filter.placeholder'}
+               {jsphrase name='wcf.global.filter.visibility.activeOnly'}
+               {jsphrase name='wcf.global.filter.visibility.highlightActive'}
+               {jsphrase name='wcf.global.filter.visibility.showAll'}
+
+               new UiItemListFilter('lineBreakSeparatedTextOption_{@$field->getPrefixedId()|encodeJS}');
+       });
+       {/if}
+</script>
diff --git a/wcfsetup/install/files/acp/templates/__multilineItemListFormField.tpl b/wcfsetup/install/files/acp/templates/__multilineItemListFormField.tpl
deleted file mode 100644 (file)
index 340637a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<ul class="scrollableCheckboxList" {*
-    *}id="lineBreakSeparatedTextOption_{$field->getPrefixedId()}"{*
-    *}{if $field->getValue()|empty} style="display: none"{/if}{*
-*}>
-       {foreach from=$field->getValue() item=value}
-               <li data-value="{$value}">
-                       <button class="jsDeleteItem jsTooltip" type="button" title="{lang}wcf.global.button.delete{/lang}">
-                               {icon name='trash'}
-                       </button>
-                       <button class="jsEditItem jsTooltip" type="button" title="{lang}wcf.global.button.edit{/lang}">
-                               {icon name='edit'}
-                       </button>
-                       <span>{$value}</span>
-               </li>
-       {/foreach}
-</ul>
-
-<script data-relocate="true">
-       require(["WoltLabSuite/Core/Form/Builder/Field/Controller/MultilineItemList"], ({ MultilineItemListFormField }) => {
-               {jsphrase name='wcf.acp.option.type.lineBreakSeparatedText.placeholder'}
-               {jsphrase name='wcf.acp.option.type.lineBreakSeparatedText.clearList.confirmMessage'}
-               {jsphrase name='wcf.global.button.save'}
-               {jsphrase name='wcf.global.button.cancel'}
-               {jsphrase name='wcf.global.button.edit'}
-               WoltLabLanguage.registerPhrase("wcf.acp.option.type.lineBreakSeparatedText.error.duplicate", '{jslang __literal=true}wcf.acp.option.type.lineBreakSeparatedText.error.duplicate{/jslang}');
-
-               new MultilineItemListFormField(document.getElementById('lineBreakSeparatedTextOption_{@$field->getPrefixedId()|encodeJS}'), {
-                       submitFieldName: '{@$field->getPrefixedId()|encodeJS}[]',
-               });
-       });
-       {if $field->isFilterable()}
-       require(["WoltLabSuite/Core/Ui/ItemList/Filter"], (UiItemListFilter) => {
-               {jsphrase name='wcf.global.filter.button.visibility'}
-               {jsphrase name='wcf.global.filter.button.clear'}
-               {jsphrase name='wcf.global.filter.error.noMatches'}
-               {jsphrase name='wcf.global.filter.placeholder'}
-               {jsphrase name='wcf.global.filter.visibility.activeOnly'}
-               {jsphrase name='wcf.global.filter.visibility.highlightActive'}
-               {jsphrase name='wcf.global.filter.visibility.showAll'}
-
-               new UiItemListFilter('lineBreakSeparatedTextOption_{@$field->getPrefixedId()|encodeJS}');
-       });
-       {/if}
-</script>
index b00023ea48468854c77583e252ad47967c4d6c4d..837abc8b55b356dca8e5abd80436f7a5176f6bb7 100644 (file)
@@ -17,7 +17,7 @@ class MultilineItemListFormField extends ItemListFormField implements INullableF
     /**
      * @inheritDoc
      */
-    protected $templateName = '__multilineItemListFormField';
+    protected $templateName = 'shared_multilineItemListFormField';
 
     /**
      * @inheritDoc