"../index.php", "Games" => "../categories/all.php", "Developers" => "../developers/my_games.php", "Help" => "../help/about.php", "Account" => "../account/profile.php"); # arrays to hold submenu items // to add a new link to a menu just add "" => "<link>" into the // desired submenu. public $submenugames = array("All Games" => "../categories/all.php", "Action" => "../categories/action.php", "Adventure/RPG" => "../categories/adventure_rpg.php", "Puzzle" => "../categories/puzzle.php"); public $submenudev = array("Forum" => "#", "My Games" => "../developers/my_games.php"); public $submenuhelp = array("About Us" => "../help/about.php", "FAQ" => "../help/faq.php", "Privacy" => "../help/privacy.php", "Terms of Use" => "../help/terms_of_use.php", "Contact Us" => "../help/contact.php"); public $submenuacc = array("Profile" => "../account/profile.php", "Login" => "../account/login.php", "Logout" => "../account/logout.php", "Register" => "../account/register.php"); // class Page's operations public function __set($name, $value) { $this->$name = $value; } # // Call this function to generate a new page with header navbar and footer. // be sure to add body content inside // $pagename->content = '<body content here>'; # public function Display() { echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"; echo "<html xmlns=\"http://www.w3.prg/1999/xhtml\" lang=\"en\" xml:lang=\"en\" > \n<head>\n"; $this -> DisplayTitle(); $this -> DisplayKeywords(); $this -> DisplayStyles(); echo "</head>\n<body>\n<div id=\"allcontent\">"; $this -> DisplayHeader(); $this -> DisplayMenu($this->buttons, $this->submenugames, $this->submenudev, $this->submenuhelp, $this->submenuacc); echo $this->content; $this -> DisplayFooter(); echo "</div>\n</body>\n</html>\n"; } // Title public function DisplayTitle() { echo "<title>".$this->title.""; } // Keywords public function DisplayKeywords() { echo "keywords."\" />"; } // CSS public function DisplayStyles() { ?> "; } public function DisplaySubMenu($i, $submenugames, $submenudev, $submenuhelp, $submenuacc) { switch($i) { case "0" : #close top menubutton echo ""; break; case "1" : #generate submenugames and close top menubutton echo "\n"; break; case "2" : #generate submenudev and close top menubutton echo "\n"; break; case "3" : #generate submenuhelp and close top menubutton echo "\n"; break; case "4"; #generate submenuacc and close top menubutton echo "\n"; break; } } # // Checks if the passed url is located in the current directory. // used to highlight the menu item user has navigated to. # public function IsURLCurrentDirectory($url) { #get parent directory of url $parentDirectory = dirname($url); #get current directory $currentDirectory = dirname($_SERVER['PHP_SELF']); #if parent directory == current directory, return true #else, return false if (strpos($_SERVER['PHP_SELF'], $parentDirectory )==false) { return false; } else { return true; } } // creates a button public function DisplayButton($name, $url, $active = true) { if ($active) { echo "
  • ".$name.""; } else { echo "
  • ".$name.""; } } // Footer public function DisplayFooter() { ?>