diff --git a/admin/registration_list.php b/admin/registration_list.php index 8e4c94a..6209fe7 100644 --- a/admin/registration_list.php +++ b/admin/registration_list.php @@ -309,7 +309,7 @@ $(document).ready(function() {
- +
"; echo ""; + echo ""; foreach($divs AS $d=>$dn) { echo ""; $tstud=0; @@ -225,7 +226,7 @@ else $wherestatus=""; echo ($tproj); echo ""; echo ""; - + echo ""; echo "
:
diff --git a/admin/registration_stats.php b/admin/registration_stats.php index f4074c5..c32c251 100644 --- a/admin/registration_stats.php +++ b/admin/registration_stats.php @@ -183,6 +183,7 @@ else $wherestatus=""; } echo "
".i18n("Total")."
".i18n("Stud | Proj")."
$dn
"; echo ""; @@ -239,10 +240,10 @@ else $wherestatus=""; } echo "".i18n("Total")."
".i18n("Stud | Proj").""; echo ""; + echo ""; asort($schools_names); - foreach($schools_names AS $id=>$sn) - { + foreach($schools_names AS $id=>$sn) { echo "$sn"; $tstud=0; $tproj=0; @@ -258,6 +259,7 @@ else $wherestatus=""; echo ($tproj?$tproj:0).""; echo ""; } + echo ""; echo ""; echo i18n("%1 schools total",array(count($schools_names))); @@ -266,7 +268,7 @@ else $wherestatus=""; echo "

{$status_str[$showstatus]} - ".i18n("Projects per age category / division / language")."

"; echo ""; echo ""; - echo ""; + echo ""; foreach($cats AS $c=>$cn) { echo ""; } @@ -283,11 +285,11 @@ else $wherestatus=""; echo ""; } echo ""; + echo ""; foreach($divs AS $d=>$dn) { echo ""; $tproj=array(); - foreach($cats AS $c=>$cn) - { + foreach($cats AS $c=>$cn) { foreach($languages AS $l=>$ln) { echo ""; - + echo ""; echo "
$cn$l
$dn"; echo ($stats_projects_lang[$c][$d][$l]?$stats_projects_lang[$c][$d][$l]:0); @@ -321,7 +323,7 @@ else $wherestatus=""; } echo "
"; echo ""; diff --git a/admin/registration_webconsent.php b/admin/registration_webconsent.php index de069cc..b720719 100644 --- a/admin/registration_webconsent.php +++ b/admin/registration_webconsent.php @@ -102,6 +102,7 @@ echo " ".i18n("Last").""; echo " ".i18n("Photo").""; echo ""; + echo ""; while($r=mysql_fetch_object($sq)) { echo ""; @@ -115,6 +116,7 @@ echo "id]\" value=\"yes\" onchange=\"changed($r->id)\">"; echo ""; } + echo ""; echo ""; echo ""; echo ""; diff --git a/common.inc.php b/common.inc.php index f64b0af..87ce281 100644 --- a/common.inc.php +++ b/common.inc.php @@ -62,55 +62,43 @@ $(document).ready(function(){ }); -function taskNav(id,pid,level) { - switch(level) { - case 0: //clicked on a top-level nav, so populate the secondary menu - $("#secondarymenu").load("/nav.php?level=1&id="+id); - $("#secondarymenu").show(); - $("#tertiarymenu").hide(); - $(".primarynav-selected").removeClass("primarynav-selected"); - $("#primary_nav_"+id).addClass("primarynav-selected"); - break; - - case 1: //clicked on a secondary nav, so populate the left-menu - $(".secondarynav-selected").removeClass("secondarynav-selected"); - $("#secondary_nav_"+id).addClass("secondarynav-selected"); - - $("#tertiarymenu_accordion").accordion("destroy"); - $("#tertiarymenu_accordion").load("/nav.php?level=2&id="+id,null,function() { - $("#tertiarymenu_accordion").accordion({clearStyle: true, collapsible: true, active: false}); //"option", "collapsible", true); - $("#tertiarymenu_accordion").accordion("activate",false); - $("#tertiarymenu").show(); - }); - break; - - } - return false; -} - function taskNavLevel(l1,l2,l3,l4) { if(l2) { - $("#secondarymenu").load("/nav.php?level=1&id="+l1); - $("#secondarymenu").show(); + //we have a secondary click, which implies we also have a primary nav selected + //we may or may not have l3 or l4 though, so they are handled separately below + $("#secondarymenu").load("/nav.php?level=1&id="+l1,null,function() { + $("#secondarymenu").show(); - $("#tertiarymenu_accordion").accordion("destroy"); - $("#tertiarymenu_accordion").load("/nav.php?level=2&id="+l2,null,function() { - $("#tertiarymenu_accordion").accordion({clearStyle: true, collapsible: true, active: false}); //"option", "collapsible", true); - $("#tertiarymenu").show(); + $("#tertiarymenu_accordion").accordion("destroy"); + $("#tertiarymenu_accordion").load("/nav.php?level=2&id="+l2,null,function() { + $("#tertiarymenu_accordion").accordion({clearStyle: true, collapsible: true, active: false}); //"option", "collapsible", true); + $("#tertiarymenu").show(); - $(".primarynav-selected").removeClass("primarynav-selected"); - $("#primary_nav_"+l1).addClass("primarynav-selected"); + $(".primarynav-selected").removeClass("primarynav-selected"); + $("#primary_nav_"+l1).addClass("primarynav-selected"); - $(".secondarynav-selected").removeClass("secondarynav-selected"); - $("#secondary_nav_"+l2).addClass("secondarynav-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"); - } + //if we have a 3rd level nav, open up the accordion to the appropriate place + if(l3) { + $("#tertiarymenu_accordion").accordion("activate",$("#tertiary_nav_"+l3)); + } + //if we have a 4th level nav, set the selected class on the appropriate item in the list + if(l4) { + $(".tertiarylinknav-selected").removeClass("tertiarylinknav-selected"); + $("#tertiarylink_nav_"+l4).addClass("tertiarylinknav-selected"); + } + }); + }); + } + else { + //only the primary link clicked, so show the secondary, and thats it. + $("#secondarymenu").load("/nav.php?level=1&id="+l1,null,function() { + //show the secondary + $("#secondarymenu").show(); + //and hide the tertiary + $("#tertiarymenu").hide(); }); } @@ -304,7 +292,7 @@ if(is_array($_SESSION['roles'])) { $cl="class=\"selected\""; } echo "
  • id}\" $cl>"; - echo "id,$r->pid,$r->level)\">".i18n($r->task).""; + echo "id,0,0,0)\">".i18n($r->task).""; echo "
  • \n"; } } @@ -352,27 +340,27 @@ if(array_key_exists('users_id', $_SESSION)) { //take SFIABDIRECTORY off of the current URL $pageurl=substr($_SERVER['PHP_SELF'],strlen($config['SFIABDIRECTORY'])); +echo "looking up [$pageurl]
    "; $q=mysql_query("SELECT * FROM rolestasks WHERE link='".mysql_real_escape_string($pageurl)."'"); if($r=mysql_fetch_object($q)) { - //okay we found it, now what do we do? - //FIXME: we need to populate the secondarynva, tertiarynav, and select the right thing in the accordion, - //because we cannot assume that the user navigated to this page via the pri/sec/ter nav menus + //okay we found it, now get its full tree above it $navTree=array(); upTree($r->id,&$navTree); + + //set things to 0 to start $_SESSION['nav']['primary']=0; $_SESSION['nav']['secondary']=0; $_SESSION['nav']['tertiary']=0; $_SESSION['nav']['tertiarylink']=0; + //go through each one, and set the SESSION vars foreach($navTree AS $t) { switch($t['level']) { case 0: //primary nav $_SESSION['nav']['primary']=$t['id']; -// echo "$(\"#primary_nav_".$t['id']."\").addClass('primarynav-selected');"; break; case 1: //secondary nav $_SESSION['nav']['secondary']=$t['id']; -// echo "$(\"#secondary_nav_".$t['id']."\").addClass('secondarynav-selected');"; break; case 2: //tertiary nav heading $_SESSION['nav']['tertiary']=$t['id']; @@ -382,18 +370,16 @@ if($r=mysql_fetch_object($q)) { break; } } - echo "\n"; +} +else { } /* if(is_array($nav)) { @@ -476,7 +462,6 @@ echo "SFIAB Version ".$config['
    Debug...
    - diff --git a/nav.php b/nav.php index 4a78693..8017fa6 100644 --- a/nav.php +++ b/nav.php @@ -43,10 +43,8 @@ } else $cl=""; echo "
  • id}\" $cl>"; - echo "id,$r->pid,$r->level)\">".i18n($r->task).""; - if($_SESSION['debug']) { - //echo "pid, $r->id)\">(*)"; - } + //echo "id,$r->pid,$r->level)\">".i18n($r->task).""; + echo "pid, $r->id)\">".i18n($r->task).""; echo "
  • \n"; } echo "\n";