* @since 1.11 */ class CMSContentTemplateResource extends CMS_Fixed_Resource_Custom { protected function fetch($name,&$source,&$mtime) { $gCms = cmsms(); $config = $gCms->GetConfig(); $contentobj = $gCms->variables['content_obj']; $page_id = cmsms()->get_variable('page_id'); if (!is_object($contentobj)) { // We've a custom error message... return it here header("HTTP/1.0 404 Not Found"); header("Status: 404 Not Found"); if ($name == 'content_en') $source = get_site_preference('custom404'); else $source = null; $mtime = time(); return; } else if( isset($_SESSION['cms_preview_data']) && $page_id == '__CMS_PREVIEW_PAGE__' ) { $source = $contentobj->Show($name); $mtime = $contentobj->GetModifiedDate(); // So no one can do anything nasty, take out the php smarty tags. Use a user // defined plugin instead. if (!(isset($config["use_smarty_php_tags"]) && $config["use_smarty_php_tags"] == true)) { $source = preg_replace("/\{\/?php\}/", "", $source); } return; } else { if (isset($contentobj) && $contentobj !== FALSE) { $source = $contentobj->Show($name); $mtime = $contentobj->GetModifiedDate(); // So no one can do anything nasty, take out the php smarty tags. Use a user // defined plugin instead. if (!(isset($config["use_smarty_php_tags"]) && $config["use_smarty_php_tags"] == true)) { $source = preg_replace("/\{\/?php\}/", "", $source); } return; } } $source = null; $mtime = null; return; } } // end of class # # EOF # ?>