Move form field templates to shared template-group
authorCyperghost <olaf_schmitz_1@t-online.de>
Thu, 25 Jan 2024 14:22:28 +0000 (15:22 +0100)
committerCyperghost <olaf_schmitz_1@t-online.de>
Thu, 25 Jan 2024 14:22:28 +0000 (15:22 +0100)
18 files changed:
com.woltlab.wcf/acpTemplateDelete.xml
com.woltlab.wcf/templateDelete.xml
com.woltlab.wcf/templates/__captchaFormField.tpl [deleted file]
com.woltlab.wcf/templates/__colorFormField.tpl [deleted file]
com.woltlab.wcf/templates/__formFieldDataHandler.tpl [deleted file]
com.woltlab.wcf/templates/__hiddenFormField.tpl [deleted file]
com.woltlab.wcf/templates/__singleSelectionFormField.tpl [deleted file]
com.woltlab.wcf/templates/shared_captchaFormField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_colorFormField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_formFieldDataHandler.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_hiddenFormField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/shared_singleSelectionFormField.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/__captchaFormField.tpl [deleted file]
wcfsetup/install/files/acp/templates/__colorFormField.tpl [deleted file]
wcfsetup/install/files/acp/templates/__formFieldDataHandler.tpl [deleted file]
wcfsetup/install/files/acp/templates/__hiddenFormField.tpl [deleted file]
wcfsetup/install/files/acp/templates/__simpleAclFormField.tpl [deleted file]
wcfsetup/install/files/acp/templates/__singleSelectionFormField.tpl [deleted file]

index 7a549bd0a3477f7ceb614909c59cb60f940a6742..8f17fe9387e6460f43cc04f0072b68ab84c28f37 100644 (file)
                <template>__wysiwygSmileyFormNode</template>
                <template>__form</template>
                <template>__formField</template>
-               <template>shared_formContainerChildren</template>
-               <template>shared_formContainerDependencies</template>
-               <template>shared_formField</template>
-               <template>shared_formFieldDependencies</template>
-               <template>shared_formFieldDescription</template>
-               <template>shared_formFieldErrors</template>
+               <template>__formContainerChildren</template>
+               <template>__formContainerDependencies</template>
+               <template>__formField</template>
+               <template>__formFieldDependencies</template>
+               <template>__formFieldDescription</template>
+               <template>__formFieldErrors</template>
+               <template>__formFieldDataHandler</template>
        </delete>
 </data>
index 519312a66630e810b8b3aa92a2af06224e3af8cf..30350909a5e32a1bd5018eeeb1ecb21999771fbf 100644 (file)
                <template>__wysiwygSmileyFormNode</template>
                <template>__form</template>
                <template>__formField</template>
-               <template>shared_formContainerChildren</template>
-               <template>shared_formContainerDependencies</template>
-               <template>shared_formField</template>
-               <template>shared_formFieldDependencies</template>
-               <template>shared_formFieldDescription</template>
-               <template>shared_formFieldErrors</template>
+               <template>__formContainerChildren</template>
+               <template>__formContainerDependencies</template>
+               <template>__formField</template>
+               <template>__formFieldDependencies</template>
+               <template>__formFieldDescription</template>
+               <template>__formFieldErrors</template>
+               <template>__formFieldDataHandler</template>
+               <template>__singleSelectionFormField</template>
        </delete>
 </data>
diff --git a/com.woltlab.wcf/templates/__captchaFormField.tpl b/com.woltlab.wcf/templates/__captchaFormField.tpl
deleted file mode 100644 (file)
index f4202f8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{@$field->getObjectType()->getProcessor()->getFormElement()}
diff --git a/com.woltlab.wcf/templates/__colorFormField.tpl b/com.woltlab.wcf/templates/__colorFormField.tpl
deleted file mode 100644 (file)
index c6e6507..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{if $field->isImmutable()}
-    <span class="colorPickerButton">
-        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
-    </span>
-{else}
-    <a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
-        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
-    </a>
-    <input type="hidden" {*
-        *}id="{$field->getPrefixedId()}" {*
-        *}name="{$field->getPrefixedId()}" {*
-        *}value="{$field->getValue()}"{*
-    *}>
-
-    {include file='colorPickerJavaScript'}
-
-    <script data-relocate="true">
-        require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
-            UiColorPicker.fromSelector("#{@$field->getPrefixedId()|encodeJS}_colorPickerButton");
-        });
-    </script>
-{/if}
diff --git a/com.woltlab.wcf/templates/__formFieldDataHandler.tpl b/com.woltlab.wcf/templates/__formFieldDataHandler.tpl
deleted file mode 100644 (file)
index 7fba0f0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{if $field->getDocument()->isAjax() && !$field->getJavaScriptDataHandlerModule()|empty}
-       <script data-relocate="true">
-               require([
-                       'tslib',
-                       '{$field->getJavaScriptDataHandlerModule()}',
-                       'WoltLabSuite/Core/Form/Builder/Manager'
-               ], function(
-                       tslib,
-                       FormBuilderField,
-                       FormBuilderManager
-               ) {
-                       FormBuilderField = tslib.__importDefault(FormBuilderField);
-
-                       FormBuilderManager.registerField(
-                               '{@$field->getDocument()->getId()|encodeJS}',
-                               new (FormBuilderField.default)('{@$field->getPrefixedId()|encodeJS}')
-                       );
-               });
-       </script>
-{/if}
diff --git a/com.woltlab.wcf/templates/__hiddenFormField.tpl b/com.woltlab.wcf/templates/__hiddenFormField.tpl
deleted file mode 100644 (file)
index 0ce240b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<input type="hidden" {*
-       *}id="{$field->getPrefixedId()}" {*
-       *}name="{$field->getPrefixedId()}" {*
-       *}value="{$field->getValue()}"{*
-*}>
diff --git a/com.woltlab.wcf/templates/__singleSelectionFormField.tpl b/com.woltlab.wcf/templates/__singleSelectionFormField.tpl
deleted file mode 100644 (file)
index 7c6b698..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-{if $field->isFilterable()}
-       <script data-relocate="true">
-               require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
-                       Language.addObject({
-                               'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
-                               'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
-                               'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
-                               'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
-                               'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
-                               'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
-                               'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
-                       });
-                       
-                       new UiItemListFilter('{@$field->getPrefixedId()|encodeJS}_list');
-               });
-       </script>
-       
-       <ul class="scrollableCheckboxList" id="{$field->getPrefixedId()}_list">
-               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
-                       <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
-                               <label><input {*
-                                               *}type="radio" {*
-                                               *}name="{$field->getPrefixedId()}" {*
-                                               *}value="{$__fieldNestedOption[value]}"{*
-                                               *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
-                                               *}{if $field->getValue() == $__fieldNestedOption[value] && $__fieldNestedOption[isSelectable]} checked{/if}{*
-                                               *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{*
-                                       *}> {@$__fieldNestedOption[label]}</label>
-                       </li>
-               {/foreach}
-       </ul>
-{else}
-       <select id="{$field->getPrefixedId()}" {*
-               *}name="{$field->getPrefixedId()}"{*
-               *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
-       *}>
-               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
-                       <option {*
-                               *}value="{$__fieldNestedOption[value]}"{*
-                               *}{if $field->getValue() == $__fieldNestedOption[value] && $__fieldNestedOption[isSelectable]} selected{/if}{*
-                               *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{*
-                       *}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
-               {/foreach}
-       </select>
-{/if}
diff --git a/com.woltlab.wcf/templates/shared_captchaFormField.tpl b/com.woltlab.wcf/templates/shared_captchaFormField.tpl
new file mode 100644 (file)
index 0000000..f4202f8
--- /dev/null
@@ -0,0 +1 @@
+{@$field->getObjectType()->getProcessor()->getFormElement()}
diff --git a/com.woltlab.wcf/templates/shared_colorFormField.tpl b/com.woltlab.wcf/templates/shared_colorFormField.tpl
new file mode 100644 (file)
index 0000000..c6e6507
--- /dev/null
@@ -0,0 +1,22 @@
+{if $field->isImmutable()}
+    <span class="colorPickerButton">
+        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
+    </span>
+{else}
+    <a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
+        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
+    </a>
+    <input type="hidden" {*
+        *}id="{$field->getPrefixedId()}" {*
+        *}name="{$field->getPrefixedId()}" {*
+        *}value="{$field->getValue()}"{*
+    *}>
+
+    {include file='colorPickerJavaScript'}
+
+    <script data-relocate="true">
+        require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
+            UiColorPicker.fromSelector("#{@$field->getPrefixedId()|encodeJS}_colorPickerButton");
+        });
+    </script>
+{/if}
diff --git a/com.woltlab.wcf/templates/shared_formFieldDataHandler.tpl b/com.woltlab.wcf/templates/shared_formFieldDataHandler.tpl
new file mode 100644 (file)
index 0000000..7fba0f0
--- /dev/null
@@ -0,0 +1,20 @@
+{if $field->getDocument()->isAjax() && !$field->getJavaScriptDataHandlerModule()|empty}
+       <script data-relocate="true">
+               require([
+                       'tslib',
+                       '{$field->getJavaScriptDataHandlerModule()}',
+                       'WoltLabSuite/Core/Form/Builder/Manager'
+               ], function(
+                       tslib,
+                       FormBuilderField,
+                       FormBuilderManager
+               ) {
+                       FormBuilderField = tslib.__importDefault(FormBuilderField);
+
+                       FormBuilderManager.registerField(
+                               '{@$field->getDocument()->getId()|encodeJS}',
+                               new (FormBuilderField.default)('{@$field->getPrefixedId()|encodeJS}')
+                       );
+               });
+       </script>
+{/if}
diff --git a/com.woltlab.wcf/templates/shared_hiddenFormField.tpl b/com.woltlab.wcf/templates/shared_hiddenFormField.tpl
new file mode 100644 (file)
index 0000000..0ce240b
--- /dev/null
@@ -0,0 +1,5 @@
+<input type="hidden" {*
+       *}id="{$field->getPrefixedId()}" {*
+       *}name="{$field->getPrefixedId()}" {*
+       *}value="{$field->getValue()}"{*
+*}>
diff --git a/com.woltlab.wcf/templates/shared_singleSelectionFormField.tpl b/com.woltlab.wcf/templates/shared_singleSelectionFormField.tpl
new file mode 100644 (file)
index 0000000..7c6b698
--- /dev/null
@@ -0,0 +1,45 @@
+{if $field->isFilterable()}
+       <script data-relocate="true">
+               require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
+                       Language.addObject({
+                               'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
+                               'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
+                               'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
+                               'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
+                               'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
+                               'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
+                               'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
+                       });
+                       
+                       new UiItemListFilter('{@$field->getPrefixedId()|encodeJS}_list');
+               });
+       </script>
+       
+       <ul class="scrollableCheckboxList" id="{$field->getPrefixedId()}_list">
+               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
+                       <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
+                               <label><input {*
+                                               *}type="radio" {*
+                                               *}name="{$field->getPrefixedId()}" {*
+                                               *}value="{$__fieldNestedOption[value]}"{*
+                                               *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
+                                               *}{if $field->getValue() == $__fieldNestedOption[value] && $__fieldNestedOption[isSelectable]} checked{/if}{*
+                                               *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{*
+                                       *}> {@$__fieldNestedOption[label]}</label>
+                       </li>
+               {/foreach}
+       </ul>
+{else}
+       <select id="{$field->getPrefixedId()}" {*
+               *}name="{$field->getPrefixedId()}"{*
+               *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
+       *}>
+               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
+                       <option {*
+                               *}value="{$__fieldNestedOption[value]}"{*
+                               *}{if $field->getValue() == $__fieldNestedOption[value] && $__fieldNestedOption[isSelectable]} selected{/if}{*
+                               *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{*
+                       *}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
+               {/foreach}
+       </select>
+{/if}
diff --git a/wcfsetup/install/files/acp/templates/__captchaFormField.tpl b/wcfsetup/install/files/acp/templates/__captchaFormField.tpl
deleted file mode 100644 (file)
index f4202f8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-{@$field->getObjectType()->getProcessor()->getFormElement()}
diff --git a/wcfsetup/install/files/acp/templates/__colorFormField.tpl b/wcfsetup/install/files/acp/templates/__colorFormField.tpl
deleted file mode 100644 (file)
index c6e6507..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-{if $field->isImmutable()}
-    <span class="colorPickerButton">
-        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
-    </span>
-{else}
-    <a href="#" class="colorPickerButton jsTooltip" id="{$field->getPrefixedId()}_colorPickerButton" title="{lang}wcf.style.colorPicker.button.changeColor{/lang}" data-store="{$field->getPrefixedId()}">
-        <span{if $field->getValue()} style="background-color: {$field->getValue()}"{/if}></span>
-    </a>
-    <input type="hidden" {*
-        *}id="{$field->getPrefixedId()}" {*
-        *}name="{$field->getPrefixedId()}" {*
-        *}value="{$field->getValue()}"{*
-    *}>
-
-    {include file='colorPickerJavaScript'}
-
-    <script data-relocate="true">
-        require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
-            UiColorPicker.fromSelector("#{@$field->getPrefixedId()|encodeJS}_colorPickerButton");
-        });
-    </script>
-{/if}
diff --git a/wcfsetup/install/files/acp/templates/__formFieldDataHandler.tpl b/wcfsetup/install/files/acp/templates/__formFieldDataHandler.tpl
deleted file mode 100644 (file)
index 7fba0f0..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-{if $field->getDocument()->isAjax() && !$field->getJavaScriptDataHandlerModule()|empty}
-       <script data-relocate="true">
-               require([
-                       'tslib',
-                       '{$field->getJavaScriptDataHandlerModule()}',
-                       'WoltLabSuite/Core/Form/Builder/Manager'
-               ], function(
-                       tslib,
-                       FormBuilderField,
-                       FormBuilderManager
-               ) {
-                       FormBuilderField = tslib.__importDefault(FormBuilderField);
-
-                       FormBuilderManager.registerField(
-                               '{@$field->getDocument()->getId()|encodeJS}',
-                               new (FormBuilderField.default)('{@$field->getPrefixedId()|encodeJS}')
-                       );
-               });
-       </script>
-{/if}
diff --git a/wcfsetup/install/files/acp/templates/__hiddenFormField.tpl b/wcfsetup/install/files/acp/templates/__hiddenFormField.tpl
deleted file mode 100644 (file)
index 0ce240b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<input type="hidden" {*
-       *}id="{$field->getPrefixedId()}" {*
-       *}name="{$field->getPrefixedId()}" {*
-       *}value="{$field->getValue()}"{*
-*}>
diff --git a/wcfsetup/install/files/acp/templates/__simpleAclFormField.tpl b/wcfsetup/install/files/acp/templates/__simpleAclFormField.tpl
deleted file mode 100644 (file)
index f24fac9..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-{include file='aclSimple'}
-
-{include file='__formFieldDataHandler'}
diff --git a/wcfsetup/install/files/acp/templates/__singleSelectionFormField.tpl b/wcfsetup/install/files/acp/templates/__singleSelectionFormField.tpl
deleted file mode 100644 (file)
index 7c6b698..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-{if $field->isFilterable()}
-       <script data-relocate="true">
-               require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
-                       Language.addObject({
-                               'wcf.global.filter.button.visibility': '{jslang}wcf.global.filter.button.visibility{/jslang}',
-                               'wcf.global.filter.button.clear': '{jslang}wcf.global.filter.button.clear{/jslang}',
-                               'wcf.global.filter.error.noMatches': '{jslang}wcf.global.filter.error.noMatches{/jslang}',
-                               'wcf.global.filter.placeholder': '{jslang}wcf.global.filter.placeholder{/jslang}',
-                               'wcf.global.filter.visibility.activeOnly': '{jslang}wcf.global.filter.visibility.activeOnly{/jslang}',
-                               'wcf.global.filter.visibility.highlightActive': '{jslang}wcf.global.filter.visibility.highlightActive{/jslang}',
-                               'wcf.global.filter.visibility.showAll': '{jslang}wcf.global.filter.visibility.showAll{/jslang}'
-                       });
-                       
-                       new UiItemListFilter('{@$field->getPrefixedId()|encodeJS}_list');
-               });
-       </script>
-       
-       <ul class="scrollableCheckboxList" id="{$field->getPrefixedId()}_list">
-               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
-                       <li{if $__fieldNestedOption[depth] > 0} style="padding-left: {$__fieldNestedOption[depth]*20}px"{/if}>
-                               <label><input {*
-                                               *}type="radio" {*
-                                               *}name="{$field->getPrefixedId()}" {*
-                                               *}value="{$__fieldNestedOption[value]}"{*
-                                               *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
-                                               *}{if $field->getValue() == $__fieldNestedOption[value] && $__fieldNestedOption[isSelectable]} checked{/if}{*
-                                               *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{*
-                                       *}> {@$__fieldNestedOption[label]}</label>
-                       </li>
-               {/foreach}
-       </ul>
-{else}
-       <select id="{$field->getPrefixedId()}" {*
-               *}name="{$field->getPrefixedId()}"{*
-               *}{if !$field->getFieldClasses()|empty} class="{implode from=$field->getFieldClasses() item='class' glue=' '}{$class}{/implode}"{/if}{*
-       *}>
-               {foreach from=$field->getNestedOptions() item=__fieldNestedOption}
-                       <option {*
-                               *}value="{$__fieldNestedOption[value]}"{*
-                               *}{if $field->getValue() == $__fieldNestedOption[value] && $__fieldNestedOption[isSelectable]} selected{/if}{*
-                               *}{if $field->isImmutable() || !$__fieldNestedOption[isSelectable]} disabled{/if}{*
-                       *}>{@'&nbsp;'|str_repeat:$__fieldNestedOption[depth] * 4}{@$__fieldNestedOption[label]}</option>
-               {/foreach}
-       </select>
-{/if}