Example #1
0
    function Display($strContentOverride = "")
    {
        $dteStartTime = $this->MicrotimeFloat();
        global $CMS;
        $RC = new ReplaceConstants();
        if ($strContentOverride) {
            $strBody = $strContentOverride;
        } else {
            $strBody = $this->strContent;
        }
        $strHTMLToPrint = $this->GetHeader() . $strBody . $this->GetFooter();
        $strHTMLToPrint = $RC->DoAll($strHTMLToPrint);
        $dteEndTime = $this->MicrotimeFloat();
        $this->SetExecutionTime($dteStartTime, $dteEndTime, __CLASS__ . "::" . __FUNCTION__, __LINE__);
        global $strExecutionTime;
        // Set in header.php
        if ($strExecutionTime) {
            $strQueryTimeData = <<<ExecTime
<div id="majQueryTimeData">
<p>Query Execution Time</p>
<ol>
{$strExecutionTime}
</ol>
</div>
ExecTime;
        } else {
            $strQueryTimeData = "";
        }
        global $blnOverrideQT;
        // Allows the variable to be put in sys templates without being evaluated
        if ($blnOverrideQT) {
            $strHTMLToPrint = str_replace('$cmsQueryTime', "", $strHTMLToPrint);
        } else {
            if (C_TEST_MODE != "") {
                $strHTMLToPrint = str_replace('$cmsQueryTime', $strQueryTimeData, $strHTMLToPrint);
            } else {
                $strHTMLToPrint = str_replace('$cmsQueryTime', "", $strHTMLToPrint);
            }
        }
        print $strHTMLToPrint;
        $CMS->IQ->Disconnect();
        exit;
    }
Example #2
0
    function ErrPage($strErrMsg, $strErrData)
    {
        global $CMS;
        if ($strErrData == "") {
            $strErrData = "<i>{M_ERR_PAGE_INFO_NONE}</i>.";
        }
        $strLoginLink = "";
        if ($strErrMsg == M_ERR_UNAUTHORISED) {
            $CMS->RES->ValidateLoggedIn();
            if ($CMS->RES->IsError()) {
                $strLoginLink = "<li>You are not logged in. <a href=\"{FN_LOGIN}\">Try logging in</a>.</li>";
            } else {
                $strLoginLink = "<li>You are already logged in. To clear your cookies, <a href=\"{FN_LOGOUT}\">try logging out</a>.</li>";
            }
        }
        $strReferrerLink = "";
        if ($strErrMsg != M_ERR_SYSTEM_LOCKED) {
            $strReferrer = empty($_SERVER['HTTP_REFERER']) ? "" : $_SERVER['HTTP_REFERER'];
            if ($strReferrer) {
                $strReferrerLink = "<li><a href=\"{$strReferrer}\">{M_INFO_GO_BACK}</a>.</li>";
                $strHomePageLink = "<li>Or, you can <a href=\"{FN_INDEX}\">go to the home page</a>.</li>";
            } else {
                $strHomePageLink = "<li><a href=\"{FN_INDEX}\">Go to the home page</a>.</li>";
            }
            $strHelpLinks = <<<BackLink
<ul>
{$strLoginLink}
{$strReferrerLink}
{$strHomePageLink}
</ul>

BackLink;
        } else {
            $strHelpLinks = "";
        }
        $strErrorText = <<<END
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>{M_ERR_PAGE_TITLE}</title>
<link rel="stylesheet" type="text/css" href="{URL_SYS_ROOT}loginpage.css" />
</head>
<body>
<div id="mPage">
<h1>{M_ERR_PAGE_TITLE}</h1>
<p>{$strErrMsg}</p>
{$strHelpLinks}
<p id="SupInfo">{M_ERR_PAGE_INFO_DESC}: {$strErrData}</p>
</div>
</body>
</html>
END;
        $RC = new ReplaceConstants();
        return $RC->DoAll($strErrorText);
    }