Fix code of `boxAdd` template
authorMatthias Schmidt <gravatronics@live.com>
Sat, 11 Nov 2017 19:13:38 +0000 (20:13 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 11 Nov 2017 19:13:38 +0000 (20:13 +0100)
Fixes 3cab11c04220282a46117e31a80a75660835be7a

wcfsetup/install/files/acp/templates/boxAdd.tpl

index 3b08d8e97cdb43c1403f80b2e3ac122dc3a70f84..43b9b5643ffbf0871e4a6bd4769ed484082d354e 100644 (file)
@@ -2,45 +2,47 @@
 
 <script data-relocate="true">
        {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}{include file='mediaJavaScript'}{/if}
-
+       
        {if $boxType == 'system'}
                require(['WoltLabSuite/Core/Acp/Ui/Box/Controller/Handler'], function(AcpUiBoxControllerHandler) {
                        AcpUiBoxControllerHandler.init({if $boxController}{@$boxController->objectTypeID}{/if});
                });
-       {/if}
-
-       require(['Dictionary', 'Language', 'WoltLabSuite/Core/Acp/Ui/Box/Handler', 'WoltLabSuite/Core/Media/Manager/Select'], function(Dictionary, Language, AcpUiBoxHandler, MediaManagerSelect) {
-               Language.addObject({
-                       'wcf.page.pageObjectID': '{lang}wcf.page.pageObjectID{/lang}',
-                       {foreach from=$pageNodeList item=pageNode}
-                               {capture assign='pageObjectIDLanguageItem'}{lang __optional=true}wcf.page.pageObjectID.{@$pageNode->identifier}{/lang}{/capture}
-                               {if $pageObjectIDLanguageItem}
-                                       'wcf.page.pageObjectID.{@$pageNode->identifier}': '{@$pageObjectIDLanguageItem}',
-                               {/if}
-                               {capture assign='pageObjectIDLanguageItem'}{lang __optional=true}wcf.page.pageObjectID.search.{@$pageNode->identifier}{/lang}{/capture}
-                               {if $pageObjectIDLanguageItem}
-                                       'wcf.page.pageObjectID.search.{@$pageNode->identifier}': '{@$pageObjectIDLanguageItem}',
-                               {/if}
+       {else}
+               require(['Dictionary', 'Language', 'WoltLabSuite/Core/Acp/Ui/Box/Handler'], function(Dictionary, Language, AcpUiBoxHandler) {
+                       Language.addObject({
+                               'wcf.page.pageObjectID': '{lang}wcf.page.pageObjectID{/lang}',
+                               {foreach from=$pageNodeList item=pageNode}
+                                       {capture assign='pageObjectIDLanguageItem'}{lang __optional=true}wcf.page.pageObjectID.{@$pageNode->identifier}{/lang}{/capture}
+                                       {if $pageObjectIDLanguageItem}
+                                               'wcf.page.pageObjectID.{@$pageNode->identifier}': '{@$pageObjectIDLanguageItem}',
+                                       {/if}
+                                       {capture assign='pageObjectIDLanguageItem'}{lang __optional=true}wcf.page.pageObjectID.search.{@$pageNode->identifier}{/lang}{/capture}
+                                       {if $pageObjectIDLanguageItem}
+                                               'wcf.page.pageObjectID.search.{@$pageNode->identifier}': '{@$pageObjectIDLanguageItem}',
+                                       {/if}
+                               {/foreach}
+                               'wcf.page.pageObjectID.search.noResults': '{lang}wcf.page.pageObjectID.search.noResults{/lang}',
+                               'wcf.page.pageObjectID.search.results': '{lang}wcf.page.pageObjectID.search.results{/lang}',
+                               'wcf.page.pageObjectID.search.terms': '{lang}wcf.page.pageObjectID.search.terms{/lang}'
+                       });
+                       
+                       var handlers = new Dictionary();
+                       {foreach from=$pageHandlers key=handlerPageID item=requireObjectID}
+                               handlers.set({@$handlerPageID}, {if $requireObjectID}true{else}false{/if});
                        {/foreach}
-                       'wcf.page.pageObjectID.search.noResults': '{lang}wcf.page.pageObjectID.search.noResults{/lang}',
-                       'wcf.page.pageObjectID.search.results': '{lang}wcf.page.pageObjectID.search.results{/lang}',
-                       'wcf.page.pageObjectID.search.terms': '{lang}wcf.page.pageObjectID.search.terms{/lang}'
+                       
+                       AcpUiBoxHandler.init(handlers);
                });
-
-               var handlers = new Dictionary();
-               {foreach from=$pageHandlers key=handlerPageID item=requireObjectID}
-                       handlers.set({@$handlerPageID}, {if $requireObjectID}true{else}false{/if});
-               {/foreach}
-
-               AcpUiBoxHandler.init(handlers);
-               
-               {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
+       {/if}
+       
+       {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
+               require(['WoltLabSuite/Core/Media/Manager/Select'], function(MediaManagerSelect) {
                        new MediaManagerSelect({
                                dialogTitle: '{lang}wcf.media.chooseImage{/lang}',
                                imagesOnly: 1
                        });
-               {/if}
-       });
+               });
+       {/if}
 </script>
 
 <header class="contentHeader">
                                        
                                        {event name='linkFields'}
                                </section>
-                               
-                               <div id="boxConditions">
-                                       {if $boxController && $boxController->getProcessor()|is_subclass_of:'wcf\system\box\IConditionBoxController'}
-                                               {@$boxController->getProcessor()->getConditionsTemplate()}
-                                       {/if}
-                               </div>
+                       {/if}
+                       
+                       <div id="boxConditions">
+                               {if $boxController && $boxController->getProcessor()|is_subclass_of:'wcf\system\box\IConditionBoxController'}
+                                       {@$boxController->getProcessor()->getConditionsTemplate()}
+                               {/if}
                        </div>
-               {/if}
+               </div>
                
                <div id="contents" class="tabMenuContent">
                        {if !$isMultilingual && $boxType != 'system'}