<?
class Page
{
// class Page's attributes
var $content;
var $title = "Hooray";
var $keywords = "hooray,hooray siberia";
var $contentdescription = "siberia";
var $buttons = array( "Home" => "index.php",
"Services" => "services.php",
"Gallery" => "gallery.php",
"FAQ" => "faq.php",
"Contact" => "contact.php"
);
// class Page's operations
function SetContent($newcontent)
{
$this->content = $newcontent;
}
function SetTitle($newtitle)
{
$this->title = $newtitle;
}
function SetKeywords($newkeywords)
{
$this->keywords = $newkeywords;
}
function SetContentdescription($newcontentdescrition)
{
$this->contentdescription = $newcontentdescription;
}
function SetButtons($newbuttons)
{
$this->buttons = $newbuttons;
}
function Display()
{
echo "<html>\n<head>\n";
$this -> DisplayTitle();
$this -> DisplayKeywords();
$this -> DisplayContentdescription();
$this -> DisplayStyles();
echo "</head>\n<body cellspacing=0 cellpadding=0 leftmargin=0 rightmargin=0 topmargin=0 marginheight=0 marginwidth=0>\n";
$this -> DisplayHeader();
$this -> DisplayMenu($this->buttons);
echo $this->content;
$this -> DisplayFooter();
echo "</body>\n</html>\n";
}
function DisplayTitle()
{
echo "<title> $this->title </title>";
}
function DisplayKeywords()
{
echo "<META name=\"keywords\" content=\"$this->keywords\">";
}
function DisplayStyles()
{
?>
<style>
.menu { font-family: Georgia, Times New Roman, Times, serif;
color:#ffffff; font-size:15px; text-decoration: none;}
a.menu:hover { font-family: Georgia, Times New Roman, Times, serif;
color:#ffffff; font-size:15px; text-decoration: underline;}
p {color:333333; font-size:12pt; text-align:justify;
font-family:arial,sans-serif;}
p.foot {color:999999; font-size:8pt; text-align:center;
font-family:Georgia, Times New Roman, Times, serif; font-weight:bold}
a:link,a:visited,a:active {color:333333}
</style>
<?
}
function DisplayContentdescription()
{
echo "<META name=\"description\" content=\"$this->contentdescription\">";
}
function DisplayHeader()
{
?>
<table width="100%" cellpadding = 0 cellspacing =0 border = 0>
<tr>
<td><img src = "flowersheader.jpg" alt="Siberia" height="101" border="0"></td>
</tr>
</table>
<?
}
function DisplayMenu($buttons)
{
echo "<table width = \"100%\" height=25px bgcolor = #9999cc cellpadding = 4 cellspacing = 4>\n";
echo " <tr>\n";
//calculate button size
$width = 100/count($buttons);
while (list($name, $url) = each($buttons))
{
$this -> DisplayButton($width, $name, $url, !$this->IsURLCurrentPage($url));
}
echo " </tr>\n";
echo "</table>\n";
}
function IsURLCurrentPage($url)
{
if(strpos( $GLOBALS["SCRIPT_NAME"], $url )==false)
{
return false;
}
else
{
return true;
}
}
function DisplayButton($width, $name, $url, $active = true)
{
if ($active)
{
echo "<td width = \"$width%\">
<a href = \"$url\">
<img src = \"arrow.jpg\" height=20 width=20 alt = \"$name\" border = 0></a>
<a href = \"$url\"><span class=menu>$name</span></a></td>";
}
else
{
echo "<td width = \"$width%\">
<img src = \"URLarrow.jpg\">
<span class=menu>$name</span></td>";
}
}
function DisplayFooter()
{
?>
<table width = "100%" bgcolor = white cellpadding = 12 border = 0>
<tr>
<td>
<p class=foot> <br>Copyright © 2003
</p>
</td>
</tr>
</table>
<?
}
}
?>