Change "pageid" and "NAV_PAGE_ID" to "navident" and "NAV_IDENT" and add the field to the database

Add schedule class details to "new" theme
This commit is contained in:
james 2010-09-23 21:09:04 +00:00
parent 8282ceaf96
commit bce4bdb2b2
7 changed files with 106 additions and 11 deletions

View File

@ -22,6 +22,11 @@
*/
?>
<?
if($_GET['show_types'])
$NAV_IDENT=$_GET['show_types'][0];
if($_POST['show_types'])
$NAV_IDENT=$_POST['show_types'][0];
require_once('../common.inc.php');
require_once('../user.inc.php');
require_once('../judge.inc.php');

View File

@ -316,8 +316,23 @@ $CWSFDivisions=array(
$pageurl=substr($_SERVER['PHP_SELF'],strlen($config['SFIABDIRECTORY']));
//this code figures out if the page we're on is in the navigation structure, and if so, where, and properly sets the primary, secondary and tertiary navigation variables
$q=mysql_query("SELECT * FROM rolestasks WHERE link='".mysql_real_escape_string($pageurl)."' AND conferencetype='{$conference['type']}'");
if($r=mysql_fetch_object($q)) {
$q=mysql_query("SELECT * FROM rolestasks WHERE
( link='".mysql_real_escape_string($pageurl)."'
OR link LIKE '".mysql_real_escape_string($pageurl)."?%')
AND conferencetype='{$conference['type']}'");
if(mysql_num_rows($q)) {
if(mysql_num_rows($q)==1) {
$r=mysql_fetch_object($q);
}
else {
//take the first one for now
while($r=mysql_fetch_object($q)) {
if($NAV_IDENT==$r->navident)
break;
}
//we have more than one, we need to rely on the $navident now
}
//okay we found it, now get its full tree above it
//set things to 0 to start

View File

@ -1 +1 @@
206
207

1
db/db.update.207.sql Normal file
View File

@ -0,0 +1 @@
ALTER TABLE `rolestasks` ADD `navident` VARCHAR( 64 ) NULL DEFAULT NULL AFTER `link`;

View File

@ -53,6 +53,16 @@ function doTree($id,$roleid,$ctype) {
}
echo "</span>";
echo "]";
echo "&nbsp;&nbsp;&nbsp;";
echo "&laquo;";
echo "<span id=\"task_navident_{$r->id}\">";
if($r->navident) {
echo trim($r->navident);
}
echo "</span>";
echo "&raquo;";
echo "&nbsp;&nbsp;&nbsp;";
echo "<span id=\"task_save_{$r->id}\"></span>";
@ -122,7 +132,8 @@ function doTree($id,$roleid,$ctype) {
$id=intval($_POST['id']);
mysql_query("UPDATE rolestasks SET
task='".mysql_real_escape_string($_POST['name'])."',
link='".mysql_real_escape_string($_POST['link'])."'
link='".mysql_real_escape_string($_POST['link'])."',
navident='".mysql_real_escape_string($_POST['navident'])."'
WHERE id='$id'");
exit;
}
@ -233,7 +244,9 @@ function removeTask(id) {
function editTask(id) {
var v_link=$("#task_link_"+id).html();
var v_name=$("#task_name_"+id).html();
var v_navident=$("#task_navident_"+id).html();
$("#task_navident_"+id).html("<input type=\"text\" size=\"30\" value=\""+v_navident+"\" name=\"edit_task_navident\" id=\"edit_task_navident_"+id+"\">");
$("#task_link_"+id).html("<input type=\"text\" size=\"30\" value=\""+v_link+"\" name=\"edit_task_link\" id=\"edit_task_link_"+id+"\">");
$("#task_name_"+id).html("<input type=\"text\" size=\"30\" value=\""+v_name+"\" name=\"edit_task_name\" id=\"edit_task_name_"+id+"\">");
$("#task_save_"+id).html("<input type=\"button\" name=\"editlink_save\" value=\"Save\" onclick=\"saveTask("+id+")\">");
@ -243,12 +256,14 @@ function editTask(id) {
function saveTask(id) {
var v_link=$("#edit_task_link_"+id).val();
var v_name=$("#edit_task_name_"+id).val();
var v_navident=$("#edit_task_navident_"+id).val();
$("#task_save_"+id).html("");
$.post("roletasks.php",{action: 'savetask', id: id, link: v_link, name: v_name},function() {
$.post("roletasks.php",{action: 'savetask', id: id, link: v_link, name: v_name, navident: v_navident},function() {
$("#task_link_"+id).html(v_link);
$("#task_name_"+id).html(v_name);
$("#task_navident_"+id).html(v_navident);
});
}

View File

@ -86,8 +86,7 @@ table tr.odd {
height: 24px;
}
#secondarymenu
#division-menu {
#secondarymenu #division-menu {
text-align: center;
background: #E0E0FF;
padding: 2px;
@ -95,11 +94,9 @@ table tr.odd {
margin-top: 0px;
margin-bottom: 5px;
height: 22px;
display: none;
}
#tertiarymenu,
#topic-menu {
#tertiarymenu, #topic-menu {
width: 200px;
min-height: 600px;
background: #EEEEFF;
@ -109,7 +106,6 @@ table tr.odd {
float: left;
margin-left: 0px;
margin-right: 10px;
display: none;
}
#main {

View File

@ -166,5 +166,68 @@ div.assignment-selector-form form input {
width: 80px;
}
.schedule {
border: 2px solid black;
border-collapse: collapse;
margin-left: 20px;
}
.schedule th {
background-color: #1B86B7;
color: white;
font-weight: bold;
width: 150px;
text-align: center;
border: 1px solid black;
}
.schedule td {
border: 1px solid #CCCCCC;
height: 20px;
overflow: auto;
}
.scheduletime {
font-size: 0.8em;
font-weight: bold;
}
.schedule td:hover {
background-color: #25BEFF;
}
.scheduleevent {
position: absolute;
border: 2px solid #777777;
background: #FFC143;
width: 150px;
margin:0;
width: 148px;
z-index: 1000;
display: none;
overflow: auto;
font-size: 0.8em;
text-align: center;
cursor: pointer;
}
.scheduleevent_title {
font-weight: bold;
font-size: 1.1em;
}
.scheduleevent_general {
background: #FFC552;
}
.scheduleevent_scienceolympic {
background: #8FB4FF;
}
.scheduleevent_sciencefairjudging {
background: #FFCCF6;
}
.scheduleevent_tour {
background: #CCFFD5;
}