public function getGlobalMenu($level = 1, $options = array())
{
$Content = ClassRegistry::init('Content');
$siteId = 0;
if (!empty($this->request->params['Content']['site_id'])) {
$siteId = $this->request->params['Content']['site_id'];
}
$siteRoot = $Content->getSiteRoot($siteId);
$id = $siteRoot['Content']['id'];
$currentId = null;
if (!empty($this->request->params['Content']['id'])) {
$currentId = $this->request->params['Content']['id'];
}
$options = array_merge(['tree' => $this->BcContents->getTree($id, $level), 'currentId' => $currentId], $options);
if (empty($_SESSION['Auth'][Configure::read('BcAuthPrefix.admin.sessionKey')])) {
$options = array_merge($options, ['cache' => ['time' => Configure::read('BcCache.duration'), 'key' => $id]]);
}
return $this->getElement('global_menu', $options);
}