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