diff --git a/common.inc.php b/common.inc.php
index ee0028f..df2e418 100644
--- a/common.inc.php
+++ b/common.inc.php
@@ -433,6 +433,7 @@ function send_header($title="", $nav=null, $icon=null, $titletranslated=false)
{
global $HEADER_SENT;
global $config;
+ global $roles;
global $prependdir;
global $conference;
@@ -459,6 +460,32 @@ $(document).ready(function(){
if($("#importantdatesbox").length)
$("#importantdatesbox").load("important_dates.php?display=box");
});
+
+
+function taskNav(id,pid,level) {
+ switch(level) {
+ case 0: //clicked on a top-level nav, so populate the secondary menu
+ $("#secondarymenu").load("=$config['SFIABDIRECTORY']?>/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("=$config['SFIABDIRECTORY']?>/nav.php?level=2&id="+id,null,function() {
+ $("#tertiarymenu_accordion").accordion({clearStyle: true}); //"option", "collapsible", true);
+ });
+ $("#tertiarymenu").show();
+ break;
+
+ }
+ return false;
+}
//if we're under /admin or /config we also want the translation editor
@@ -529,18 +556,9 @@ if(!$_SESSION['conferences_id']) {
-
-if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config" || substr(getcwd(),-6)=="/super") {
- ?>
-
-
-}
-/*
-
+
-*/
+
+
+
+if($_SESSION['nav']['primary']) {
+ echo "\n";
+}
+
+if($_SESSION['nav']['secondary']) {
+ echo "\n";
+}
+
?>
+
/*
if(is_array($nav)) {
diff --git a/db/db.code.version.txt b/db/db.code.version.txt
index 08839f6..3bc92d4 100644
--- a/db/db.code.version.txt
+++ b/db/db.code.version.txt
@@ -1 +1 @@
-200
+201
diff --git a/db/db.update.201.sql b/db/db.update.201.sql
new file mode 100644
index 0000000..ad251c3
--- /dev/null
+++ b/db/db.update.201.sql
@@ -0,0 +1,43 @@
+CREATE TABLE `rolestasks` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `pid` int(11) NOT NULL,
+ `roles_id` int(11) NOT NULL,
+ `level` int(11) NOT NULL,
+ `task` varchar(64) NOT NULL,
+ `ord` int(11) NOT NULL,
+ `link` varchar(255) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=31 ;
+
+INSERT INTO `rolestasks` (`id`, `pid`, `roles_id`, `level`, `task`, `ord`, `link`) VALUES
+(1, 0, 13, 0, 'Configuration', 0, '/config/index.php'),
+(2, 0, 12, 0, 'Administration', 0, '/admin/index.php'),
+(3, 2, 12, 1, 'General Tasks', 2, ''),
+(4, 2, 12, 1, 'People Tasks', 1, ''),
+(5, 2, 12, 1, 'Event Preparation', 3, ''),
+(6, 2, 12, 1, 'Event Wrap-Up', 4, ''),
+(7, 5, 12, 2, 'Awards Management', 0, ''),
+(8, 5, 12, 2, 'Schools Management', 0, ''),
+(9, 5, 12, 2, 'Tour Management', 0, ''),
+(10, 5, 12, 2, 'Report Management', 0, ''),
+(11, 7, 12, 3, 'Awards Editor', 0, '/admin/award_awards.php'),
+(12, 7, 12, 3, 'Sponsors', 0, '/admin/sponsors.php'),
+(13, 4, 12, 2, 'Participant Registration', 0, ''),
+(14, 13, 12, 3, 'Input Received Signature Forms ', 0, '/admin/registration_receivedforms.php'),
+(15, 13, 12, 3, 'Registration List and Student/Project Editor', 0, '/admin/registration_list.php'),
+(16, 13, 12, 3, 'Registration Statistics', 0, '/admin/registration_stats.php'),
+(17, 13, 12, 3, 'Website Consent', 0, '/admin/registration_webconsent.php'),
+(18, 4, 12, 2, 'Committee Management', 2, ''),
+(19, 4, 12, 2, 'Judging Management', 3, ''),
+(20, 4, 12, 2, 'Tour Management', 4, ''),
+(21, 18, 12, 3, 'Committee Management', 0, '/admin/committees.php'),
+(22, 19, 12, 3, 'Invite Judges', 0, '/admin/user_invite.php?type=judge'),
+(23, 19, 12, 3, 'Manage Judges', 2, '/admin/user_list.php?show_types[]=judge'),
+(24, 19, 12, 3, 'Create/Edit Judging Timeslots', 3, '/admin/judges_timeslots.php'),
+(25, 19, 12, 3, 'Create/Edit Divisional Judging Groupings', 4, '/admin/judges_jdiv.php'),
+(26, 19, 12, 3, 'Run the Automatic Judging Scheduler', 5, '/admin/judges_schedulerconfig.php'),
+(27, 19, 12, 3, 'Manage Judging Teams', 6, '/admin/judges_teams.php'),
+(28, 19, 12, 3, 'Manage Judging Team Members', 7, '/admin/judges_teams_members.php'),
+(29, 19, 12, 3, 'Manage Judging Team Timeslot Assignments', 8, '/admin/judges_teams_timeslots.php'),
+(30, 19, 12, 3, 'Manage Judging Team Project Assignments', 9, '/admin/judges_teams_projects.php');
+
diff --git a/nav.php b/nav.php
new file mode 100644
index 0000000..9df8fff
--- /dev/null
+++ b/nav.php
@@ -0,0 +1,63 @@
+
+/*
+ This file is part of the 'Science Fair In A Box' project
+ SFIAB Website: http://www.sfiab.ca
+
+ Copyright (C) 2010 James Grant
+
+ 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
+ $_SESSION['nav']['primary']=$id;
+ unset($_SESSION['nav']['secondary']);
+ $q=mysql_query("SELECT * FROM rolestasks WHERE pid='$id' AND level=1 ORDER By ord,task");
+ echo "";
+ $cl="";
+ while($r=mysql_fetch_object($q)) {
+ if($_SESSION['nav']['secondary'] == $r->id) {
+ $cl="class=\"secondarynav-selected\"";
+ }
+ else $cl="";
+ echo "- id}\" $cl>id,$r->pid,$r->level)\">".i18n($r->task)."
\n";
+ }
+ echo "
\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 "\n";
+ echo "";
+ $q2=mysql_query("SELECT * FROM rolestasks WHERE pid='$r->id' AND level=3 ORDER BY ord,task");
+ while($r2=mysql_fetch_object($q2)) {
+ echo "- link\">".i18n($r2->task)."
\n";
+ }
+ echo "
";
+ }
+ echo "\n";
+ break;
+ }
+ }
+?>
+
diff --git a/theme/default/sfiab.css b/theme/default/sfiab.css
index 878d53a..19075eb 100644
--- a/theme/default/sfiab.css
+++ b/theme/default/sfiab.css
@@ -93,19 +93,22 @@ table tr.odd {
margin-top: 0px;
margin-bottom: 5px;
height: 22px;
+ display: none;
}
-#left {
- width: 165px;
+#tertiarymenu {
+ width: 200px;
+ min-height: 600px;
background: #EEEEFF;
border: 2px solid Silver;
padding: 5px;
- font-size: 1.0em;
+ font-size: 1.1em;
float: left;
- margin-left: 3px;
+ margin-left: 0px;
+ margin-right: 10px;
+ display: none;
}
-
#main {
background: #FFFFFF;
padding: 3px;
@@ -178,21 +181,26 @@ h4 {
margin-bottom: .1em;
}
-ul.mainnav {
+ul.primarynav li.primarynav-selected a {
+ background-color: white;
+ color: black;
+}
+
+ul.primarynav {
list-style : none;
margin : 0;
padding : 0;
border: 0px;
}
-ul.mainnav li {
+ul.primarynav li {
display: block;
float: left;
border: 1px solid black;
margin-right: 5px;
}
-ul.mainnav li a {
+ul.primarynav li a {
display : block;
padding : 3px;
background-color : #5C6F90;
@@ -201,13 +209,48 @@ ul.mainnav li a {
text-decoration : none;
}
-ul.mainnav li a:hover {
+ul.primarynav li a:hover {
display : block;
background-color : #63616b;
color : #eee;
text-decoration: none;
}
+ul.secondarynav {
+ list-style : none;
+ margin : 0;
+ padding : 0;
+ border: 0px;
+}
+
+ul.secondarynav li {
+ display: block;
+ float: left;
+ border: 1px solid black;
+ margin-right: 5px;
+}
+
+ul.secondarynav li a {
+ display : block;
+ padding : 3px;
+ background-color : #5C6F90;
+ font-weight: bold;
+ color : #fff;
+ text-decoration : none;
+}
+
+ul.secondarynav li a:hover {
+ display : block;
+ background-color : #63616b;
+ color : #eee;
+ text-decoration: none;
+}
+
+ul.secondarynav li.secondarynav-selected a {
+ background-color: white;
+ color: black;
+}
+
.aligncenter {
width: 100%;
text-align: center;