Termine in Gera

´╗┐Leider keine Termine vorhanden


ype: navigation, Name: idcat_homepage #Contains idcat of tree to be displayed in main navigation #Includes cInclude("frontend", "includes/functions.navigation.php"); #If no tree is selected, use client setting $start_cat = "1"; if ($start_cat=='') { $cApiClient = new cApiClient($client); $start_cat = $cApiClient->getProperty('navigation','idcat_homepage'); } if ( !is_object($db2) ) { $db2 = cRegistry::getDb(); } /** * Check if a category is child * of another category * * @return boolean true/false * @author Jan Lengowski * @copyright four for business AG 2003 */ function catIsChildOf($id, $idparent) { global $cfg, $client, $lang; $db = cRegistry::getDb(); $parent = $id; while ( $parent != 0 ) { $sql = "SELECT a.parentid FROM ".$cfg["tab"]["cat"]." AS a, ".$cfg["tab"]["cat_lang"]." AS b WHERE a.idclient = '".$client."' AND b.idlang = '".$lang."' AND a.idcat = b.idcat AND a.idcat = '".$parent."'"; $db->query($sql); $db->next_record(); $parent = $db->f("parentid"); if ($parent == $idparent) { return true; } } return false; } if ( catIsChildOf($idcat, $start_cat) ) { $sel_idcat = $idcat; } else { $sel_idcat = $start_cat; } /* Include Template Class */ include_once($cfg["path"]["contenido"] . 'classes/class.template.php'); /** * Array storing alle the * navigation data */ $navitems = array(); /* Template Instance */ $tpl = new cTemplate; /** * Recursive function for creating * the navigation array * @param Int $idcat Category id */ function nav($idcat) { global $navitems, $client, $lang, $cfg, $start_cat; $db = cRegistry::getDb(); $db2 = cRegistry::getDb(); $sql = "SELECT parentid FROM ".$cfg["tab"]["cat"]." WHERE idcat = '$idcat'"; $db->query($sql); $db->next_record(); $parentid = $db->f("parentid"); if ( $parentid == 0 ) { if ( $idcat != $start_cat ){ $navitems = array(); $sql = "SELECT A.idcat, C.name, C.public, C.idcatlang FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat = B.idcat AND B.idcat = C.idcat AND B.idclient = '$client' AND C.idlang = '$lang' AND C.visible = '1' AND B.parentid = '".$start_cat."' ORDER BY A.idtree"; $db->query($sql); while ($db->next_record()) { /* Check for external redirects... */ $sql = "SELECT a.external_redirect AS ext, a.idartlang AS idartlang FROM ".$cfg["tab"]["art_lang"]." AS a, ".$cfg["tab"]["cat_art"]." AS b, ".$cfg["tab"]["cat"]." AS c WHERE b.idcat = '".$db->f("idcat")."' AND c.idclient = '".$client."' AND c.idcat = b.idcat AND a.idart = b.idart AND a.idlang = '".$lang."'"; $db2->query($sql); $flag = false; while ($db2->next_record()&&!$flag) { if (isStartArticle($db2->f("idartlang"), $db->f("idcat"), $lang)) { $flag = true; $target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank'; $navitems[$db->f("idcat")] = array("idcat" => $db->f("idcat"), "name" => $db->f("name"), "target" => $target, "public" => $db->f("public"), "idcatlang" => $db->f("idcatlang")); } } } } return true; } $sql = "SELECT A.idcat, C.name, C.public, C.idcatlang FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat = B.idcat AND B.idcat = C.idcat AND B.idclient = '$client' AND C.idlang = '$lang' AND C.visible = '1' AND B.parentid = '$parentid' ORDER BY A.idtree"; $db->query($sql); while ($db->next_record()) { /* Check for external redirects... */ $sql = "SELECT a.external_redirect AS ext, a.idartlang AS idartlang FROM ".$cfg["tab"]["art_lang"]." AS a, ".$cfg["tab"]["cat_art"]." AS b, ".$cfg["tab"]["cat"]." AS c WHERE b.idcat = '".$db->f("idcat")."' AND c.idclient = '".$client."' AND c.idcat = b.idcat AND a.idart = b.idart AND a.idlang = '".$lang."'"; $db2->query($sql); $flag = false; while ($db2->next_record() && !$flag) { if (isStartArticle($db2->f("idartlang"), $db->f("idcat"), $lang)) { $flag = true; $target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank'; $tmp_nav[$db->f("idcat")] = array("idcat" => $db->f("idcat"), "name" => $db->f("name"), "public" => $db->f("public"), "idcatlang" => $db->f("idcatlang"), "target" => $target); } } } $tmp_nav[$idcat]["sub"] = $navitems; $navitems = $tmp_nav; /* Function call */ nav($parentid); } // end function $sql = "SELECT A.idcat, C.name, C.public, C.idcatlang FROM ".$cfg["tab"]["cat_tree"]." AS A, ".$cfg["tab"]["cat"]." AS B, ".$cfg["tab"]["cat_lang"]." AS C WHERE A.idcat = B.idcat AND B.idcat = C.idcat AND B.idclient = '$client' AND C.idlang = '$lang' AND C.visible = '1' AND B.parentid = '$sel_idcat' ORDER BY A.idtree"; $db->query($sql); while ( $db->next_record() ) { /* Check for external redirects... */ $sql = "SELECT a.external_redirect AS ext, a.idartlang AS idartlang FROM ".$cfg["tab"]["art_lang"]." AS a, ".$cfg["tab"]["cat_art"]." AS b, ".$cfg["tab"]["cat"]." AS c WHERE b.idcat = '".$db->f("idcat")."' AND c.idclient = '".$client."' AND c.idcat = b.idcat AND a.idart = b.idart AND a.idlang = '".$lang."'"; $db2->query($sql); #$db2->next_record(); $flag = false; while ($db2->next_record()&&!$flag) { if (isStartArticle($db2->f("idartlang"), $db->f("idcat"), $lang)) { $flag = true; $target = ( $db2->f("ext") == 0 ) ? '_self' : '_blank'; $navitems[$db->f("idcat")] = array("idcat" => $db->f("idcat"), "name" => $db->f("name"), "public" => $db->f("public"), "idcatlang" => $db->f("idcatlang"), "target" => $target); } } } /* Create Navigation Array */ if(($sel_idcat=='')||($sel_idcat=='0')){ $cApiClient = new cApiClient($client); $sel_idcat = $cApiClient->getProperty('navigation', 'idcat_homepage'); } nav($sel_idcat); /* Start Output buffer */ ob_start(); foreach ($navitems as $key => $data) { /* 1. Navigation level */ if (checkCatPermission($data['idcatlang'],$data['public'])) { $tpl->reset(); $tpl->set('d', 'NAME', $data['name']); $tpl->set('d', 'TARGET', $data['target']); $tpl->set('d', 'HREF', $sess->url('/'.$data['idcat'])); $tpl->next(); if ($idcat == $data['idcat']) { $tpl->generate('templates/navfirst_on.html'); }elseif(is_array($data['sub'])){ $tpl->generate('templates/navfirst_open.html'); } else { $tpl->generate('templates/navfirst_off.html'); } /* 2. Navigation level */ if (is_array($data['sub'])) { foreach ($data['sub'] as $key => $data) { if (checkCatPermission($data['idcatlang'],$data['public'])) { $tpl->reset(); $tpl->set('d', 'NAME', $data['name']); $tpl->set('d', 'TARGET', $data['target']); $tpl->set('d', 'HREF', $sess->url('/'.$data['idcat'])); $tpl->next(); if ($idcat == $data['idcat']) { $tpl->generate('templates/navsecond_on.html'); }elseif(is_array($data['sub'])){ $tpl->generate('templates/navsecond_open.html'); } else { $tpl->generate('templates/navsecond_off.html'); } /* 3. Navigation level */ if (is_array($data['sub'])) { foreach ($data['sub'] as $key => $data) { if (checkCatPermission($data['idcatlang'],$data['public'])) { $tpl->reset(); $tpl->set('d', 'NAME', $data['name']); $tpl->set('d', 'TARGET', $data['target']); $tpl->set('d', 'HREF', $sess->url('/'.$data['idcat'])); $tpl->next(); if ($idcat == $data['idcat']) { $tpl->generate('templates/navthird_on.html'); }elseif(is_array($data['sub'])){ $tpl->generate('templates/navthird_open.html'); } else { $tpl->generate('templates/navthird_off.html'); } /* 4. Navigation level */ if (is_array($data['sub'])) { foreach ($data['sub'] as $key => $data) { if (checkCatPermission($data['idcatlang'],$data['public'])) { $tpl->reset(); $tpl->set('d', 'NAME', $data['name']); $tpl->set('d', 'TARGET', $data['target']); $tpl->set('d', 'HREF', $sess->url('/'.$data['idcat'])); $tpl->next(); if ($idcat == $data['idcat']) { $tpl->generate('templates/navfourth_on.html'); }elseif(is_array($data['sub'])){ $tpl->generate('templates/navfourth_open.html'); } else { $tpl->generate('templates/navfourth_off.html'); } /* 5. Navigation level */ if (is_array($data['sub'])) { foreach ($data['sub'] as $key => $data) { if (checkCatPermission($data['idcatlang'],$data['public'])) { $tpl->reset(); $tpl->set('d', 'NAME', $data['name']); $tpl->set('d', 'TARGET', $data['target']); $tpl->set('d', 'HREF', $sess->url('/'.$data['idcat'])); $tpl->next(); if ($idcat == $data['idcat']) { $tpl->generate('templates/navfifth_on.html'); } else { $tpl->generate('templates/navfifth_off.html'); } } // end if } // end foreach } // end if } // end if } // end foreach } // end if } // end if } // end foreach } // end if } // end if } // end foreach } // end if } // end if } // end foreach /* Read out buffer */ $html = ob_get_contents(); /* Clean buffer */ ob_end_clean(); /* Output buffer-contents */ echo $html; ?>
RSS-Feed | Newsletter | Sitemap | Impressum | Datenschutz