<?php
class Page {
var $page_file, $header, $menu, $bodyStart, $title, $anouncements;
function Page() {
$this->header = new Header();
$this->announcements = new Announcements();
$this->menu = new Menu();
$this->page_file = new PageFile();
}
function startPage() {
$this->header->display();
Javascript::initialize();
$this->showBodyStart();
}
function standardContent() {
$this->showTitle();
$this->announcements->display();
$this->openMainTable();
$this->menu();
}
function showBodyStart() {
echo "\n\n<!-- begin body -->\n\n<body bgcolor=\"#f6f6ff\" ";
// echo 'background="'. BACKGROUND_IMAGE;
echo "marginheight=0 marginwidth=0 topmargin=0 leftmargin=0>\n";
// ************ open master table *************
// initial space
echo "\n\n";
echo Indenter::indent('<table align='. PAGE_ALIGNMENT);
echo ' cellspacing=4 cellpadding=0 ';
echo "border=0 width=". PAGE_WIDTH . ">\n";
}
function showTitle() {
// ************ cell for title bar(s)/graphic *************
echo Indenter::indent("<tr>\n","++");
echo Indenter::indent("<td>\n","++");
// ************ Banner graphic (optional) *************
if (SHOW_BANNER) {
$banner_content = "<a href=\"index.php\"><img src=\""
. BANNER_IMAGE ."\" hspace=0 border=0></a>";
$banner_box = new TextBox("", $banner_content, PAGE_WIDTH);
$banner_box->padding = 0;
$banner_box->show_bottom_padding = false;
$banner_box->content_align="center";
$banner_box->display();
echo Text::smallBreak(1);
}
// ************ Page Title Bar(optional) *************
if (SHOW_PAGE_TITLE) {
$title_str = Http::linkInternal(PAGE_TITLE, HOME_PAGE_FILENAME,
PAGE_TITLE_STYLE);
$title_bar_box =
new TextBox($title_str, PAGE_SUBTITLE, PAGE_WIDTH);
// NOTE: why is this line commented out?
$title_bar_box->content_style="emphasized";
$title_bar_box->box_style=PAGE_TITLE_BOX_STYLE;
$title_bar_box->display();
}
// ************ close title cell
echo Indenter::indent("</td>\n","--");
echo Indenter::indent("</tr>\n\n","--");
// ************ open cell for whole rest of page
echo Indenter::indent("<tr>\n","++");
echo Indenter::indent("<td>\n","++");
}
function openMainTable() {
echo "\n";
echo Indenter::indent("<table width=". PAGE_WIDTH ." ","++");
echo "border=0 cellspacing=0 cellpadding=";
echo ITEM_INTERNAL_TABLE_PADDING .">\n";
echo Indenter::indent("<tr>\n","++");
echo Indenter::indent("<td valign=top>\n","++");
// at this point it's ready for the menu
}
function menu() {
$menu_box = new TextBox("",$this->menu->toStr(),MENU_WIDTH);
$menu_box->box(MENU_BOX_STYLE);
$menu_box->display();
}
function endPage() {
// close table holding menu and content
echo Indenter::indent("</td>\n","--");
echo Indenter::indent("</tr>\n","--");
echo Indenter::indent("</table>\n","--");
// close big cell holding everything but title bars
echo Indenter::indent("</td>\n","--");
echo Indenter::indent("</tr>\n","--");
// close table of entire page
echo Indenter::indent("</table>\n","--");
echo "</body>\n";
echo "</html>\n";
}
/*
function divideMenuFromContent() {
echo Indenter::indent("</td>\n\n","--");
// echo Indenter::indent("<td><img src=\"". SPACER_SRC ."\" height=1 ","++");
//echo "width=". SPACING_BETWEEN_MENU_AND_ITEMS ."></td>";
echo Indenter::indent("<td valign=top","++");
echo " align=left>";
}
*/
function addAnnouncement($str) {
$this->announcements->addAnnouncement($str);
}
function showAnnouncements() {
echo $this->announcements->toStr();
}
function includePage() {
include($this->page_file->page_loc);
}
}
?>