Re-arrange some stuff as per new UI specs

This commit is contained in:
james 2010-07-09 19:04:25 +00:00
parent b09257b47e
commit fe5b170371
3 changed files with 102 additions and 38 deletions

View File

@ -461,12 +461,34 @@ if(substr(getcwd(),-6)=="/admin" || substr(getcwd(),-7)=="/config")
?> ?>
<div id="notice_area" class="notice_area"></div> <div id="notice_area" class="notice_area"></div>
<div id="header"> <div id="topnav">
<? <?
if(file_exists($prependdir."data/{$conference['id']}-logo-100.gif")) if(count($config['languages'])>1) {
echo "<form name=\"languageselect\" method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo i18n("Language").": ";
echo "<select name=\"switchlanguage\" onchange=\"document.forms.languageselect.submit()\">\n";
foreach($config['languages'] AS $key=>$val) {
if($_SESSION['lang']==$key) $selected="selected=\"selected\""; else $selected="";
echo "<option $selected value=\"$key\">$val</option>";
}
echo "</select>";
echo "</form>";
}
?>
</div>
<div id="header">
<div id="header_logo">
<?
if(file_exists($prependdir."data/{$conference['id']}-logo-100.gif")) {
echo "<img align=\"left\" height=\"50\" src=\"".$config['SFIABDIRECTORY']."/data/{$conference['id']}-logo-100.gif\">"; echo "<img align=\"left\" height=\"50\" src=\"".$config['SFIABDIRECTORY']."/data/{$conference['id']}-logo-100.gif\">";
else if(file_exists($prependdir."data/logo-100.gif")) } else if(file_exists($prependdir."data/logo-100.gif")) {
echo "<img align=\"left\" height=\"50\" src=\"".$config['SFIABDIRECTORY']."/data/logo-100.gif\">"; echo "<img align=\"left\" height=\"50\" src=\"".$config['SFIABDIRECTORY']."/data/logo-100.gif\">";
}
?>
</div>
<div id="header_title">
<?
if(!$_SESSION['conferenceid']) { if(!$_SESSION['conferenceid']) {
echo "<h1>".i18n($config['fairname'])."</h1>"; echo "<h1>".i18n($config['fairname'])."</h1>";
@ -475,6 +497,27 @@ if(!$_SESSION['conferenceid']) {
echo "<h1>".i18n($conference['name'])."</h1>"; echo "<h1>".i18n($conference['name'])."</h1>";
} }
?>
</div>
<div id="header_conferences">
<?
$q=mysql_query("SELECT * FROM conferences WHERE status='running' ORDER BY name");
if(mysql_num_rows($q)) {
echo "<ul class=\"conferencenav\">";
while($r=mysql_fetch_object($q)) {
if($_SESSION['conferenceid']==$r->id)
$cl="class=\"selected\"";
else
$cl="";
echo "<li $cl><a $cl href=\"".$_SERVER['PHP_SELF']."?switchconference=$r->id\">$r->name</a></li>\n";
}
echo "</ul>\n";
}
?>
</div>
<div id="header_login">
<?
echo "<div align=\"right\" style=\"font-size: 0.75em;\">"; echo "<div align=\"right\" style=\"font-size: 0.75em;\">";
if(isset($_SESSION['users_type'])) { if(isset($_SESSION['users_type'])) {
$types = array('volunteer' => 'Volunteer', 'judge' => 'Judge', $types = array('volunteer' => 'Volunteer', 'judge' => 'Judge',
@ -500,11 +543,24 @@ if(isset($_SESSION['users_type'])) {
} }
} else { } else {
echo i18n('Not Logged In'); ?>
<form method="post" action="user_login.php">
<input type="hidden" name="action" value="login" />
<table><tr><td>
<?=i18n("Username")?>:</td><td><input type="text" size="20" name="user" />
</td></tr><tr><td>
<?=i18n("Password")?>:</td><td><input type="password" size="20" name="pass" />
</td></tr>
<tr><td colspan="2" align="center">
<input type="submit" value=<?=i18n("Login")?> />
</td></tr>
</table>
</form>
<?
} }
echo "</div>"; echo "</div>";
?> ?>
<hr /> </div>
</div> </div>
<? <?
@ -524,19 +580,6 @@ echo "</div>";
<div id="left"> <div id="left">
<? <?
$q=mysql_query("SELECT * FROM conferences WHERE status='running' ORDER BY name");
if(mysql_num_rows($q)) {
echo "<ul class=\"conferencenav\">";
while($r=mysql_fetch_object($q)) {
if($_SESSION['conferenceid']==$r->id)
$cl="class=\"selected\"";
else
$cl="";
echo "<li $cl><a $cl href=\"".$_SERVER['PHP_SELF']."?switchconference=$r->id\">$r->name</a></li>\n";
}
echo "</ul>\n";
echo "<br />";
}
if(is_array($nav)) { if(is_array($nav)) {
$navkeys=array_keys($nav); $navkeys=array_keys($nav);
@ -614,19 +657,6 @@ else if($_SESSION['registration_number'] && $_SESSION['registration_id']) {
?></ul> ?></ul>
<div class="aligncenter"> <div class="aligncenter">
<? <?
if(count($config['languages'])>1) {
echo "<br />";
echo "<form name=\"languageselect\" method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<select name=\"switchlanguage\" onchange=\"document.forms.languageselect.submit()\">\n";
foreach($config['languages'] AS $key=>$val) {
if($_SESSION['lang']==$key) $selected="selected=\"selected\""; else $selected="";
echo "<option $selected value=\"$key\">$val</option>";
}
echo "</select>";
echo "</form>";
}
?> ?>
</div> </div>
<? <?

View File

@ -27,11 +27,46 @@ table tr.odd {
background: #E0E0F8; background: #E0E0F8;
} }
#topnav {
margin: 0px;
font-size: 0.95em;
background-color: white;
text-align: right;
}
#header { #header {
height: 50px; height: 50px;
text-align: center; text-align: center;
background: #E0E0FF; background: #E0E0FF;
padding: 10px; padding: 5px;
border-bottom: 2px solid grey;
margin-bottom: 5px;
height: 70px;
}
#header_logo {
position: absolute;
width: 180px;
}
#header_title {
position: absolute;
left: 200px;
margin-right: 380px;
}
#header_conferences {
position: absolute;
right: 210px;
}
#header_login {
border: 1px solid #777777;
background-color: #DDDDDD;
position: absolute;
right: 5px;
height: 70px;
width: 200px;
} }
#footer { #footer {
@ -472,9 +507,9 @@ ul.conferencenav li {
ul.conferencenav li a { ul.conferencenav li a {
display : block; display : block;
margin : 0; margin : 0;
padding : 6px; padding : 3px;
background-color : #5C6F90; background-color : #5C6F90;
font : bold 0.9em/1.5em Arial, sans-serif; font : bold 0.9em/1.2em Arial, sans-serif;
color : #fff; color : #fff;
text-decoration : none; text-decoration : none;
} }
@ -482,9 +517,9 @@ ul.conferencenav li a {
ul.conferencenav li a.selected { ul.conferencenav li a.selected {
display : block; display : block;
margin : 0; margin : 0;
padding : 6px; padding : 3px;
background-color : #1F6DFF; background-color : #1F6DFF;
font : bold 0.9em/1.5em Arial, sans-serif; font : bold 0.9em/1.2em Arial, sans-serif;
color : #fff; color : #fff;
text-decoration : none; text-decoration : none;
} }

View File

@ -26,8 +26,7 @@
require_once("common.inc.php"); require_once("common.inc.php");
require_once("user.inc.php"); require_once("user.inc.php");
function try_login($user, $pass) function try_login($user, $pass) {
{
/* Ensure sanity of inputs, user should be an email address, but it's stored /* Ensure sanity of inputs, user should be an email address, but it's stored
* in the username field */ * in the username field */
/* FIXME: this should be user_valid_email, but can't be yet, because /* FIXME: this should be user_valid_email, but can't be yet, because