Example #1
0
 public function load($id, $path = null, $hash = null)
 {
     $this->template->load($id, 'Class', $path);
     if ($hash) {
         nc_tpl_parser::main2parts($this->template, $hash);
     }
 }
Example #2
0
 public function fill_fields()
 {
     if ($this->hash) {
         nc_tpl_parser::main2parts($this->template, $this->hash);
     }
     foreach ($this->template->fields->standart as $field_name => $tmp) {
         $this->template->fields->standart[$field_name] = $this->get_content($field_name);
     }
 }
Example #3
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);
         }
     }
 }