fix boxAdd if the administrator hasn't the permission to use media
authorJoshua Rüsweg <josh@wcflabs.de>
Tue, 31 Jan 2017 11:56:51 +0000 (12:56 +0100)
committerGitHub <noreply@github.com>
Tue, 31 Jan 2017 11:56:51 +0000 (12:56 +0100)
wcfsetup/install/files/acp/templates/boxAdd.tpl

index 5cca3ea98f9e638e971914f8ec06a100a69331f3..f0fb7385a33535399c5384ebf4d95cd57dfbc89d 100644 (file)
@@ -1,47 +1,47 @@
 {include file='header' pageTitle='wcf.acp.box.'|concat:$action}
 
-{if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
-       <script data-relocate="true">
-               {include file='mediaJavaScript'}
-               
-               {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}
-                               {/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});
+<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}
                        {/foreach}
-                       
-                       AcpUiBoxHandler.init(handlers);
-                       
+                       '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}
+
+               AcpUiBoxHandler.init(handlers);
+               
+               {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}
                        new MediaManagerSelect({
                                dialogTitle: '{lang}wcf.media.chooseImage{/lang}',
                                imagesOnly: 1
                        });
-               });
-       </script>
-{/if}
+               {/if}
+       });
+</script>
 
 <header class="contentHeader">
        <div class="contentHeaderTitle">