| Current Path : /var/www/html/mmishra/iws8/html/mcell/backup/ |
| Current File : /var/www/html/mmishra/iws8/html/mcell/backup/template.php |
<?php
/**
You shouldn't edit this file unless you know what you are doing.
This file won't update the content, only the presentation of the
content. Edit the page that calls this file instead.
*/
$path = "./depends";
global $path;
// ---------- TOP LEVEL -------------------------------------------
class Top {
/**
Class that describes a top level page
*/
var $title;
var $keywords;
var $description;
var $bar_links; // associative of array of associative arrays of links
var $questions;
var $path_to_title_image;
var $title_width;
var $title_height;
var $content;
var $left_links; // associative of array of associative arrays of links
var $right_links;
var $path_to_picture;
var $picture_width;
var $picture_height;
var $picture_title;
var $picture_desc;
var $dept_name;
var $street;
var $city;
var $zip;
var $state;
var $phone;
var $fax;
var $email;
}
function top_level($top) {
/** displays main content. broken into functions to make tables readable */
global $path;
top_head($top);
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="7" rowspan="2" align="center" class="nav_item"> </td>
<td width="138" class="nav_item" valign="top" align="center"><?php left_menu($top); ?></td>
<td width="12" rowspan="2" class="nav_item"> </td>
<td width="1" rowspan="2" bgcolor="#999999"><img alt="" src="<?php print $path;?>depends/images/x.png" width="1" height="1" alt=""></td>
<td width="19" rowspan="2">
</td>
<td valign="top" rowspan="2"><?php content($top); ?></td>
</tr>
<tr>
<td class="nav_item" width="138" valign="bottom" align="left">
<a href="<?php print $top->questions;?>" class="nav_item_b">QUESTIONS?</a>
<p>
<a href="http://www.rutgers.edu/">
<img border="0" src="<?php print $path;?>depends/images/ru_logo.png" alt="RU Logo" width="134" height="66">
</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
// -------------------------------------------------------
function link_tables($the_array) {
global $path;
/** prints a collumn of tables full of links */
foreach ($the_array as $heading => $arr) {
$size = count($arr); // make height a function of link number
// $height = 13 * $size; // approx 13 pixels per char height
$height = 1 * $size; // small to let table wrap around text tightly
$title_height = "20";
$total_height = $title_height + $height;
?>
<table border="1" cellpadding="0" cellspacing="0" width="100%" valign="top" bordercolor="#336666">
<tr>
<td height="<?php print $total_height;?>" valign="top"> <table border="0" cellpadding="0" cellspacing="0" width="100%" valign="top">
<tr valign="middle" align="left" bgcolor="#336666">
<td width="10"> </td>
<td height="<?php print $title_height;?>"><p class="list12"><font color="#FFFFFF"><b><?php print $heading; ?></b></font></td>
</tr>
<tr valign="top" align="left" bgcolor="#FAFBE6">
<td width="10"> </td>
<td width="100%"><span class="list10">
<?php foreach ($arr as $href => $name) { ?>
<a href="<?php print $href; ?>" class="list10"><img alt="*" border="0" title="" src="<?php print $path;?>depends/images/bullet_orange.png"><?php print $name; ?></a><br>
<?php } ?>
</span> </td>
</tr>
</table></td>
</tr>
</table>
<br>
<?php }
}
// -------------------------------------------------
function top_head($top) {
global $path;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php print $top->title;?></title>
<link rel="stylesheet" href="<?php print $path;?>depends/css/nbmain.css" type="text/css">
<?php
print "<meta name=\"keywords\" content=\"$top->keywords\">\n";
print "<meta name=\"description\" content=\"$top->description\">\n";
print "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
?>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--
<body bgcolor="#ffffff">
-->
<a name="top"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- Header -->
<tr>
<td height="50" title="Rutgers New Brunswick/Piscataway Campus" width="410" background="<?php print $path;?>depends/images/header_middle.png" alt="*"><a href="http://www.nbp.rutgers.edu/"><img border="0" height="50" width="410" src="<?php print $path;?>depends/images/header_left.png" alt=""></a></td><td height="50" bgcolor="#C00000" alt="" background="<?php print $path;?>depends/images/header_middle.png" alt=""><img alt="" src="<?php print $path;?>depends/images/header_middle.png"></td><td height="50" width="100" background="<?php print $path;?>depends/images/header_middle.png"><a href="http://search.rutgers.edu"><img border="0" width="100" height="50" src="<?php print $path;?>depends/images/header_right.png" alt=""></a></td>
</tr>
</table>
<?
}
// ----------------------------------------
function left_menu($top) {
global $path;
/* prints left menu. has more cell spacing. */
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"5\">";
foreach ($top->bar_links as $heading => $arr) {
?>
<tr>
<td class="nav_heading" colspan="2" width="138"> <?php print $heading; ?></td>
</tr>
<?php foreach ($arr as $href => $name) { ?>
<tr>
<td class="nav_item" width="12"> </td>
<td class="nav_item" width="126"><a href="<?php print $href;?>" class="nav_item"><?php print $name; ?></a></td>
</tr>
<?php
}
?>
<tr>
<td> </td>
<td> </td>
</tr>
<?php
}
?></table><?php
}
// -------------------------------------------------
function content($top) {
global $path;
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%" valign="top">
<td rowspan="2" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><table border="0" cellpadding="0" cellspacing="0" width="100%" valign="top">
<tr>
<?php
if (empty($top->title_image_width)) {
$width = "375";
}
else {
$width = $top->title_image_width;
}
?>
<td><table border="0" cellpadding="0" cellspacing="0" width="<?php print $width;?>" valign="top">
<tr>
<?php
if (!empty($top->path_to_title_image)) {
?><td align="left" valign="top" colspan="3" class="home"><img src="<?php print $top->path_to_title_image;?>" alt="<?php print $top->title; ?>" width="<?php print $top->title_image_width; ?>" height="<?php print $top->title_image_height; ?>" border="0" title="<?php print $top->title; ?>"></td><?php
}
else {
?><td align="left" valign="top" colspan="3" class="home"><h1><?php print $top->title; ?></h1></td><?php
}
?>
<td align="left" valign="top" width="15" class="home"> </td>
</tr>
<tr>
<td height="18" colspan="3"></td>
</tr>
<tr>
<td height="18" colspan="3" class="home">
<!-- START CONTENT -->
<?php print $top->content; ?>
<!-- END CONTENT -->
</td>
<td class="home"> </td>
</tr>
</table></td>
<td valign="top" align="right">
<?php
if (!empty($top->path_to_picture)) {
?>
<div align="left">
<p class="home"><img src="<?php print $top->path_to_picture; ?>" alt="" width="<?php print $top->picture_width;?>" height="<?php print $top->picture_height;?>" border="0" title="<?php print $top->picture_title; ?>">
<br>
<em>
<?php print $top->picture_desc; ?>
</em>
</p>
</div>
<?php
}
?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="17" width="100%"> </td>
</tr>
<!-- Link Boxes -->
<tr>
<td width="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="100%" valign="top">
<tr>
<td width="50%" height="382" valign="top">
<?php link_tables($top->left_links); ?>
<!-- START Right menu -->
</td>
<td valign="top" width="11"> </td>
<td width="50%" valign="top">
<?php link_tables($top->right_links); ?>
<td valign="top" width="11"> </td>
<!--
<td width="180" valign="top" class="list12">
<?php
if (!empty($top->dept_name)) {
?>
<p>
<?php print $top->dept_name; ?>
<br>
<?php print $top->street; ?>
<br>
<?php print "$top->city, $top->zip, $top->state"; ?>
<br>
<?php print $top->phone; ?>
<br>
<?php print $top->fax; ?>
<?php } ?>
</p>
</td>
-->
</tr>
</table></td>
</tr>
<tr>
<td><p class="home"><br>
<span class="home">Please direct all questions regarding NBCS services to <a href="mailto:<?php print $top->email;?>" class="info"><?php print $top->email;?></a><br>
<?php if (empty($top->time)) $top->time = getlastmod(); ?>
Last updated: <?php print date("F j, Y, g:i a", $top->time); ?>
<br><br>
<?php $year = date("Y"); ?>
© <?php print $year; ?> Rutgers, The State University of New Jersey. All rights reserved.</span></p></td>
</tr>
</table>
</table>
<?php
}
// ---------- SECOND LEVEL ----------------------------------------
class Second {
/** Class that describes a second level page */
var $title;
var $keywords;
var $description;
var $bar_links; // associative of array of associative arrays of links
var $questions;
var $email;
}
function second_head($sec) {
global $path;
/** displays main content. broken into functions to make tables readable */
top_head($sec);
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="7" rowspan="2" align="center" class="nav_item"> </td>
<td width="138" class="nav_item" valign="top" align="center"><?php left_menu($sec); ?></td>
<td width="12" rowspan="2" class="nav_item"> </td>
<td width="1" rowspan="2" bgcolor="#999999"><img src="<?php print $path;?>depends/images/x.png" width="1" height="1" alt=""></td>
<td width="19" rowspan="2"> </td>
<td rowspan="2">
<span class="home"><span class="title_brown">
<h1><?php print $sec->title; ?></h1>
<?php
}
// -----------------------------------------------------
function second_foot($sec) {
global $path;
?>
<hr noshade size="1" width="100%" color="#756666">
<p class="home"><br>
<span class="home">Please direct all questions regarding NBCS services to <a href="mailto:<?php print $sec->email;?>" class="info"><?php print $sec->email;?></a><br>
<?php if (empty($sec->time)) $sec->time = getlastmod(); ?>
Last updated: <?php print date("F j, Y, g:i a", $sec->time); ?>
<br><br>
<?php $year = date("Y"); ?>
© <?php print $year; ?> Rutgers, The State University of New Jersey. All rights reserved.</span></p>
</span></td>
</tr>
<tr>
<td class="nav_item" width="138" valign="bottom" align="left">
<a href="<?php print $sec->questions;?>" class="nav_item_b">QUESTIONS?</a>
<p>
<a href="http://www.rutgers.edu/">
<img border="0" src="<?php print $path;?>depends/images/ru_logo.png" alt="RU Logo" width="134" height="66">
</a>
</td>
</tr>
</table>
</body>
</html>
<?php
}
// ---------- CONTENT LEVEL ---------------------------------------
function head($title, $keywords="", $description="", $links="") {
global $path;
$obj->title = $title;
$obj->keywords = $keywords;
$obj->description = $description;
top_head($obj);
?>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="35" rowspan="5" align="center" class="nav_item"> </td>
<td valign="top" rowspan="1">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="1" align="left" valign="top"> </td>
</tr>
<tr>
<td colspan="1" align="left" valign="top"><h3><?php print "$title"; ?></h3></td>
</tr>
<tr>
<td colspan="1" align="left" valign="middle" bgcolor="#666666" class="nav_item_o">
<?php
// Define your own links here if you like, or pass them as an arg
if (!empty($links)) {
$urls = "";
foreach($links as $url => $name) {
$urls .= "<a href=\"$url\" class=\"nav_item_w\">$name</a> | ";
}
$urls = substr($urls, 0, -3); // trim last " | "
print "$urls\n";
}
?>
</td>
</tr>
<tr>
<td height="20" colspan="2"> </td>
</tr>
</table>
<span class="home"><span class="title_brown">
<?php
}
// ------------------------------------------------
function foot($contact, $time="") {
global $path;
if (empty($time)) $time = getlastmod();
?>
</span></td>
</tr>
<tr>
<td colspan="2" align="right" valign="top" class="nav_item_o"><a href="#top" class="back">BACK TO TOP</a> </td>
</tr>
<tr>
<td colspan="2" valign="top"><hr noshade size="1" color="#756666"></td>
</tr>
<tr>
<td colspan="1" align="left" valign="top">
<p class="home">
<a href="http://www.rutgers.edu"><img src="<?php print $path;?>depends/images/ru_logo.png" alt="Return to RU Main Site" title="Return to RU Main Site" border="0" align="left"></a>
<br>For more information contact <a href="mailto:<?php print $contact; ?>" class="info"><?php print $contact; ?></a><br>Last updated: <?php print date("F j, Y, g:i a", $time); ?>
</td>
</tr>
</table>
</body>
</html>
<?php
}
// ------------------------------------------------
function hr() {
global $path;
print "<hr align=\"left\" noshade size=\"1\" width=\"95%\" color=\"#756666\">";
}
// ------------------------------------------------
function heading($s) {
global $path;
print "<span class=\"title_brown\"><b>$s</b></span><p>";
}
// ------------------------------------------------
function sub_heading($s) {
global $path;
print "<span class=\"title_ltbrown\"><b>$s</b></span><p>";
}
?>