Example #1
0
 public function load_template($id, $relative_path = null, $is_preview = false)
 {
     $this->template->load($id, 'Template', $relative_path);
     $this->is_preview = $is_preview;
     $core_template = nc_Core::get_object()->template;
     $all_id = explode('/', trim($this->template->relative_path, '/'));
     $this->root_template_id = current($all_id);
     foreach ($all_id as $id) {
         if (!+$id) {
             continue;
         }
         $hash = $core_template->get_by_id($id, 'File_Hash');
         if ($hash) {
             $template = new nc_tpl($this->template->path_to_root_folder, $this->template->db);
             $template->load($id, 'Template', $core_template->get_by_id($id, 'File_Path'));
             nc_tpl_parser::main2parts($template, $hash);
         }
     }
 }
Example #2
0
 /**
  * @param int $id
  */
 public function load_child($id)
 {
     $this->child = new nc_tpl(nc_standardize_path_to_folder($this->path_to_root_folder), $this->db);
     $this->child->load($id, $this->type, nc_standardize_path_to_folder($this->relative_path . '/' . $id));
 }