BcBaserHelper::getContentsMenu PHP Method

getContentsMenu() public method

ログインしていない場合はキャッシュする contents_menu エレメントで、HTMLカスタマイズ可能
public getContentsMenu ( mixed $id = null, integer $level = null, string $currentId = null ) : string
$id mixed コンテンツID(初期値:null)
$level integer 階層(初期値:null)※ null の場合は階層指定なし
$currentId string 現在のページのコンテンツID(初期値:null)
return string コンテンツメニュー
    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);
    }