Commit 94674736 authored by Chad Barb's avatar Chad Barb

Changed style as per Leigh's request:
 - no lines longer than 80 columns
 - removed some of the more abrupt ?>...<?php
   "leaping in and out of php" constructs;
   left some in.
parent e004f769
...@@ -22,18 +22,19 @@ $BASEPATH = ""; ...@@ -22,18 +22,19 @@ $BASEPATH = "";
# #
function WRITESIDEBARBUTTON($text, $base, $link ) { function WRITESIDEBARBUTTON($text, $base, $link ) {
$link = "$base/$link"; $link = "$base/$link";
echo " <tr><td class=\"menuopt\"><a href=\"$link\">$text</a></td></tr>\n"; echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a></td></tr>\n";
} }
# same as above with "new" gif next to it. # same as above with "new" gif next to it.
function WRITESIDEBARBUTTON_NEW($text, $base, $link ) { function WRITESIDEBARBUTTON_NEW($text, $base, $link ) {
$link = "$base/$link"; $link = "$base/$link";
echo " <tr><td class=\"menuopt\"><a href=\"$link\">$text</a>&nbsp;<img src=\"/new.gif\" /></td></tr>\n"; echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a>&nbsp;";
echo "<img src=\"/new.gif\" /></td></tr>\n";
} }
function WRITESIDEBARBUTTON_ABS($text, $base, $link ) { function WRITESIDEBARBUTTON_ABS($text, $base, $link ) {
$link = "$link"; $link = "$link";
echo " <tr><td class=\"menuopt\"><a href=\"$link\">$text</a></td></tr>\n"; echo "<tr><td class=\"menuopt\"><a href=\"$link\">$text</a></td></tr>\n";
} }
# same as above, but uses a slightly different style sheet so there # same as above, but uses a slightly different style sheet so there
...@@ -41,12 +42,12 @@ function WRITESIDEBARBUTTON_ABS($text, $base, $link ) { ...@@ -41,12 +42,12 @@ function WRITESIDEBARBUTTON_ABS($text, $base, $link ) {
# The devil is, indeed, in the details. # The devil is, indeed, in the details.
function WRITESIDEBARLASTBUTTON($text, $base, $link) { function WRITESIDEBARLASTBUTTON($text, $base, $link) {
$link = "$base/$link"; $link = "$base/$link";
echo " <tr><td class=\"menuoptb\"><a href=\"$link\">$text</a></td></tr>\n"; echo "<tr><td class=\"menuoptb\"><a href=\"$link\">$text</a></td></tr>\n";
} }
# writes a message to the sidebar, without clickability. # writes a message to the sidebar, without clickability.
function WRITESIDEBARNOTICE($text) { function WRITESIDEBARNOTICE($text) {
echo " <tr><td class=\"menuopt\"><b>$text</b></td></tr>\n"; echo "<tr><td class=\"menuopt\"><b>$text</b></td></tr>\n";
} }
# #
...@@ -93,14 +94,15 @@ function WRITESIDEBAR() { ...@@ -93,14 +94,15 @@ function WRITESIDEBAR() {
<tr><td class="menuopts"><input name=query /> <tr><td class="menuopts"><input name=query />
<input type=submit style="font-size:10px;" value="Go" /></td></tr> <input type=submit style="font-size:10px;" value="Go" /></td></tr>
<tr><td class="menuoptsb" style="font-size:12px;" >[ <tr><td class="menuoptsb" style="font-size:12px;" >[
<a href="<?php echo "$TBDOCBASE/search.php3"; ?>">Advanced Search</a> ]</td></tr> <a href="<?php echo "$TBDOCBASE/search.php3"; ?>">Advanced
Search</a> ]</td></tr>
</td></tr> </td></tr>
</table> </table>
</form> </form>
<br> <br>
<table class="menu" width=220 cellpadding="0" cellspacing="0"> <table class="menu" width=220 cellpadding="0" cellspacing="0">
<tr><td class="menuheader"><b>Interaction</b></td></tr> <tr><td class="menuheader"><b>Interaction</b></td></tr>
<?php <?php # BACK TO PHP
if ($login_status & CHECKLOGIN_LOGGEDIN) { if ($login_status & CHECKLOGIN_LOGGEDIN) {
$freepcs = TBFreePCs(); $freepcs = TBFreePCs();
...@@ -216,11 +218,10 @@ function WRITESIDEBAR() { ...@@ -216,11 +218,10 @@ function WRITESIDEBAR() {
} }
if ($login_message) { if ($login_message) {
?> echo "<tr>";
<tr> echo "<td class=\"menufooter\"><center><b>";
<td class="menufooter"><center><b><?php echo "$login_message"; ?></b></center></td> echo "$login_message</b></center></td>";
</tr> echo "</tr>";
<?php
} }
# #
...@@ -231,43 +232,20 @@ function WRITESIDEBAR() { ...@@ -231,43 +232,20 @@ function WRITESIDEBAR() {
# cause warnings. # cause warnings.
# #
if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) { if ($login_status & (CHECKLOGIN_LOGGEDIN|CHECKLOGIN_MAYBEVALID)) {
echo "<tr>";
?> echo "<td class=\"menufooter\" align=center valign=center>";
<tr> echo "<a href=\"$TBBASE/logout.php3?uid=$login_uid\">";
<td class="menufooter" align=center valign=center> <?php echo "<img alt=\"logoff\" border=0 ";
echo " <a href=\"$TBBASE/logout.php3?uid=$login_uid\"> echo "src=\"$BASEPATH/logoff.gif\"></a>\n";
<img alt=\"logoff\" border=0 echo "</td></tr>\n";
src=\"$BASEPATH/logoff.gif\"></a>\n"
?>
</td>
</tr>
<?php
# echo "<tr>
# <td align=center height=50 valign=center>
# <a href=\"$TBBASE/logout.php3?uid=$login_uid\">
# <img alt=\"logout\" border=0
# src=\"$BASEPATH/logoff.gif\"></a>
# </td>
# </tr>\n";
} }
elseif (!NOLOGINS()) { elseif (!NOLOGINS()) {
?> echo "<tr>";
<tr> echo "<td class=\"menufooter\" align=center valign=center>";
<td class="menufooter" align=center valign=center> <?php echo "<a href=\"$TBBASE/login.php3\">";
echo " <a href=\"$TBBASE/login.php3\"> echo "<img alt=\"logon\" border=0 ";
<img alt=\"logon\" border=0 echo "src=\"$BASEPATH/logon.gif\"></a>\n";
src=\"$BASEPATH/logon.gif\"></a>\n" echo "</td></tr>\n";
?>
</td>
</tr>
<?php
# echo "<tr>
# <td align=center height=50 valign=center>
# </td>
# </tr>\n";
} }
...@@ -287,6 +265,61 @@ echo " <a href=\"$TBBASE/login.php3\"> ...@@ -287,6 +265,61 @@ echo " <a href=\"$TBBASE/login.php3\">
echo "</table>\n"; echo "</table>\n";
} }
#
# spits out beginning part of page
#
function PAGEBEGINNING( $title ) {
global $BASEPATH, $TBMAINSITE;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><?php echo "emulab.net - $title"; ?></title>
<!-- dumbed-down style sheet for any browser that groks (eg NS47). -->
<link REL="stylesheet" HREF="<?php echo "$BASEPATH/common-style.css" ?>"
TYPE="text/css" />
<!-- don't import full style sheet into NS47, since it does a bad job
of handling it. NS47 doesn't understand '@import'. -->
<style type="text/css" media="all">
<!-- @import "<?php echo "$BASEPATH/style.css" ?>"; --></style>
<?php if ($TBMAINSITE) { ?>
<meta NAME="keywords" CONTENT="network, emulation, internet, emulator">
<meta NAME="ROBOTS" CONTENT="NOARCHIVE">
<?php } ?>
</head>
<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0
marginheight=0 marginwidth=0>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" class="bannercell"
background="<?php echo "$BASEPATH/headerbgbb.jpg" ?>"
bgcolor=#3D627F ><img width=369 height=100
src="<?php echo "$BASEPATH/overlay.gif" ?>"
alt="emulab - the utah network testbed" /></td>
</tr>
</table><table cellpadding="8" cellspacing="0" height="100%">
<tr height=100%>
<td valign="top" class="leftcell" bgcolor=#ccddee>
<!-- sidebar begins -->
<?php
}
#
# finishes sidebar td
#
function FINISHSIDEBAR()
{
?>
<!-- sidebar ends -->
</td>
<td valign="top" width=* class="rightcell">
<table class="content" width=100% cellpadding="0" cellspacing="0">
<tr>
<td class="contentheader"><h2 class="nomargin">
<?php
}
# #
# Spit out a vanilla page header. # Spit out a vanilla page header.
# #
...@@ -347,39 +380,11 @@ function PAGEHEADER($title) { ...@@ -347,39 +380,11 @@ function PAGEHEADER($title) {
else { else {
header("Expires: " . gmdate("D, d M Y H:i:s", time() + 300) . " GMT"); header("Expires: " . gmdate("D, d M Y H:i:s", time() + 300) . " GMT");
} }
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> PAGEBEGINNING( $title );
<html> WRITESIDEBAR();
<head> FINISHSIDEBAR();
<title><?php echo "emulab.net - $title"; ?></title>
<!-- dumbed-down style sheet for any browser that groks (eg NS47). -->
<link REL="stylesheet" HREF="<?php echo "$BASEPATH/common-style.css" ?>" TYPE="text/css" />
<!-- don't import full style sheet into NS47, since it does a bad job
of handling it. NS47 doesn't understand '@import'. -->
<style type="text/css" media="all"><!-- @import "<?php echo "$BASEPATH/style.css" ?>"; --></style>
<?php if ($TBMAINSITE) { ?>
<meta NAME="keywords" CONTENT="network, emulation, internet, emulator">
<meta NAME="ROBOTS" CONTENT="NOARCHIVE">
<?php } ?>
</head>
<body bgcolor="#FFFFFF" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0>
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td valign="top" class="bannercell" background="<?php echo "$BASEPATH/headerbgbb.jpg" ?>"
bgcolor=#3D627F ><img width=369 height=100 src="<?php echo "$BASEPATH/overlay.gif" ?>"
alt="emulab - the utah network testbed" /></td>
</tr>
</table><table cellpadding="8" cellspacing="0" height="100%">
<tr height=100%>
<td valign="top" class="leftcell" bgcolor=#ccddee>
<!-- sidebar begins -->
<?php WRITESIDEBAR(); ?>
<!-- sidebar ends -->
</td>
<td valign="top" width=* class="rightcell">
<table class="content" width=100% cellpadding="0" cellspacing="0">
<tr>
<td class="contentheader"><h2 class="nomargin"><?php
if ($login_uid && ISADMININSTRATOR()) { if ($login_uid && ISADMININSTRATOR()) {
if (ISADMIN($login_uid)) { if (ISADMIN($login_uid)) {
echo "<a href=adminmode.php3?target_uid=$login_uid&adminoff=1> echo "<a href=adminmode.php3?target_uid=$login_uid&adminoff=1>
...@@ -392,28 +397,17 @@ function PAGEHEADER($title) { ...@@ -392,28 +397,17 @@ function PAGEHEADER($title) {
border=0 alt='Admin Off'></a>\n"; border=0 alt='Admin Off'></a>\n";
} }
} }
echo "$title"; echo "$title</h2></td></tr>\n";
?></h2></td> echo "<tr><td class=\"contentbody\" width=*>";
</tr> echo "<!-- begin content -->\n";
<tr>
<td class="contentbody" width=*>
<!-- begin content -->
<?php
} }
# #
# ENDPAGE(): This terminates the table started above. # ENDPAGE(): This terminates the table started above.
# #
function ENDPAGE() { function ENDPAGE() {
echo "</td></tr></table>";
?> echo "</td></tr></table>";
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
} }
# #
...@@ -425,14 +419,6 @@ function PAGEFOOTER() { ...@@ -425,14 +419,6 @@ function PAGEFOOTER() {
# echo "<!-- Force full window! --> # echo "<!-- Force full window! -->
# <base target=_top> # <base target=_top>
# <center>[<a href=\"$TBDOCBASE\">$THISHOMEBASE Home</a>]</center>
# <center>
# [<a href=\"http://www.cs.utah.edu/flux/\">Flux Research Group</a>]
# [<a href=\"http://www.cs.utah.edu/\">School of Computing</a>]
# [<a href=\"http://www.utah.edu/\">University of Utah</a>]
# </center>
# echo "</td></tr><tr><td class=\"contentbody\">"; # new row.
?> ?>
<!-- end content --> <!-- end content -->
...@@ -444,8 +430,9 @@ function PAGEFOOTER() { ...@@ -444,8 +430,9 @@ function PAGEFOOTER() {
<font size=-2> <font size=-2>
&copy; 2000-2002 &copy; 2000-2002
<a href="http://www.utah.edu/">University of Utah</a> <a href="http://www.utah.edu/">University of Utah</a>
and the <a href="http://www.cs.utah.edu/flux/">Flux Group</a>. and the
<a href="<?php echo "$TBDOCBASE"; ?>/docwrapper.php3?docname=copyright.html"> <a href="http://www.cs.utah.edu/flux/">Flux Group</a>.
<a href="<?php echo "$TBDOCBASE"; ?>/docwrapper.php3?docname=copyright.html">
All rights reserved.</a> All rights reserved.</a>
</font> </font>
<br /> <br />
...@@ -457,15 +444,6 @@ function PAGEFOOTER() { ...@@ -457,15 +444,6 @@ function PAGEFOOTER() {
<!-- end copyright --> <!-- end copyright -->
<?php <?php
#echo "<p align=right>
# <font size=-1>
# &copy; 2000-2002
# <a href=\"http://www.utah.edu/\">University of Utah</a>
# and the <a href=\"http://www.cs.utah.edu/flux/\">Flux Group</a>.
# <a href='$TBDOCBASE/docwrapper.php3?docname=copyright.html'>
# All rights reserved.</a>
# </font><br />\n";
ENDPAGE(); ENDPAGE();
if ($TBMAINSITE) { if ($TBMAINSITE) {
...@@ -480,11 +458,7 @@ function PAGEFOOTER() { ...@@ -480,11 +458,7 @@ function PAGEFOOTER() {
</a>\n"; </a>\n";
} }
} }
echo "</body></html>\n";
?>
</body>
</html>
<?php
} }
function PAGEERROR($msg) { function PAGEERROR($msg) {
...@@ -510,11 +484,6 @@ function WRITESUBMENUBUTTON($text, $link) { ...@@ -510,11 +484,6 @@ function WRITESUBMENUBUTTON($text, $link) {
<td valign=center align=left nowrap> <td valign=center align=left nowrap>
<b> <b>
<a class=sidebarbutton href='$link'>$text</a>\n"; <a class=sidebarbutton href='$link'>$text</a>\n";
#
# XXX these blanks look bad in lynx, but add required
# spacing between menu and body
#
# echo " &nbsp;&nbsp;\n";
echo " </b> echo " </b>
</td> </td>
...@@ -526,7 +495,8 @@ function WRITESUBMENUBUTTON($text, $link) { ...@@ -526,7 +495,8 @@ function WRITESUBMENUBUTTON($text, $link) {
# #
function SUBPAGESTART() { function SUBPAGESTART() {
echo "<!-- begin subpage -->"; echo "<!-- begin subpage -->";
echo "<table class=\"stealth\" cellspacing=0 cellpadding=0 width='85%' border=0>\n echo "<table class=\"stealth\" cellspacing=0 cellpadding=0 width='85%'
border=0>\n
<tr>\n <tr>\n
<td class=\"stealth\"valign=top>\n"; <td class=\"stealth\"valign=top>\n";
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment