示例#1
0
 // help developers to find problems
 if ($current['navigate_session'] == 1 && APP_DEBUG) {
     error_reporting(E_ALL ^ E_NOTICE);
     ini_set('display_errors', true);
 }
 // parse route
 nvweb_route_parse($current['route']);
 $permission = nvweb_check_permission();
 // if no preview & permission not allowed
 // if preview but no navigate_session active
 if ($_REQUEST['preview'] == 'true' && $current['navigate_session'] != 1 || empty($_REQUEST['preview']) && !$permission) {
     nvweb_route_parse('***nv.not_allowed***');
     nvweb_clean_exit();
 }
 $template = nvweb_template_load();
 $events->trigger('theme', 'template_load', array('template' => &$template));
 if (empty($template)) {
     throw new Exception('Navigate CMS: no template found!');
 }
 // parse the special tag "include"
 // also convert curly brackets tags {{nv object=""}} to <nv object="" /> version
 // we do it now because new nv tags could be added before parsing the whole html
 $html = nvweb_template_parse_special($template->file_contents);
 $current['plugins_called'] = nvweb_plugins_called_in_template($html);
 $html = nvweb_plugins_event('before_parse', $html);
 $html = nvweb_theme_settings($html);
 $html = nvweb_template_parse_lists($html);
 $html = nvweb_template_parse($html);
 // if the content has added any nv tag, process them
 if (strpos($html, '{{nv ') !== false || strpos($html, '<nv ')) {
     $html = nvweb_template_parse_special($html);