<li id="jumpToPage" class="dropdown">
<a href="{link forceFrontend=true}{/link}" class="dropdownToggle" data-toggle="jumpToPage"><span class="icon icon32 fa-home"></span> <span>{lang}wcf.global.jumpToPage{/lang}</span></a>
<ul class="dropdownMenu">
- {* TODO *}
- {*foreach from=$__wcf->getPageMenu()->getMenuItems('header') item=_menuItem}
- <li><a href="{$_menuItem->getProcessor()->getLink()}">{lang}{$_menuItem->menuItem}{/lang}</a></li>
- {/foreach*}
+ {foreach from=$__wcf->getFrontendMenu()->getMenuItemNodeList() item=_menuItem}
+ {if !$_menuItem->getMenuItem()->parentItemID && $_menuItem->getMenuItem()->getPage()}
+ <li><a href="{$_menuItem->getMenuItem()->getPage()->getLink()}">{$_menuItem->getMenuItem()->getPage()}</a></li>
+ {/if}
+ {/foreach}
</ul>
</li>
{* main menu *}
<div id="pageMainMenuMobile" class="pageMainMenuMobile menuOverlayMobile" data-page-logo="{$__wcf->getPath()}images/default-logo.png">
- <ol class="menuOverlayItemList" data-title="TODO: menu">
- <li class="menuOverlayTitle">TODO: menu</li>
+ <ol class="menuOverlayItemList" data-title="{lang}wcf.menu.page{/lang}">
+ <li class="menuOverlayTitle">{lang}wcf.menu.page{/lang}</li>
{foreach from=$__wcf->getACPMenu()->getMenuItems('') item=_sectionMenuItem}
<li class="menuOverlayItem">
<a href="#" class="menuOverlayItemLink box24{if $_sectionMenuItem->menuItem|in_array:$_activeMenuItems} active{/if}">
{* user menu *}
<div id="pageUserMenuMobile" class="pageUserMenuMobile menuOverlayMobile" data-page-logo="{$__wcf->getPath()}images/default-logo.png">
- <ol class="menuOverlayItemList" data-title="TODO: user menu">
- <li class="menuOverlayTitle">TODO: user menu</li>
+ <ol class="menuOverlayItemList" data-title="{lang}wcf.menu.user{/lang}">
+ <li class="menuOverlayTitle">{lang}wcf.menu.user{/lang}</li>
<li class="menuOverlayItem">
<a href="#" class="menuOverlayItemLink box24">
<span class="icon icon24 fa-home"></span>
<span class="menuOverlayItemTitle">{lang}wcf.global.jumpToPage{/lang}</span>
</a>
<ol class="menuOverlayItemList">
- {* TODO *}
- {*foreach from=$__wcf->getPageMenu()->getMenuItems('header') item=_menuItem}
- <li class="menuOverlayItem"><a href="{$_menuItem->getProcessor()->getLink()}" class="menuOverlayItemLink">{lang}{$_menuItem->menuItem}{/lang}</a></li>
- {/foreach*}
+ {foreach from=$__wcf->getFrontendMenu()->getMenuItemNodeList() item=_menuItem}
+ {if !$_menuItem->getMenuItem()->parentItemID && $_menuItem->getMenuItem()->getPage()}
+ <li class="menuOverlayItem"><a href="{$_menuItem->getMenuItem()->getPage()->getLink()}" class="menuOverlayItemLink">{$_menuItem->getMenuItem()->getPage()}</a></li>
+ {/if}
+ {/foreach}
</ol>
</li>
<li class="menuOverlayItem">
return null;
}
+
+ /**
+ * Returns the main menu or null.
+ *
+ * @return Menu|null menu object
+ */
+ public function getMainMenu() {
+ return $this->getMenuByID(MenuCacheBuilder::getInstance()->getData([], 'mainMenuID'));
+ }
}
namespace wcf\system;
use wcf\acp\form\MasterPasswordForm;
use wcf\acp\form\MasterPasswordInitForm;
+use wcf\data\menu\Menu;
+use wcf\data\menu\MenuCache;
use wcf\system\application\ApplicationHandler;
use wcf\system\event\EventHandler;
use wcf\system\exception\AJAXException;
* Extends WCF class with functions for the ACP.
*
* @author Marcel Werk
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system
EventHandler::getInstance()->fireAction($this, 'initialized');
}
+ /**
+ * Returns the main menu object.
+ *
+ * @return Menu|null menu object
+ * @since 2.2
+ */
+ public function getFrontendMenu() {
+ return MenuCache::getInstance()->getMainMenu();
+ }
+
/**
* Returns true if ACP is currently in rescue mode.
*
*/
protected function rebuild(array $parameters) {
$data = [
+ 'mainMenuID' => null,
'menus' => [],
'menuItems' => []
];
$data['menus'][$menu->menuID] = $menu;
$data['menuItems'][$menu->menuID] = $menuItemList;
+
+ if ($menu->identifier === 'com.woltlab.wcf.MainMenu') {
+ $data['mainMenuID'] = $menu->menuID;
+ }
}
return $data;