2010-07-13 21:23:39 +00:00
|
|
|
<?
|
|
|
|
/*
|
|
|
|
This file is part of the 'Science Fair In A Box' project
|
|
|
|
SFIAB Website: http://www.sfiab.ca
|
|
|
|
|
|
|
|
Copyright (C) 2010 James Grant <james@lightbox.org>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public
|
|
|
|
License as published by the Free Software Foundation, version 2.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; see the file COPYING. If not, write to
|
|
|
|
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<?
|
|
|
|
include "common.inc.php";
|
|
|
|
$id=intval($_GET['id']);
|
|
|
|
$level=intval($_GET['level']);
|
|
|
|
|
|
|
|
if($id && $level) {
|
|
|
|
switch($level) {
|
|
|
|
case 1: //populate the scecondary menu
|
2010-07-15 21:24:10 +00:00
|
|
|
if($_SESSION['nav']['primary']!=$id) {
|
|
|
|
$_SESSION['nav']['primary']=$id;
|
|
|
|
unset($_SESSION['nav']['secondary']);
|
|
|
|
}
|
2010-07-13 21:23:39 +00:00
|
|
|
$q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=1 ORDER By ord,task");
|
|
|
|
echo "<ul class=\"secondarynav\">";
|
|
|
|
$cl="";
|
|
|
|
while($r=mysql_fetch_object($q)) {
|
|
|
|
if($_SESSION['nav']['secondary'] == $r->id) {
|
|
|
|
$cl="class=\"secondarynav-selected\"";
|
|
|
|
}
|
|
|
|
else $cl="";
|
|
|
|
echo "<li id=\"secondary_nav_{$r->id}\" $cl><a href=\"#\" onclick=\"return taskNav($r->id,$r->pid,$r->level)\">".i18n($r->task)."</a></li>\n";
|
|
|
|
}
|
|
|
|
echo "</ul>\n";
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2: //populate the tertiary menu
|
|
|
|
$_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 "<h3><a href=\"{$config['SFIABDIRECTORY']}$r->link\">".i18n("$r->task")."</a></h3>\n";
|
|
|
|
echo "<ul>";
|
|
|
|
$q2=mysql_query("SELECT * FROM rolestasks WHERE pid='$r->id' AND level=3 ORDER BY ord,task");
|
|
|
|
while($r2=mysql_fetch_object($q2)) {
|
|
|
|
echo "<li><a href=\"".$config['SFIABDIRECTORY']."$r2->link\">".i18n($r2->task)."</a></li>\n";
|
|
|
|
}
|
|
|
|
echo "</ul>";
|
|
|
|
}
|
|
|
|
echo "</ul>\n";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|