ich benutze das Dropdown Menü vpNavigation. Leider werden dort auch die Menüpunkte im geschützen Bereich angezeigt. Kann mir jemand helfen was ich im Code verändern muss damit die geschützen Menüpunkte nur angezeigt werden wenn man eingeloggt ist. Hier ist der Output-Code vom Modul:
Code: Alles auswählen
<?php
/***********************************************
* CONTENIDO MODUL - OUTPUT
*
* Modulname : vpNavigation 0.2
* Author : Ingo van Peeren
* Copyright : Ingo van Peeren (ingo@van-peeren.de)
* Created : 30-03-2005
* Modified : 16-07-2005
************************************************/
$hauptkategorie = "CMS_VALUE[0]";
$navitems = array();
function nav_feld ($cat) {
global $client, $lang, $cfg, $idcat;
if (!is_object($db)) {
$db = new DB_Contenido;
}
$sql = "SELECT
A.idcat,
B.parentid,
C.name
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 = '$cat'
ORDER BY
A.idtree";
$db->query($sql);
while ( $db->next_record() ) {
$aktiv = "";
$sub_feld = nav_feld($db->f("idcat"));
if ($db->f("idcat") == $idcat) $aktiv = "active";
elseif ($sub_feld["activepath"]) $aktiv = "activepath";
$nav_feld[] = array("idcat" => $db->f("idcat"),
"name" => $db->f("name"),
"active" => $aktiv,
"sub" => $sub_feld);
if ($aktiv != "") $activepath = $aktiv;
}
$rv = array("feld" => $nav_feld,
"activepath" => $activepath);
return $rv;
}
function liste ($array, $indent = " ")
{
global $first;
if (is_array($array["feld"])) {
if ($first) {
echo $indent . "<ul id=\"nav\">\n";
$first = 0;
}
else echo $indent . "<ul>\n";
foreach ($array["feld"] as $menupunkt) {
if ($menupunkt["active"] == "active") echo $indent . $indent . "<li id=\"active\">\n";
elseif ($menupunkt["active"] == "activepath") echo $indent . $indent . "<li class=\"activepath\">\n";
else echo $indent . $indent . "<li>\n";
if (is_array($menupunkt["sub"]["feld"])) {
echo $indent . $indent . $indent . "<a class=\"daddy\" href=\"front_content.php?idcat=" . $menupunkt["idcat"] . "\">" . $menupunkt["name"] . "</a>\n";
liste($menupunkt["sub"], $indent." ");
}
else echo $indent . $indent . $indent . "<a href=\"front_content.php?idcat=" . $menupunkt["idcat"] . "\">" . $menupunkt["name"] . "</a>\n";
echo $indent . $indent . "</li>\n";
}
echo $indent . "</ul>\n";
}
}
/* Create Navigation Array */
$navitems = nav_feld($hauptkategorie);
$first = 1;
liste($navitems);
?>