Пример #1
0
/**
 * Display page using templates
 * If page content is unmodified, return HTTP 304 Not modified
 *
 * @param   string  $template Template name for main content
 */
function tpl_display($template)
{
    global $config;
    // caching enabled?
    if ($config['http_caching']) {
        require_once './core/httpcache.php';
        httpCacheCaptureStart();
    }
    tpl_display_show($template, !$config['http_caching']);
    if ($config['http_caching']) {
        httpCacheOutput($template, httpCacheCaptureEnd());
    }
}
Пример #2
0
tpl_list($result);
tpl_filters($filter, $showtv);
// caching enabled?
if ($config['http_caching']) {
    require_once './core/httpcache.php';
    httpCacheCaptureStart();
}
$smarty->assign('moreless', true);
// show more/less control in list view
// allow data export
foreach (array('xls', 'pdf', 'xml', 'rss') as $export) {
    if ($config[$export]) {
        $smarty->assign($export, 'index.php?');
    }
}
// display templates
smarty_display('header.tpl');
smarty_display('filters.tpl');
if (!$config['http_caching']) {
    flush();
}
if ($deleteid) {
    $smarty->assign('deleted', true);
}
// TODO smarty caching would require further efforts
smarty_display('list.tpl', get_current_user_id() . '|' . $WHERES);
smarty_display('footer.tpl');
// caching enabled?
if ($config['httpcaching']) {
    httpCacheOutput('index', httpCacheCaptureEnd());
}
Пример #3
0
    for ($i; $i < $size - 1; $i++) {
        if ($breadcrumbs['crumbs'][$i]['id'] == $id) {
            unset($breadcrumbs['crumbs'][$size - 1]);
            break;
        }
    }
    session_set('breadcrumbs', $breadcrumbs);
}
// prepare templates
tpl_page('detailview', $video['title']);
if (!empty($id)) {
    tpl_show($video);
}
// caching enabled?
if ($config['http_caching']) {
    require_once './core/httpcache.php';
    httpCacheCaptureStart();
}
// display templates
smarty_display('header.tpl');
if (!$config['http_caching']) {
    flush();
}
if (!empty($id)) {
    smarty_display('show.tpl', $id);
}
smarty_display('footer.tpl');
// caching enabled?
if ($config['http_caching']) {
    httpCacheOutput('show' . $id, httpCacheCaptureEnd());
}