fra Menu til submenu til thirtmenu. virker ikk ?
Hej eksperter, her et php script hvor jeg har en menu, når man så trykker kommer submenu frem, vil gerne have så når man trykker der kommer thirtmenu under den, men kan ikk lige få det til at virke, sikkert nok fordi det er total forkert.. men her er det.. :<?php
// Main menu items
$mainMenu['Home'] = 'index.php';
$mainMenu['Findings'] = 'Findings.php';
$mainMenu['Background'] = 'Background.php';
// Sub menu items
$subMenu['Findings'] ['The Symbols'] = 'The-Symbols.php';
$subMenu['Findings'] ['Survey Results'] = 'Survey-Results.php';
$subMenu['Findings'] ['Standard Unit.php'] = 'Standard-Unit.php';
$subMenu['Findings'] ['Angles'] = 'Angles.php';
$subMenu['Findings'] ['Standard Unit'] = 'Standard-Unit.php';
$subMenu['Findings'] ['Pyramid'] = 'Pyramid.php';
$subMenu['Findings'] ['Knowledge Base'] = 'Knowledge-Base.php';
$subMenu['Findings'] ['Lines on the Landscape'] = 'Lines-on-the-Landscape.php';
$subMenu['Findings'] ['Standard Unit'] = 'Standard-Unit.php';
$subMenu['Background'] ['A. Thom'] = 'A.-Thom.php';
$subMenu['Background'] ['Time & Distance'] = 'Time-&-Distance.php';
$subMenu['Background'] ['Sun, Moon & Venus'] = 'Sun,-Moon-&-Venus.php';
$subMenu['Background'] ['Nodal Regression'] = 'Nodal-Regression.php';
$subMenu['Background'] ['Venus'] = 'Venus.php';
$thirdMenu['Background'] ['Venus'] = 'Venus.php';
?>
<?php
class maxNavigation{
function showMenu(){
global $mainMenu,$subMenu;
$actualPage = $_SERVER['PHP_SELF'];
$actualPath = $_SERVER['REQUEST_URI'];
$actualPageName = basename($actualPage);
//echo $page;
//echo "$actualPage <br/> $actualPath";
$actMenu = '';
foreach ($mainMenu as $menu => $link) {
if ($link == $actualPageName) $actMenu = $menu;
if (isset($subMenu[$menu])){
foreach ($subMenu[$menu] as $menuSub => $linkSub) {
if ($linkSub == $actualPageName) $actMenu = $menu;
}
}
}
// Now display the menu
foreach ($mainMenu as $menu => $link) {
$class = ' class="mainMenuLink" ';
if ($actualPageName == $link) $class=' class="mainMenuLinkSelected" ';
echo '<a'.$class.'href="'.$link.'">'.$menu.'</a>';
if ( ($actMenu == $menu) && (isset($subMenu[$menu])) ){
foreach ($subMenu[$menu] as $menuSub => $linkSub) {
$class = ' class="subMenuLink" ';
if ($actualPageName == $linkSub) $class=' class="subMenuLinkSelected" ';
echo '<a'.$class.'href="'.$linkSub.'">'.$menuSub.'</a>';
}
}
}
}
}
$navi = new maxNavigation();
$navi->showMenu();
?>
<?php
class maxNavigation1{
function showMenu(){
global $subMenu,$thirdMenu;
$actualPage = $_SERVER['PHP_SELF'];
$actualPath = $_SERVER['REQUEST_URI'];
$actualPageName = basename($actualPage);
//echo $page;
//echo "$actualPage <br/> $actualPath";
$actMenu = '';
foreach ($subMenu as $menu => $link) {
if ($link == $actualPageName) $actMenu = $menu;
if (isset($thirdMenu[$menu])){
foreach ($thirdMenu[$menu] as $menuSub => $linkSub) {
if ($linkSub == $actualPageName) $actMenu = $menu;
}
}
}
// Now display the menu
foreach ($thirdMenu as $submenu => $link) {
$class = ' class="mainMenuLink" ';
if ($actualPageName == $link) $class=' class="mainMenuLinkSelected" ';
echo '<a'.$class.'href="'.$link.'">'.$menu.'</a>';
if ( ($actMenu == $menu) && (isset($subMenu[$submenu])) ){
foreach ($thirdMenu[$submenu] as $menuSub => $linkSub) {
$class = ' class="subMenuLink" ';
if ($actualPageName == $linkSub) $class=' class="subMenuLinkSelected" ';
echo '<a'.$class.'href="'.$linkSub.'">'.$menuSub.'</a>';
}
}
}
}
}
$navi = new maxNavigation1();
$navi->showMenu();
?>