function display(&$pageData) { $common = new common($this); // Check if the portal is installed or needs upgraded. $thisVersion = "2.5.0"; if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/classes/settings.class.php")) { header("Location: /install/install.php"); } elseif ($common->getSetting("version") != $thisVersion) { header("Location: /install/upgrade.php"); } // The Base URL of this page (needed for Plane Finder client link) $pageData['baseurl'] = $common->getBaseUrl(); // Load the master template along with required data for the master template.. $master = $this->readTemplate('master.tpl'); require_once $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "classes" . DIRECTORY_SEPARATOR . "links.class.php"; $links = new links(); $pageData['links'] = $links->getAllLinks(); // Load the template for the requested page. $page = $this->readTemplate($common->removeExtension($_SERVER["SCRIPT_NAME"]) . '.tpl'); $output = $this->mergeAreas($master, $page); $output = $this->mergeSettings($output); $output = $this->mergePageData($output, $pageData); $output = $this->processIfs($output, $pageData); $output = $this->processForeach($output, $pageData); $output = $this->processFors($output, $pageData); $output = $this->processWhiles($output, $pageData); $output = $this->removeComments($output); // Insert page ID mainly used to mark an active navigation link when using Bootstrap. $output = str_replace("{template:pageId}", $common->removeExtension($_SERVER["SCRIPT_NAME"]) . "-link", $output); echo $output; }
function display(&$pageData) { $common = new common($this); // The Base URL of this page (needed for Plane Finder client link) $pageData['baseurl'] = $common->getBaseUrl(); // Load the master template. $master = $this->readTemplate('master.tpl'); // Load the template for the requested page. $page = $this->readTemplate($common->removeExtension($_SERVER["SCRIPT_NAME"]) . '.tpl'); $output = $this->mergeAreas($master, $page); $output = $this->mergeSettings($output); $output = $this->mergePageData($output, $pageData); $output = $this->processIfs($output, $pageData); $output = $this->processForeach($output, $pageData); $output = $this->processFors($output, $pageData); $output = $this->processWhiles($output, $pageData); $output = $this->removeComments($output); // Insert page ID mainly used to mark an active navigation link when using Bootstrap. $output = str_replace("{template:pageId}", $common->removeExtension($_SERVER["SCRIPT_NAME"]) . "-link", $output); echo $output; }