示例#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
        LEFT JOIN ' . TBL_MEDIATYPES . ' ON ' . TBL_DATA . '.mediatype = ' . TBL_MEDIATYPES . '.id' . "\n           {$JOINS} \n            WHERE {$WHERES}\n         ORDER BY {$ORDER}\n\t\t   {$LIMIT}";
$result = runSQL($SQL);
// store query result in session for prev/next navigation
session_set('query_result', array_extract($result, 'id'));
// process asynchronous refresh
if ($ajax_render) {
    ajax_render();
}
// prepare
tpl_page('browse');
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();
}