From a4ea8b2f4d7dd944eea0dab6c6f1c9a296be85c0 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 21 Jul 2010 18:37:03 +0000 Subject: [PATCH] More updates to the nav - now keeps track of the accordion tab position, and which link within the accordion is seelcted --- common.inc.php | 68 +++++++++++++++++++++++++++++------------ nav.php | 13 +++++--- theme/default/sfiab.css | 12 ++++++++ 3 files changed, 70 insertions(+), 23 deletions(-) diff --git a/common.inc.php b/common.inc.php index ca98089..ff21677 100644 --- a/common.inc.php +++ b/common.inc.php @@ -79,13 +79,41 @@ function taskNav(id,pid,level) { $("#tertiarymenu_accordion").accordion("destroy"); $("#tertiarymenu_accordion").load("/nav.php?level=2&id="+id,null,function() { $("#tertiarymenu_accordion").accordion({clearStyle: true}); //"option", "collapsible", true); - $("#tertiarymenu").show(); + $("#tertiarymenu").show(); }); break; } return false; } + +function taskNavLevel(l1,l2,l3,l4) { + if(l2) { + $("#secondarymenu").load("/nav.php?level=1&id="+l1); + $("#secondarymenu").show(); + + $("#tertiarymenu_accordion").accordion("destroy"); + $("#tertiarymenu_accordion").load("/nav.php?level=2&id="+l2,null,function() { + $("#tertiarymenu_accordion").accordion({clearStyle: true}); //"option", "collapsible", true); + $("#tertiarymenu").show(); + + $(".primarynav-selected").removeClass("primarynav-selected"); + $("#primary_nav_"+l1).addClass("primarynav-selected"); + + $(".secondarynav-selected").removeClass("secondarynav-selected"); + $("#secondary_nav_"+l2).addClass("secondarynav-selected"); + + if(l3) { + $("#tertiarymenu_accordion").accordion("activate",$("#tertiary_nav_"+l3)); + } + if(l4) { + $(".tertiarylinknav-selected").removeClass("tertiarylinknav-selected"); + $("#tertiarylink_nav_"+l4).addClass("tertiarylinknav-selected"); + } + }); + } + +} id; $cl="class=\"selected\""; } - echo "
  • id}\" $cl>id,$r->pid,$r->level)\">".i18n($r->task)."
  • \n"; + echo "
  • id}\" $cl>"; + echo "id,$r->pid,$r->level)\">".i18n($r->task).""; + echo "
  • \n"; } } } @@ -324,10 +354,10 @@ if($r=mysql_fetch_object($q)) { //because we cannot assume that the user navigated to this page via the pri/sec/ter nav menus $navTree=array(); upTree($r->id,&$navTree); - - echo "\n"; } -echo "\n"; - /* if(is_array($nav)) { echo "
    ".i18n('You are here:').' '; diff --git a/nav.php b/nav.php index 7610fab..a86f72a 100644 --- a/nav.php +++ b/nav.php @@ -40,7 +40,12 @@ $cl="class=\"secondarynav-selected\""; } else $cl=""; - echo "
  • id}\" $cl>id,$r->pid,$r->level)\">".i18n($r->task)."
  • \n"; + echo "
  • id}\" $cl>"; + echo "id,$r->pid,$r->level)\">".i18n($r->task).""; + if($_SESSION['debug']) { + //echo "pid, $r->id)\">(*)"; + } + echo "
  • \n"; } echo "\n"; break; @@ -49,11 +54,11 @@ $_SESSION['nav']['secondary']=$id; $q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=2 ORDER By ord,task"); while($r=mysql_fetch_object($q)) { - echo "

    link\">".i18n("$r->task")."

    \n"; - echo "