Optimizing output of header.tpl when there is no valid acpMenu-item
authorTim Düsterhus <timwolla@arcor.de>
Sat, 7 Jul 2012 13:04:29 +0000 (15:04 +0200)
committerTim Düsterhus <timwolla@arcor.de>
Sat, 7 Jul 2012 13:04:29 +0000 (15:04 +0200)
wcfsetup/install/files/acp/templates/header.tpl

index b52b4a20028b2662a4b9c82abd17b91482e139ef..289639bb065481731904d25f66ea512182f78b86 100644 (file)
                        </div>
                        <!-- /logo -->
                        
-                       <!-- main menu -->
-                       <nav id="mainMenu" class="mainMenu">
-                               {* work-around for unknown core-object during WCFSetup *}
-                               {if PACKAGE_ID}
-                                       <ul>
-                                               {foreach from=$__wcf->getACPMenu()->getMenuItems('') item=menuItem}
-                                                       <li data-menu-item="{$menuItem->menuItem}"><a>{lang}{@$menuItem->menuItem}{/lang}</a></li>
-                                               {/foreach}
-                                       </ul>
-                               {/if}
-                       </nav>
-                       <!-- /main menu -->
+                       {hascontent}
+                               <!-- main menu -->
+                               <nav id="mainMenu" class="mainMenu">
+                                       {* work-around for unknown core-object during WCFSetup *}
+                                       {if PACKAGE_ID}
+                                               <ul>
+                                                       {content}
+                                                               {foreach from=$__wcf->getACPMenu()->getMenuItems('') item=menuItem}
+                                                                       <li data-menu-item="{$menuItem->menuItem}"><a>{lang}{@$menuItem->menuItem}{/lang}</a></li>
+                                                               {/foreach}
+                                                       {/content}
+                                               </ul>
+                                       {/if}
+                               </nav>
+                               <!-- /main menu -->
+                       {/hascontent}
                        
                        <!-- header navigation -->
                        <nav class="navigation navigationHeader clearfix">
        <!-- /HEADER -->
        
        <!-- MAIN -->
-       <div id="main" class="layoutFluid{if $__wcf->user->userID} sidebarOrientationLeft{/if}">
+       <div id="main" class="layoutFluid{if PACKAGE_ID && $__wcf->getACPMenu()->getMenuItems('')|count} sidebarOrientationLeft{/if}">
                <div>
                        {hascontent}
                                <!-- SIDEBAR -->