示例#1
0
$registry->template->setTemplate('/home/' . $registry->get('settings.dir') . '/Public/' . $registry->get('settings.resolve') . '/template_files/html/ajax_content.php');
$registry->template->addParameter('merchant_name', $registry->get('config.server.site_name'));
$registry->session = new Session($registry);
UthandoUser::setUserInfo();
if (UthandoUser::authorize()) {
    $registry->loggedInUser = true;
    $uthando->AddParameter('login_status', "<p>You are logged in as: " . $_SESSION['name'] . "</p>");
} else {
    $registry->loggedInUser = false;
}
try {
    $registry->db = new DB_Core($registry);
    // Load component.
    $uthando->loadComponent();
    // Get Modules and add them.
    $uthando->addModules();
} catch (PDOException $e) {
    $registry->Error($e->getMessage(), $e);
}
if ($registry->component_css) {
    foreach ($registry->component_css as $id => $filename) {
        $uthando->AddScript('css', 'if (!$defined($("' . $id . '"))) new Asset.css("' . $filename . '", {id: "' . $id . '"});', true);
    }
}
$uthando->timer->stop();
$timer_result = $uthando->timer->getProfiling();
$registry->template->AddScript('benchmark', "Page generated in {$timer_result[1]['total']} seconds.");
$registry->template->display();
$registry->db = null;
unset($uthando, $registry);
ob_end_flush();