示例#1
0
 cmsms()->set_variable('page_id', $page);
 cmsms()->set_variable('page_name', $contentobj->Alias());
 cmsms()->set_variable('position', $contentobj->Hierarchy());
 cmsms()->set_variable('friendly_position', $contentops->CreateFriendlyHierarchyPosition($contentobj->Hierarchy()));
 $smarty->assign('content_obj', $contentobj);
 $smarty->assign('content_id', $contentobj->Id());
 $smarty->assign('page', $page);
 $smarty->assign('page_id', $page);
 $smarty->assign('page_name', $contentobj->Alias());
 $smarty->assign('page_alias', $contentobj->Alias());
 $smarty->assign('position', $contentobj->Hierarchy());
 $smarty->assign('friendly_position', $gCms->variables['friendly_position']);
 CmsNlsOperations::set_language();
 // <- NLS detection for frontend
 $smarty->assign('lang', CmsNlsOperations::get_current_language());
 $smarty->assign('encoding', CmsNlsOperations::get_encoding());
 $html = '';
 $showtemplate = true;
 if (isset($_REQUEST['showtemplate']) && $_REQUEST['showtemplate'] == 'false' || isset($smarty->id) && $smarty->id != '' && isset($_REQUEST[$smarty->id . 'showtemplate']) && $_REQUEST[$smarty->id . 'showtemplate'] == 'false') {
     $showtemplate = false;
 }
 $smarty->set_global_cacheid('p' . $contentobj->Id());
 $uid = get_userid(FALSE);
 if ($contentobj->Cachable() && $showtemplate && !$uid && get_site_preference('use_smartycache', 0)) {
     if (version_compare(phpversion(), '5.3') >= 0) {
         // this content is cachable...  so enable smarty caching of this page data, for this user.
         $smarty->setCaching(Smarty::CACHING_LIFETIME_CURRENT);
     }
 }
 if (!$showtemplate) {
     $smarty->setCaching(false);
function get_encoding($charset = '', $defaultoverrides = true)
{
    return CmsNlsOperations::get_encoding();
}