Add IFormField::getFieldHtml()
authorMatthias Schmidt <gravatronics@live.com>
Sat, 5 Oct 2019 14:35:36 +0000 (16:35 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 5 Oct 2019 14:35:36 +0000 (16:35 +0200)
Close #3085

56 files changed:
com.woltlab.wcf/templates/__aclFormField.tpl
com.woltlab.wcf/templates/__booleanFormField.tpl
com.woltlab.wcf/templates/__contentLanguageFormField.tpl
com.woltlab.wcf/templates/__dateFormField.tpl
com.woltlab.wcf/templates/__emailFormField.tpl
com.woltlab.wcf/templates/__formField.tpl [new file with mode: 0644]
com.woltlab.wcf/templates/__formFieldFooter.tpl [deleted file]
com.woltlab.wcf/templates/__formFieldHeader.tpl [deleted file]
com.woltlab.wcf/templates/__iconFormField.tpl
com.woltlab.wcf/templates/__itemListFormField.tpl
com.woltlab.wcf/templates/__labelFormField.tpl
com.woltlab.wcf/templates/__multilineTextFormField.tpl
com.woltlab.wcf/templates/__multipleSelectionFormField.tpl
com.woltlab.wcf/templates/__numericFormField.tpl
com.woltlab.wcf/templates/__pollOptionsFormField.tpl
com.woltlab.wcf/templates/__radioButtonFormField.tpl
com.woltlab.wcf/templates/__ratingFormField.tpl
com.woltlab.wcf/templates/__singleMediaSelectionFormField.tpl
com.woltlab.wcf/templates/__singleSelectionFormField.tpl
com.woltlab.wcf/templates/__tagFormField.tpl
com.woltlab.wcf/templates/__textFormField.tpl
com.woltlab.wcf/templates/__uploadFormField.tpl
com.woltlab.wcf/templates/__userFormField.tpl
com.woltlab.wcf/templates/__usernameFormField.tpl
com.woltlab.wcf/templates/__wysiwygAttachmentFormField.tpl
com.woltlab.wcf/templates/__wysiwygFormField.tpl
wcfsetup/install/files/acp/templates/__aclFormField.tpl
wcfsetup/install/files/acp/templates/__booleanFormField.tpl
wcfsetup/install/files/acp/templates/__contentLanguageFormField.tpl
wcfsetup/install/files/acp/templates/__dateFormField.tpl
wcfsetup/install/files/acp/templates/__emailFormField.tpl
wcfsetup/install/files/acp/templates/__formField.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/__formFieldFooter.tpl [deleted file]
wcfsetup/install/files/acp/templates/__formFieldHeader.tpl [deleted file]
wcfsetup/install/files/acp/templates/__iconFormField.tpl
wcfsetup/install/files/acp/templates/__itemListFormField.tpl
wcfsetup/install/files/acp/templates/__labelFormField.tpl
wcfsetup/install/files/acp/templates/__multilineTextFormField.tpl
wcfsetup/install/files/acp/templates/__multipleSelectionFormField.tpl
wcfsetup/install/files/acp/templates/__numericFormField.tpl
wcfsetup/install/files/acp/templates/__pollOptionsFormField.tpl
wcfsetup/install/files/acp/templates/__radioButtonFormField.tpl
wcfsetup/install/files/acp/templates/__ratingFormField.tpl
wcfsetup/install/files/acp/templates/__singleMediaSelectionFormField.tpl
wcfsetup/install/files/acp/templates/__singleSelectionFormField.tpl
wcfsetup/install/files/acp/templates/__tagFormField.tpl
wcfsetup/install/files/acp/templates/__textFormField.tpl
wcfsetup/install/files/acp/templates/__uploadFormField.tpl
wcfsetup/install/files/acp/templates/__userFormField.tpl
wcfsetup/install/files/acp/templates/__usernameFormField.tpl
wcfsetup/install/files/acp/templates/__wysiwygAttachmentFormField.tpl
wcfsetup/install/files/acp/templates/__wysiwygFormField.tpl
wcfsetup/install/files/lib/system/form/builder/field/AbstractFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/IFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/UploadFormField.class.php
wcfsetup/install/files/lib/system/form/builder/field/wysiwyg/WysiwygFormField.class.php

index 16b053dcbc8e3b625a8461f8e39c3ab1545c2397..033074374bee6b64613b3e6dd7f808fc34fa5bff 100644 (file)
@@ -1,9 +1,5 @@
-{include file='__formFieldHeader'}
-
 {if $includeAclJavaScript}
        {include file='aclPermissions'}
 {/if}
 
 {include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID}
-
-{include file='__formFieldFooter'}
index da10fb6550f508c2b63cc053d3032752ab8e3668..af28e8e8214d461f79bdbaeeeaf7c22c270fdd96 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ol class="flexibleButtonGroup">
        <li>
                <input type="radio" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="1" data-no-input-id="{@$field->getPrefixedId()}_no"{if $field->isAutofocused()} autofocus{/if}{if $field->isRequired()} required{/if}{if $field->isImmutable()} disabled{/if}{if $field->getValue()} checked{/if}>
@@ -10,5 +8,3 @@
                <label for="{@$field->getPrefixedId()}_no" class="red"><span class="icon icon16 fa-times"></span> {lang}wcf.global.form.boolean.no{/lang}</label>
        </li>
 </ol>
-
-{include file='__formFieldFooter'}
index f26a83a1a292cfe020e34d4006554505eff7c32b..ff0b8e3db7004f846861aa66d10009fedff143a2 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <noscript>
        <select name="{@$field->getPrefixedId()}" id="{@$field->getPrefixedId()}"{if $field->isImmutable()} disabled{/if}>
                {if !$field->isRequired()}
@@ -32,5 +30,3 @@
                )
        });
 </script>
-
-{include file='__formFieldFooter'}
index 3fe9d8d6beefb669ac4d2ed92f112908717b414d..c5a4218ad07f38e9509183c17d4c3d934a6f3f5d 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input {*
        *}type="{if $field->supportsTime()}datetime{else}date{/if}" {*
        *}id="{@$field->getPrefixedId()}" {*
@@ -12,5 +10,3 @@
        *}{if $field->getEarliestDate() !== null} min="{$dateFormFieldEarliestDate}"{/if}{*
        *}{if $field->getLatestDate() !== null} max="{$dateFormFieldLatestDate}"{/if}{*
 *}>
-
-{include file='__formFieldFooter'}
index 7f62e54a92d2ddb33707a94c1c53f2bba3c32a06..af84b97ea7832472744753017256faf22a47fefb 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="email" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -16,5 +14,3 @@
 {if $field->isI18n()}
        {include file='multipleLanguageInputJavascript'}
 {/if}
-
-{include file='__formFieldFooter'}
diff --git a/com.woltlab.wcf/templates/__formField.tpl b/com.woltlab.wcf/templates/__formField.tpl
new file mode 100644 (file)
index 0000000..d726d5a
--- /dev/null
@@ -0,0 +1,11 @@
+<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
+       <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
+       <dd>
+               {@$field->getFieldHtml()}
+               
+               {include file='__formFieldDescription'}
+               {include file='__formFieldErrors'}
+               {include file='__formFieldDependencies'}
+               {include file='__formFieldDataHandler'}
+       </dd>
+</dl>
diff --git a/com.woltlab.wcf/templates/__formFieldFooter.tpl b/com.woltlab.wcf/templates/__formFieldFooter.tpl
deleted file mode 100644 (file)
index f420d74..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-               {include file='__formFieldDescription'}
-               {include file='__formFieldErrors'}
-               {include file='__formFieldDependencies'}
-               {include file='__formFieldDataHandler'}
-       </dd>
-</dl>
diff --git a/com.woltlab.wcf/templates/__formFieldHeader.tpl b/com.woltlab.wcf/templates/__formFieldHeader.tpl
deleted file mode 100644 (file)
index 41def24..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
-       <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
-       <dd>
index b8c8d2535de661cb879692d7a91f53c73c966bae..620cf56812d9a90d609c2ebee816bbe339936c24 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <span{if $field->getValue()} class="icon icon64 fa-{$field->getValue()}"{/if} id="{@$field->getPrefixedId()}_icon"></span>
 {if !$field->isImmutable()}
        <a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
@@ -30,5 +28,3 @@
                });
        </script>
 {/if}
-
-{include file='__formFieldFooter'}
index 7c43cc017a172a470e866c9e5fe7ed1f787280ff..eb512c27791deb87a88402f8d1f33de23980a68c 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" class="long"{if $field->isAutofocused()} autofocus{/if}{if $field->isImmutable()} disabled{/if}>
 
 <script data-relocate="true">
@@ -14,5 +12,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index 13068c1c5abdf25a6eceade6e40b63543ca5e9d2..90bde6516f307ddc3b32f678cdb75cd9f26470ec 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ul class="labelList jsOnly" data-object-id="{@$field->getLabelGroup()->groupID}">
        <li class="dropdown labelChooser" data-group-id="{@$field->getLabelGroup()->groupID}">
                <div class="dropdownToggle" data-toggle="labelGroup{@$field->getLabelGroup()->groupID}">
@@ -41,5 +39,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index 87f4ea315132d3077920c47514f963eb98edec7f..dfd907b6408e1a0274583b702ef7421e22aa2878 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <textarea id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}rows="{@$field->getRows()}"{*
@@ -14,5 +12,3 @@
 {if $field->isI18n()}
        {include file='multipleLanguageInputJavascript'}
 {/if}
-
-{include file='__formFieldFooter'}
index f6afdf6be3873b63e3cace60ed15adeab4716c85..81e6cdcc7d7ded7ffbc0fa638077c5cbcfca4ce4 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->isFilterable()}
        <script data-relocate="true">
                require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
@@ -42,5 +40,3 @@
                </label>
        {/foreach}
 {/if}
-
-{include file='__formFieldFooter'}
index 0cf95031b3dd6117c6d1ee1e53156d3bcbc9dff9..88c20257df06b4ef007e114f09c4ced1186eb000 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->getSuffix() !== null}
        <div class="inputAddon">
 {/if}
@@ -23,5 +21,3 @@
                <span class="inputSuffix">{@$field->getSuffix()}</span>
        </div>
 {/if}
-
-{include file='__formFieldFooter'}
index 218c479c99f7734f26ef037d7c305bd7676cbf15..290b083de0d5b4649031a1d7044ab043e1ecacc5 100644 (file)
@@ -1,9 +1,5 @@
-{include file='__formFieldHeader'}
-
 <ol class="sortableList"></ol>
 
-{include file='__formFieldFooter'}
-
 <script data-relocate="true">
        require(['Dom/Traverse', 'Dom/Util', 'Language', 'WoltLabSuite/Core/Ui/Poll/Editor'], function(DomTraverse, DomUtil, Language, UiPollEditor) {
                Language.addObject({
index 1fb80cba9d4ea7034bf2a2cc1f6f70c28d6da6b4..6080d1d43d0f31719e1c08512022483f2b3bb436 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {foreach from=$field->getOptions() key=$__fieldValue item=__fieldLabel}
        <label>
                <input {*
@@ -11,5 +9,3 @@
                *}> {@$__fieldLabel}
        </label>
 {/foreach}
-
-{include file='__formFieldFooter'}
index d1d8ded8e7e6efb7120e24eb7ab0b422403fc8a5..cbf631a560e053d14f4c56977e8ad2c186ef214e 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ul class="ratingList jsOnly">
        {foreach from=$field->getRatings() item=rating}
                <li data-rating="{@$rating}"><span class="icon icon24 {if $rating <= $field->getValue()}{implode from=$field->getActiveCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{else}{implode from=$field->getDefaultCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{/if} pointer jsTooltip" title="{lang maximumRating=$field->getMaximum()}wcf.form.field.rating.ratingTitle{/lang}"></span></li>
@@ -26,5 +24,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index e48f0a0052e61da905f87ee9975a2d7aa8cd9601..6b9869638d6ac98fa0893e4cba4e1a2fa405cbb8 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->isImmutable() && $field->getValue()}
        {if $field->getMedia()->isImage && $field->getMedia()->hasThumbnail('small')}
                <div id="{@$field->getPrefixedId()}_preview" class="selectedImagePreview">
@@ -37,5 +35,3 @@
                });
        </script>
 {/if}
-
-{include file='__formFieldFooter'}
index 12be157cc99addb63cbc3589830634d5008e54ac..c3209915a6fda7dc309a26d358e190210a375bd0 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->isFilterable()}
        <script data-relocate="true">
                require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
@@ -42,5 +40,3 @@
                {/foreach}
        </select>
 {/if}
-
-{include file='__formFieldFooter'}
index 1b0f6c7a35f21fdec42e2d31a85c820e2957eb35..09d380ab4d977812651b919f4b4bf7973e34d594 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input id="{@$field->getPrefixedId()}" type="text" value="" class="long">
 
 <script data-relocate="true">
@@ -17,5 +15,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index ec09c659d105ba2f4444c7e3201fb78002282bcd..44a3cda275abe7e7705290d85e7b4477a65cae30 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -17,5 +15,3 @@
 {if $field->isI18n()}
        {include file='multipleLanguageInputJavascript'}
 {/if}
-
-{include file='__formFieldFooter'}
index 83bcc45a1351228224c0d88a2f2b50164187487e..b03d8df2162c7bff1fcd283bc42a20d1c3446cf7 100644 (file)
@@ -1,5 +1 @@
-{include file='__formFieldHeader'}
-
 {@$__wcf->getUploadHandler()->renderField($field->getPrefixedId())}
-
-{include file='__formFieldFooter'}
index 8247c9425b5541ecc8281a1775647d49ffa9c9c0..9b4aa2ee4fafbb1d9bc3e079c39065ef6b2673c4 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -18,5 +16,3 @@
                });
        });
 </script>
-
-{include file='__formFieldFooter'}
index a857c80246713f07426eb2950f7810b2554381c1..4df1dfda1608d4c4c7db8ac7df422c86e1e23778 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -13,5 +11,3 @@
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
 *}>
-
-{include file='__formFieldFooter'}
index 0b434700f68ed7fe751118993abb6ee63c562f0d..03a1f583e2150ea6da7658b2f4243865d30f064d 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ul id="{@$field->getPrefixedID()}_attachmentList" {*
        *}class="formAttachmentList"{*
        *}{if !$field->getAttachmentHandler()->getAttachmentList()|count} style="display: none"{/if} {*
@@ -72,5 +70,3 @@
 </script>
 
 <input type="hidden" id="{@$field->getPrefixedID()}_tmpHash" name="{@$field->getPrefixedID()}_tmpHash" value="{$field->getAttachmentHandler()->getTmpHashes()[0]}">
-
-{include file='__formFieldFooter'}
index 4be47d081246fd07f201b76c7d015fa23237a3d4..0f53638aa121efc3e1c99dbbd965d87ece3b5575 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <textarea {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -38,5 +36,3 @@
                });
        </script>
 {/if}
-
-{include file='__formFieldFooter'}
index 16b053dcbc8e3b625a8461f8e39c3ab1545c2397..033074374bee6b64613b3e6dd7f808fc34fa5bff 100644 (file)
@@ -1,9 +1,5 @@
-{include file='__formFieldHeader'}
-
 {if $includeAclJavaScript}
        {include file='aclPermissions'}
 {/if}
 
 {include file='aclPermissionJavaScript' containerID=$field->getPrefixedId()|concat:'Container' categoryName=$field->getCategoryName() objectID=$field->getObjectID() objectTypeID=$field->getObjectType()->objectTypeID}
-
-{include file='__formFieldFooter'}
index da10fb6550f508c2b63cc053d3032752ab8e3668..af28e8e8214d461f79bdbaeeeaf7c22c270fdd96 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ol class="flexibleButtonGroup">
        <li>
                <input type="radio" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" value="1" data-no-input-id="{@$field->getPrefixedId()}_no"{if $field->isAutofocused()} autofocus{/if}{if $field->isRequired()} required{/if}{if $field->isImmutable()} disabled{/if}{if $field->getValue()} checked{/if}>
@@ -10,5 +8,3 @@
                <label for="{@$field->getPrefixedId()}_no" class="red"><span class="icon icon16 fa-times"></span> {lang}wcf.global.form.boolean.no{/lang}</label>
        </li>
 </ol>
-
-{include file='__formFieldFooter'}
index f26a83a1a292cfe020e34d4006554505eff7c32b..ff0b8e3db7004f846861aa66d10009fedff143a2 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <noscript>
        <select name="{@$field->getPrefixedId()}" id="{@$field->getPrefixedId()}"{if $field->isImmutable()} disabled{/if}>
                {if !$field->isRequired()}
@@ -32,5 +30,3 @@
                )
        });
 </script>
-
-{include file='__formFieldFooter'}
index 3fe9d8d6beefb669ac4d2ed92f112908717b414d..c5a4218ad07f38e9509183c17d4c3d934a6f3f5d 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input {*
        *}type="{if $field->supportsTime()}datetime{else}date{/if}" {*
        *}id="{@$field->getPrefixedId()}" {*
@@ -12,5 +10,3 @@
        *}{if $field->getEarliestDate() !== null} min="{$dateFormFieldEarliestDate}"{/if}{*
        *}{if $field->getLatestDate() !== null} max="{$dateFormFieldLatestDate}"{/if}{*
 *}>
-
-{include file='__formFieldFooter'}
index 7f62e54a92d2ddb33707a94c1c53f2bba3c32a06..af84b97ea7832472744753017256faf22a47fefb 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="email" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -16,5 +14,3 @@
 {if $field->isI18n()}
        {include file='multipleLanguageInputJavascript'}
 {/if}
-
-{include file='__formFieldFooter'}
diff --git a/wcfsetup/install/files/acp/templates/__formField.tpl b/wcfsetup/install/files/acp/templates/__formField.tpl
new file mode 100644 (file)
index 0000000..d726d5a
--- /dev/null
@@ -0,0 +1,11 @@
+<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
+       <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
+       <dd>
+               {@$field->getFieldHtml()}
+               
+               {include file='__formFieldDescription'}
+               {include file='__formFieldErrors'}
+               {include file='__formFieldDependencies'}
+               {include file='__formFieldDataHandler'}
+       </dd>
+</dl>
diff --git a/wcfsetup/install/files/acp/templates/__formFieldFooter.tpl b/wcfsetup/install/files/acp/templates/__formFieldFooter.tpl
deleted file mode 100644 (file)
index f420d74..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-               {include file='__formFieldDescription'}
-               {include file='__formFieldErrors'}
-               {include file='__formFieldDependencies'}
-               {include file='__formFieldDataHandler'}
-       </dd>
-</dl>
diff --git a/wcfsetup/install/files/acp/templates/__formFieldHeader.tpl b/wcfsetup/install/files/acp/templates/__formFieldHeader.tpl
deleted file mode 100644 (file)
index 41def24..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-<dl id="{@$field->getPrefixedId()}Container" {if !$field->getClasses()|empty} class="{implode from=$field->getClasses() item='class' glue=' '}{$class}{/implode}"{/if}{foreach from=$field->getAttributes() key='attributeName' item='attributeValue'} {$attributeName}="{$attributeValue}"{/foreach}{if !$field->checkDependencies()} style="display: none;"{/if}>
-       <dt>{if $field->getLabel() !== null}<label for="{@$field->getPrefixedId()}">{@$field->getLabel()}</label>{/if}</dt>
-       <dd>
index b8c8d2535de661cb879692d7a91f53c73c966bae..620cf56812d9a90d609c2ebee816bbe339936c24 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <span{if $field->getValue()} class="icon icon64 fa-{$field->getValue()}"{/if} id="{@$field->getPrefixedId()}_icon"></span>
 {if !$field->isImmutable()}
        <a href="#" class="button small" id="{@$field->getPrefixedId()}_openIconDialog">{lang}wcf.global.button.edit{/lang}</a>
@@ -30,5 +28,3 @@
                });
        </script>
 {/if}
-
-{include file='__formFieldFooter'}
index 7c43cc017a172a470e866c9e5fe7ed1f787280ff..eb512c27791deb87a88402f8d1f33de23980a68c 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" id="{@$field->getPrefixedId()}" name="{@$field->getPrefixedId()}" class="long"{if $field->isAutofocused()} autofocus{/if}{if $field->isImmutable()} disabled{/if}>
 
 <script data-relocate="true">
@@ -14,5 +12,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index 13068c1c5abdf25a6eceade6e40b63543ca5e9d2..90bde6516f307ddc3b32f678cdb75cd9f26470ec 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ul class="labelList jsOnly" data-object-id="{@$field->getLabelGroup()->groupID}">
        <li class="dropdown labelChooser" data-group-id="{@$field->getLabelGroup()->groupID}">
                <div class="dropdownToggle" data-toggle="labelGroup{@$field->getLabelGroup()->groupID}">
@@ -41,5 +39,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index 87f4ea315132d3077920c47514f963eb98edec7f..dfd907b6408e1a0274583b702ef7421e22aa2878 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <textarea id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
        *}rows="{@$field->getRows()}"{*
@@ -14,5 +12,3 @@
 {if $field->isI18n()}
        {include file='multipleLanguageInputJavascript'}
 {/if}
-
-{include file='__formFieldFooter'}
index f6afdf6be3873b63e3cace60ed15adeab4716c85..81e6cdcc7d7ded7ffbc0fa638077c5cbcfca4ce4 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->isFilterable()}
        <script data-relocate="true">
                require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
@@ -42,5 +40,3 @@
                </label>
        {/foreach}
 {/if}
-
-{include file='__formFieldFooter'}
index 0cf95031b3dd6117c6d1ee1e53156d3bcbc9dff9..88c20257df06b4ef007e114f09c4ced1186eb000 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->getSuffix() !== null}
        <div class="inputAddon">
 {/if}
@@ -23,5 +21,3 @@
                <span class="inputSuffix">{@$field->getSuffix()}</span>
        </div>
 {/if}
-
-{include file='__formFieldFooter'}
index 218c479c99f7734f26ef037d7c305bd7676cbf15..290b083de0d5b4649031a1d7044ab043e1ecacc5 100644 (file)
@@ -1,9 +1,5 @@
-{include file='__formFieldHeader'}
-
 <ol class="sortableList"></ol>
 
-{include file='__formFieldFooter'}
-
 <script data-relocate="true">
        require(['Dom/Traverse', 'Dom/Util', 'Language', 'WoltLabSuite/Core/Ui/Poll/Editor'], function(DomTraverse, DomUtil, Language, UiPollEditor) {
                Language.addObject({
index 1fb80cba9d4ea7034bf2a2cc1f6f70c28d6da6b4..6080d1d43d0f31719e1c08512022483f2b3bb436 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {foreach from=$field->getOptions() key=$__fieldValue item=__fieldLabel}
        <label>
                <input {*
@@ -11,5 +9,3 @@
                *}> {@$__fieldLabel}
        </label>
 {/foreach}
-
-{include file='__formFieldFooter'}
index d1d8ded8e7e6efb7120e24eb7ab0b422403fc8a5..cbf631a560e053d14f4c56977e8ad2c186ef214e 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ul class="ratingList jsOnly">
        {foreach from=$field->getRatings() item=rating}
                <li data-rating="{@$rating}"><span class="icon icon24 {if $rating <= $field->getValue()}{implode from=$field->getActiveCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{else}{implode from=$field->getDefaultCssClasses() item=cssClass glue=' '}{@$cssClass}{/implode}{/if} pointer jsTooltip" title="{lang maximumRating=$field->getMaximum()}wcf.form.field.rating.ratingTitle{/lang}"></span></li>
@@ -26,5 +24,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index e48f0a0052e61da905f87ee9975a2d7aa8cd9601..6b9869638d6ac98fa0893e4cba4e1a2fa405cbb8 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->isImmutable() && $field->getValue()}
        {if $field->getMedia()->isImage && $field->getMedia()->hasThumbnail('small')}
                <div id="{@$field->getPrefixedId()}_preview" class="selectedImagePreview">
@@ -37,5 +35,3 @@
                });
        </script>
 {/if}
-
-{include file='__formFieldFooter'}
index 12be157cc99addb63cbc3589830634d5008e54ac..c3209915a6fda7dc309a26d358e190210a375bd0 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 {if $field->isFilterable()}
        <script data-relocate="true">
                require(['Language', 'WoltLabSuite/Core/Ui/ItemList/Filter'], function(Language, UiItemListFilter) {
@@ -42,5 +40,3 @@
                {/foreach}
        </select>
 {/if}
-
-{include file='__formFieldFooter'}
index 1b0f6c7a35f21fdec42e2d31a85c820e2957eb35..09d380ab4d977812651b919f4b4bf7973e34d594 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input id="{@$field->getPrefixedId()}" type="text" value="" class="long">
 
 <script data-relocate="true">
@@ -17,5 +15,3 @@
                );
        });
 </script>
-
-{include file='__formFieldFooter'}
index ec09c659d105ba2f4444c7e3201fb78002282bcd..44a3cda275abe7e7705290d85e7b4477a65cae30 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -17,5 +15,3 @@
 {if $field->isI18n()}
        {include file='multipleLanguageInputJavascript'}
 {/if}
-
-{include file='__formFieldFooter'}
index 83bcc45a1351228224c0d88a2f2b50164187487e..b03d8df2162c7bff1fcd283bc42a20d1c3446cf7 100644 (file)
@@ -1,5 +1 @@
-{include file='__formFieldHeader'}
-
 {@$__wcf->getUploadHandler()->renderField($field->getPrefixedId())}
-
-{include file='__formFieldFooter'}
index 8247c9425b5541ecc8281a1775647d49ffa9c9c0..9b4aa2ee4fafbb1d9bc3e079c39065ef6b2673c4 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -18,5 +16,3 @@
                });
        });
 </script>
-
-{include file='__formFieldFooter'}
index a857c80246713f07426eb2950f7810b2554381c1..4df1dfda1608d4c4c7db8ac7df422c86e1e23778 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <input type="text" {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -13,5 +11,3 @@
        *}{if $field->getPlaceholder() !== null} placeholder="{$field->getPlaceholder()}"{/if}{*
        *}{if $field->getDocument()->isAjax()} data-dialog-submit-on-enter="true"{/if}{*
 *}>
-
-{include file='__formFieldFooter'}
index 0b434700f68ed7fe751118993abb6ee63c562f0d..03a1f583e2150ea6da7658b2f4243865d30f064d 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <ul id="{@$field->getPrefixedID()}_attachmentList" {*
        *}class="formAttachmentList"{*
        *}{if !$field->getAttachmentHandler()->getAttachmentList()|count} style="display: none"{/if} {*
@@ -72,5 +70,3 @@
 </script>
 
 <input type="hidden" id="{@$field->getPrefixedID()}_tmpHash" name="{@$field->getPrefixedID()}_tmpHash" value="{$field->getAttachmentHandler()->getTmpHashes()[0]}">
-
-{include file='__formFieldFooter'}
index 4be47d081246fd07f201b76c7d015fa23237a3d4..0f53638aa121efc3e1c99dbbd965d87ece3b5575 100644 (file)
@@ -1,5 +1,3 @@
-{include file='__formFieldHeader'}
-
 <textarea {*
        *}id="{@$field->getPrefixedId()}" {*
        *}name="{@$field->getPrefixedId()}" {*
@@ -38,5 +36,3 @@
                });
        </script>
 {/if}
-
-{include file='__formFieldFooter'}
index 1f016034b59b64dc16bf01d24fdfac93c84328c0..3d546d088e09d4c0ba3c13144ba9d9100c6787eb 100644 (file)
@@ -92,17 +92,32 @@ abstract class AbstractFormField implements IFormField {
        /**
         * @inheritDoc
         */
-       public function getHtml() {
+       public function getFieldHtml() {
                if ($this->templateName === null) {
                        throw new \LogicException("\$templateName property has not been set for class '" . static::class . "'.");
                }
                
+               return WCF::getTPL()->fetch(
+                       $this->templateName,
+                       'wcf',
+                       array_merge($this->getHtmlVariables(), [
+                               'field' => $this,
+                               'javaScriptDataHandlerModule' => $this->javaScriptDataHandlerModule
+                       ]),
+                       true
+               );
+       }
+       
+       /**
+        * @inheritDoc
+        */
+       public function getHtml() {
                if ($this->requiresLabel() && $this->getLabel() === null) {
                        throw new \UnexpectedValueException("Form field '{$this->getPrefixedId()}' requires a label.");
                }
                
                return WCF::getTPL()->fetch(
-                       $this->templateName,
+                       '__formField',
                        'wcf',
                        array_merge($this->getHtmlVariables(), [
                                'field' => $this,
index 0521237759c0689365feef75e152ac6da06d6766..f18122fa997fd44bc66b29f78d38354a10cac300 100644 (file)
@@ -32,6 +32,14 @@ interface IFormField extends IFormChildNode, IFormElement {
         */
        public function addValidator(IFormFieldValidator $validator);
        
+       /**
+        * Returns the html representation of the form field only without any of the surrounding
+        * structural html elements.
+        * 
+        * @return      string          html representation of node
+        */
+       public function getFieldHtml();
+       
        /**
         * Returns the name of the object property this field represents.
         * 
index d49101fcd0e23908a1bca3b17da923fa9f053c8a..2e725cc9e77523c6cc3bf7bafa3641085ebdb275 100644 (file)
@@ -261,6 +261,18 @@ class UploadFormField extends AbstractFormField {
                return parent::getHtml();
        }
        
+       /**
+        * @inheritDoc
+        * @throws      \BadMethodCallException         if the method is called, before the field is populated
+        */
+       public function getFieldHtml() {
+               if (!$this->isPopulated) {
+                       throw new \BadMethodCallException("The field must be populated, before calling this method.");
+               }
+               
+               return parent::getFieldHtml();
+       }
+       
        /**
         * @inheritDoc
         * 
index 945f46136baad0357731301796f3c8613fccecc7..0b74a401ff73ff68e217ac7ea79b5a9995a05fb8 100644 (file)
@@ -117,7 +117,7 @@ class WysiwygFormField extends AbstractFormField implements IMaximumLengthFormFi
        /**
         * @inheritDoc
         */
-       public function getHtml() {
+       public function getFieldHtml() {
                if ($this->supportsQuotes()) {
                        MessageQuoteManager::getInstance()->assignVariables();
                }
@@ -133,7 +133,7 @@ class WysiwygFormField extends AbstractFormField implements IMaximumLengthFormFi
                        WCF::getSession()->getPermission($disallowedBBCodesPermission)
                ));
                
-               return parent::getHtml();
+               return parent::getFieldHtml();
        }
        
        /**