Beispiel #1
0
		$q = cf\createQuery('SELECT parent_id,template FROM cf_page WHERE id=:id');
	}
	while (!strlen($tpl) && $parentID) {
		$r = cf\query2array($q,array('id'=>$parentID));
		$parentID = $r['parent_id'];
		$tpl = $r['template'];
	}
	return strlen($tpl) ? $tpl : 'page';
}
*/
try {
    require_once 'init.php';
    $pid = 'home';
    try {
        if (array_key_exists('path', $_REQUEST) && strlen($_REQUEST['path'])) {
            $pathInfo = cf\Page::findByPath($_REQUEST['path']);
            if (strlen($pathInfo['found'])) {
                $pid = $pathInfo['page_id'];
            } else {
                $pid = 'error404';
            }
        }
    } catch (Exception $e) {
        $pid = 'error404';
    }
    $page = cf\Page::get($pid);
    $crumbs = array();
    foreach ($page['branch'] as $p) {
        $crumbs[] = array('name' => $p['menu_name'], 'link' => $p['path']);
    }
    if (!strlen($page['template'])) {