<?php
class PageFile {
var $page_loc;
function PageFile($page = NULL) {
// if called without a page name to get,
if ($page == NULL)
// look in the cgi vars for a name to use.
$page = Http::getCgiVar(PAGE_CGI_VAR_NAME);
Debug::debug("Including page: $page <br>");
// at this point we have the page... or there was no cgi var telling
// us which page.
$page_loc = PageFile::getLocalLoc($page);
// if page cgi var can't be found, OR the page requested doesn't
// exist, use the Home Page instead!
if (($page == FAILURE_CODE) || !file_exists($page_loc))
// use the homepage.
$page_loc = PageFile::getLocalLoc(HOME_PAGE_FILENAME);
$this->page_loc = $page_loc;
}
function getLocalLoc($page) {
return "pages/". $page .".php";
}
}
?>