Overhauled ACP menu
authorAlexander Ebert <ebert@woltlab.com>
Sun, 18 Oct 2015 14:57:31 +0000 (16:57 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 18 Oct 2015 14:57:31 +0000 (16:57 +0200)
wcfsetup/install/files/acp/style/acpMenu.css [new file with mode: 0644]
wcfsetup/install/files/acp/templates/header.tpl
wcfsetup/install/files/acp/templates/pageHeader.tpl
wcfsetup/install/files/acp/templates/pageMenu.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/pageMenuUser.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/pageSearchArea.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/searchArea.tpl [deleted file]
wcfsetup/install/files/acp/templates/userPanel.tpl [deleted file]

diff --git a/wcfsetup/install/files/acp/style/acpMenu.css b/wcfsetup/install/files/acp/style/acpMenu.css
new file mode 100644 (file)
index 0000000..130db17
--- /dev/null
@@ -0,0 +1,99 @@
+.wcfAcpMenu {
+       font-size: 13px;
+       font-weight: 400;
+       padding: 5px;
+}
+
+.wcfAcpMenu.doubleColumned {
+       -webkit-columns: 2;
+       -moz-columns: 2;
+       columns: 2;
+       
+       /* 11px = 5px + border + 5px */
+       -webkit-column-gap: 11px;
+       -moz-column-gap: 11px;
+       column-gap: 11px;
+       
+       -webkit-column-rule: 1px solid rgb(238, 238, 238);
+       -moz-column-rule: 1px solid rgb(238, 238, 238);
+       column-rule: 1px solid rgb(238, 238, 238);
+}
+
+.wcfAcpMenu.doubleColumned > li {
+       -webkit-column-break-inside: avoid;
+       page-break-inside: avoid;
+       break-inside: avoid;
+}
+
+.wcfAcpMenu > li {
+       min-width: 250px;
+}
+
+.wcfAcpMenu > li:not(:first-child) {
+       border-top: 1px solid rgb(238, 238, 238);
+}
+
+.wcfAcpMenu > li > span {
+       background-color: rgb(236, 240, 241);
+       color: rgb(127, 140, 141);
+       font-size: 11px;
+       display: block;
+       padding: 10px;
+       text-transform: uppercase;
+}
+
+.menuItemList > li > a {
+       color: rgb(54, 54, 54);
+       display: block;
+       font-size: 13px;
+       padding: 10px 20px;
+       white-space: nowrap;
+}
+
+.menuItemList > li > a:hover {
+       background-color: rgb(66, 129, 244);
+       color: #fff;
+       text-decoration: none;
+}
+
+.menuItemList > li.active > a {
+       background-color: rgb(217, 237, 247);
+}
+
+.menuItemWrapper {
+       display: flex;
+}
+
+.menuItemWrapper:hover > a,
+.menuItemWrapper > .active {
+       background-color: rgb(217, 237, 247);
+}
+
+.menuItemWrapper > a {
+       color: rgb(54, 54, 54);
+       display: block;
+       flex: 0 auto;
+       padding: 10px;
+       white-space: nowrap;
+}
+
+.menuItemWrapper > a:first-child {
+       flex: 1 auto;
+       padding: 10px 20px;
+}
+
+.menuItemWrapper > a > .icon {
+       color: rgb(54, 54, 54);
+       opacity: .6;
+}
+
+.menuItemList .menuItemWrapper > a:hover {
+       background-color: rgb(66, 129, 244);
+       color: #fff;
+       text-decoration: none;
+}
+
+.menuItemList .menuItemWrapper > a:hover > .icon {
+       color: #fff;
+       opacity: 1;
+}
index 9545d28f478ba2dde6e696ea4733eb00fbaec86c..792d9fd548672ebb4b75f7c0fdd848b6a05844b7 100644 (file)
@@ -7,8 +7,9 @@
        <title>{if $pageTitle|isset}{@$pageTitle|language} - {/if}{lang}wcf.global.acp{/lang}{if PACKAGE_ID} - {PAGE_TITLE|language}{/if}</title>
        
        <!-- Stylesheets -->
-       <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>
+       <!--<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>-->
        {@$__wcf->getStyleHandler()->getStylesheet(true)}
+       <link href="{@$__wcf->getPath()}acp/style/acpMenu.css" type="text/css" rel="stylesheet">
        {event name='stylesheets'}
        
        <!-- Icons -->
                        {if PACKAGE_ID}
                                {assign var=activeMenuItems value=$__wcf->getACPMenu()->getActiveMenuItems()|array_reverse}
                                var $activeMenuItems = [{implode from=$activeMenuItems item=_menuItem}'{$_menuItem}'{/implode}];
-                               new WCF.ACP.Menu($activeMenuItems);
+                               //new WCF.ACP.Menu($activeMenuItems);
                        {/if}
                        
                        if (jQuery.browser.touch) $('html').addClass('touch');
        </header>
        *}
        
-       <div id="main" class="layoutFluid{if PACKAGE_ID && $__wcf->user->userID && $__wcf->getACPMenu()->getMenuItems('')|count} sidebarOrientationLeft{/if}">
-               <div>
-                       <div>
-                               {hascontent}
-                                       <aside class="sidebar collapsibleMenu">
-                                               <div>
-                                                       {content}
-                                                               {* work-around for unknown core-object during WCFSetup *}
-                                                               {if PACKAGE_ID && $__wcf->user->userID}
-                                                                       {foreach from=$__wcf->getACPMenu()->getMenuItems('') item=_parentMenuItem}
-                                                                               <div id="{$_parentMenuItem->menuItem}-container" style="display: none;" class="menuGroup collapsibleMenus" data-parent-menu-item="{$_parentMenuItem->menuItem}">
-                                                                                       {foreach from=$__wcf->getACPMenu()->getMenuItems($_parentMenuItem->menuItem) item=_menuItem}
-                                                                                               <fieldset>
-                                                                                                       <legend class="menuHeader" data-menu-item="{$_menuItem->menuItem}">{@$_menuItem}</legend>
-                                                                                                       
-                                                                                                       <nav class="menuGroupItems">
-                                                                                                               <ul id="{$_menuItem->menuItem}">
-                                                                                                                       {foreach from=$__wcf->getACPMenu()->getMenuItems($_menuItem->menuItem) item=menuItemCategory}
-                                                                                                                               {if $__wcf->getACPMenu()->getMenuItems($menuItemCategory->menuItem)|count > 0}
-                                                                                                                                       {foreach from=$__wcf->getACPMenu()->getMenuItems($menuItemCategory->menuItem) item=subMenuItem}
-                                                                                                                                               <li id="{$subMenuItem->menuItem}" data-menu-item="{$subMenuItem->menuItem}"><a href="{$subMenuItem->getLink()}">{@$subMenuItem}</a></li>
-                                                                                                                                       {/foreach}
-                                                                                                                               {else}
-                                                                                                                                       <li id="{$menuItemCategory->menuItem}" data-menu-item="{$menuItemCategory->menuItem}"><a href="{$menuItemCategory->getLink()}">{@$menuItemCategory}</a></li>
-                                                                                                                               {/if}
-                                                                                                                       {/foreach}
-                                                                                                               </ul>
-                                                                                                       </nav>
-                                                                                               </fieldset>
-                                                                                       {/foreach}
-                                                                               </div>
-                                                                       {/foreach}
-                                                               {/if}
-                                                       {/content}
-                                               </div>
-                                       </aside>
-                               {/hascontent}
-                               
-                               <section id="content" class="content">
+       <div class="layoutFluid">
+               <div id="content" class="content">
                                
index b7711fe4731a981b699aafaf13e6b2d24a100f51..a9ac2cb91736a4b78713f5c470521ab0fac0fbb2 100644 (file)
@@ -1,13 +1,13 @@
-<header id="pageHeader" class="header">
+<header id="pageHeader" class="pageHeader">
        <div>
                <div class="{if $__wcf->getStyleHandler()->getStyle()->getVariable('useFluidLayout')}layoutFluid{else}layoutFixed{/if}">
                        {include file='pageLogo'}
                        
-                       {include file='searchArea'}
+                       {include file='pageSearchArea'}
                        
-                       {include file='mainMenu'}
+                       {include file='pageMenu'}
                        
-                       {include file='userPanel'}
+                       {include file='pageMenuUser'}
                </div>
        </div>
        
diff --git a/wcfsetup/install/files/acp/templates/pageMenu.tpl b/wcfsetup/install/files/acp/templates/pageMenu.tpl
new file mode 100644 (file)
index 0000000..5c66d2f
--- /dev/null
@@ -0,0 +1,46 @@
+{assign var=_activeMenuItems value=$__wcf->getACPMenu()->getActiveMenuItems()}
+<nav id="mainMenu" class="mainMenu jsMobileNavigation" data-button-label="{lang}wcf.page.mainMenu{/lang}">
+       <ul>
+               {foreach from=$__wcf->getACPMenu()->getMenuItems('') item=_sectionMenuItem}
+                       <li class="subMenuItems{if $_sectionMenuItem->menuItem|in_array:$_activeMenuItems} active{/if}" data-menu-item="{$_sectionMenuItem->menuItem}">
+                               <a href="#">{@$_sectionMenuItem}</a>
+                               
+                               {assign var=_menuItemCategories value=$__wcf->getACPMenu()->getMenuItems($_sectionMenuItem->menuItem)}
+                               <ol class="wcfAcpMenu subMenu{if $_menuItemCategories|count > 3} doubleColumned {/if}">
+                                       {foreach from=$_menuItemCategories item=_menuItemCategory}
+                                               <li>
+                                                       <span>{@$_menuItemCategory}</span>
+                                                       
+                                                       <ol class="menuItemList">
+                                                               {foreach from=$__wcf->getACPMenu()->getMenuItems($_menuItemCategory->menuItem) item=_menuItem}
+                                                                       {assign var=_subMenuItems value=$__wcf->getACPMenu()->getMenuItems($_menuItem->menuItem)}
+                                                                       
+                                                                       {if $_subMenuItems|empty}
+                                                                               <li{if $_menuItem->menuItem|in_array:$_activeMenuItems} class="active"{/if}><a href="{$_menuItem->getLink()}">{@$_menuItem}</a></li>
+                                                                       {else}
+                                                                               {if $_menuItemCategory->menuItem === 'wcf.acp.menu.link.option'}
+                                                                               {* handle special option categories *}
+                                                                                       {foreach from=$_subMenuItems item=_subMenuItem}
+                                                                                               <li{if $_subMenuItem->menuItem|in_array:$_activeMenuItems} class="active"{/if}><a href="{$_subMenuItem->getLink()}">{@$_subMenuItem}</a></li>
+                                                                                       {/foreach}
+                                                                               {else}
+                                                                                       <li>
+                                                                                               <div class="menuItemWrapper">
+                                                                                                       <a href="{$_menuItem->getLink()}"{if $_menuItem->menuItem|in_array:$_activeMenuItems && $_activeMenuItems[0] === $_menuItem->menuItem} class="active"{/if}>{@$_menuItem}</a>
+                                                                                                       
+                                                                                                       {foreach from=$_subMenuItems item=_subMenuItem}
+                                                                                                               <a href="{$_subMenuItem->getLink()}" class="jsTooltip{if $_subMenuItem->menuItem|in_array:$_activeMenuItems} active{/if}" title="{@$_subMenuItem}"><span class="icon icon16 {$_subMenuItem->icon}"></span></a>
+                                                                                                       {/foreach}
+                                                                                               </div>
+                                                                                       </li>
+                                                                               {/if}
+                                                                       {/if}
+                                                               {/foreach}
+                                                       </ol>
+                                               </li>
+                                       {/foreach}
+                               </ol>
+                       </li>
+               {/foreach}
+       </ul>
+</nav>
diff --git a/wcfsetup/install/files/acp/templates/pageMenuUser.tpl b/wcfsetup/install/files/acp/templates/pageMenuUser.tpl
new file mode 100644 (file)
index 0000000..b02829f
--- /dev/null
@@ -0,0 +1,46 @@
+<nav id="topMenu" class="userPanel">
+       <ul class="userPanelItems">
+               {if $__wcf->user->userID}
+                       <!-- user menu -->
+                       <li id="userMenu">
+                               <a class="framed" href="{link controller='User' object=$__wcf->user}{/link}">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)} <span>{lang}wcf.user.userNote{/lang}</span></a>
+                       </li>
+                       
+                       <li><a href="{link controller='Settings'}{/link}" class="noJsOnly" style="display: none"><span class="icon icon16 fa-cogs"></span> <span>{lang}wcf.user.menu.settings{/lang}</span></a></li>
+                       
+                       {if PACKAGE_ID > 1}
+                               <li id="jumpToPage" class="dropdown">
+                                       <a href="{link forceFrontend=true}{/link}" class="dropdownToggle" data-toggle="jumpToPage"><span class="icon icon16 icon-home"></span> <span>{lang}wcf.global.jumpToPage{/lang}</span></a>
+                                       <ul class="dropdownMenu">
+                                               {foreach from=$__wcf->getPageMenu()->getMenuItems('header') item=_menuItem}
+                                                       <li><a href="{$_menuItem->getProcessor()->getLink()}">{lang}{$_menuItem->menuItem}{/lang}</a></li>
+                                               {/foreach}
+                                       </ul>
+                               </li>
+                               
+                               {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage') && $__wcf->getAvailableUpdates()}
+                                       <li>
+                                               <a href="{link controller='PackageUpdate'}{/link}"><span class="icon icon16 icon-refresh"></span> <span>{lang}wcf.acp.package.updates{/lang}</span> <span class="badge badgeInverse">{#$__wcf->getAvailableUpdates()}</span></a>
+                                       </li>
+                               {/if}
+                       {/if}
+                       
+                       <li id="woltlab" class="dropdown">
+                               <a class="dropdownToggle" data-toggle="woltlab"><span class="icon icon16 icon-info-sign"></span> <span>WoltLab&reg;</span></a>
+                               
+                               <ul class="dropdownMenu">
+                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://www.woltlab.com"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.website{/lang}</a></li>
+                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://community.woltlab.com"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.forums{/lang}</a></li>
+                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://www.woltlab.com/ticket-add/"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.tickets{/lang}</a></li>
+                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://pluginstore.woltlab.com"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.pluginStore{/lang}</a></li>
+                               </ul>
+                       </li>
+               {/if}
+               
+               {event name='menuItems'}
+               
+               {if $__wcf->user->userID}
+                       <li><a href="{link controller='Logout'}t={@SECURITY_TOKEN}{/link}" class="noJsOnly" style="display: none"><span class="icon icon16 fa-sign-out"></span> <span>{lang}wcf.user.logout{/lang}</span></a></li>
+               {/if}
+       </ul>
+</nav>
\ No newline at end of file
diff --git a/wcfsetup/install/files/acp/templates/pageSearchArea.tpl b/wcfsetup/install/files/acp/templates/pageSearchArea.tpl
new file mode 100644 (file)
index 0000000..d379bb3
--- /dev/null
@@ -0,0 +1,37 @@
+{capture assign='__searchFormLink'}{link controller='Search'}{/link}{/capture}
+{capture assign='__searchInputPlaceholder'}{lang}wcf.global.search.enterSearchTerm{/lang}{/capture}
+{capture assign='__searchDropdownOptions'}<label><input type="checkbox" name="subjectOnly" value="1" /> {lang}wcf.search.subjectOnly{/lang}</label>{/capture}
+{assign var='__searchHiddenInputFields' value=''}
+
+{event name='settings'}
+
+<div id="search" class="searchBar" data-disable-auto-focus="true">
+       <form method="post" action="{@$__searchFormLink}" class="dropdown">
+               <input type="search" name="q" id="pageHeaderSearch" placeholder="{@$__searchInputPlaceholder}" autocomplete="off" required="required" value="{if $query|isset}{$query}{/if}" class="dropdownToggle" data-toggle="search" />
+               
+               <ul class="dropdownMenu">
+                       {hascontent}
+                               <li class="dropdownText">
+                                       {content}
+                                       {@$__searchDropdownOptions}
+                                       {/content}
+                               </li>
+                               <li class="dropdownDivider"></li>
+                       {/hascontent}
+                       <li><a href="{@$__searchFormLink}">{lang}wcf.search.extended{/lang}</a></li>
+               </ul>
+               
+               {@$__searchHiddenInputFields}
+               {@SECURITY_TOKEN_INPUT_TAG}
+       </form>
+</div>
+
+{if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')}
+       <script data-relocate="true">
+               //<![CDATA[
+               $(function() {
+                       //new WCF.Search.Message.SearchArea($('#search'));
+               });
+               //]]>
+       </script>
+{/if}
\ No newline at end of file
diff --git a/wcfsetup/install/files/acp/templates/searchArea.tpl b/wcfsetup/install/files/acp/templates/searchArea.tpl
deleted file mode 100644 (file)
index 7a9e740..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-{capture assign='__searchFormLink'}{link controller='Search'}{/link}{/capture}
-{capture assign='__searchInputPlaceholder'}{lang}wcf.global.search.enterSearchTerm{/lang}{/capture}
-{capture assign='__searchDropdownOptions'}<label><input type="checkbox" name="subjectOnly" value="1" /> {lang}wcf.search.subjectOnly{/lang}</label>{/capture}
-{assign var='__searchHiddenInputFields' value=''}
-
-{event name='settings'}
-
-<div id="search" class="searchBar" data-disable-auto-focus="true">
-       <form method="post" action="{@$__searchFormLink}" class="dropdown">
-               <input type="search" name="q" placeholder="{@$__searchInputPlaceholder}" autocomplete="off" required="required" value="{if $query|isset}{$query}{/if}" class="dropdownToggle" data-toggle="search" />
-               
-               <ul class="dropdownMenu">
-                       {hascontent}
-                               <li class="dropdownText">
-                                       {content}
-                                               {@$__searchDropdownOptions}
-                                       {/content}
-                               </li>
-                               <li class="dropdownDivider"></li>
-                       {/hascontent}
-                       <li><a href="{@$__searchFormLink}">{lang}wcf.search.extended{/lang}</a></li>
-               </ul>
-               
-               {@$__searchHiddenInputFields}
-               {@SECURITY_TOKEN_INPUT_TAG}
-       </form>
-</div>
-
-{if !OFFLINE || $__wcf->session->getPermission('admin.general.canViewPageDuringOfflineMode')}
-       <script data-relocate="true">
-               //<![CDATA[
-               $(function() {
-                       new WCF.Search.Message.SearchArea($('#search'));
-               });
-               //]]>
-       </script>
-{/if}
\ No newline at end of file
diff --git a/wcfsetup/install/files/acp/templates/userPanel.tpl b/wcfsetup/install/files/acp/templates/userPanel.tpl
deleted file mode 100644 (file)
index b02829f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<nav id="topMenu" class="userPanel">
-       <ul class="userPanelItems">
-               {if $__wcf->user->userID}
-                       <!-- user menu -->
-                       <li id="userMenu">
-                               <a class="framed" href="{link controller='User' object=$__wcf->user}{/link}">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(32)} <span>{lang}wcf.user.userNote{/lang}</span></a>
-                       </li>
-                       
-                       <li><a href="{link controller='Settings'}{/link}" class="noJsOnly" style="display: none"><span class="icon icon16 fa-cogs"></span> <span>{lang}wcf.user.menu.settings{/lang}</span></a></li>
-                       
-                       {if PACKAGE_ID > 1}
-                               <li id="jumpToPage" class="dropdown">
-                                       <a href="{link forceFrontend=true}{/link}" class="dropdownToggle" data-toggle="jumpToPage"><span class="icon icon16 icon-home"></span> <span>{lang}wcf.global.jumpToPage{/lang}</span></a>
-                                       <ul class="dropdownMenu">
-                                               {foreach from=$__wcf->getPageMenu()->getMenuItems('header') item=_menuItem}
-                                                       <li><a href="{$_menuItem->getProcessor()->getLink()}">{lang}{$_menuItem->menuItem}{/lang}</a></li>
-                                               {/foreach}
-                                       </ul>
-                               </li>
-                               
-                               {if $__wcf->session->getPermission('admin.system.package.canUpdatePackage') && $__wcf->getAvailableUpdates()}
-                                       <li>
-                                               <a href="{link controller='PackageUpdate'}{/link}"><span class="icon icon16 icon-refresh"></span> <span>{lang}wcf.acp.package.updates{/lang}</span> <span class="badge badgeInverse">{#$__wcf->getAvailableUpdates()}</span></a>
-                                       </li>
-                               {/if}
-                       {/if}
-                       
-                       <li id="woltlab" class="dropdown">
-                               <a class="dropdownToggle" data-toggle="woltlab"><span class="icon icon16 icon-info-sign"></span> <span>WoltLab&reg;</span></a>
-                               
-                               <ul class="dropdownMenu">
-                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://www.woltlab.com"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.website{/lang}</a></li>
-                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://community.woltlab.com"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.forums{/lang}</a></li>
-                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://www.woltlab.com/ticket-add/"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.tickets{/lang}</a></li>
-                                       <li><a class="externalURL" href="{@$__wcf->getPath()}acp/dereferrer.php?url={"https://pluginstore.woltlab.com"|rawurlencode}"{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}>{lang}wcf.acp.index.woltlab.pluginStore{/lang}</a></li>
-                               </ul>
-                       </li>
-               {/if}
-               
-               {event name='menuItems'}
-               
-               {if $__wcf->user->userID}
-                       <li><a href="{link controller='Logout'}t={@SECURITY_TOKEN}{/link}" class="noJsOnly" style="display: none"><span class="icon icon16 fa-sign-out"></span> <span>{lang}wcf.user.logout{/lang}</span></a></li>
-               {/if}
-       </ul>
-</nav>
\ No newline at end of file