init
[garradin.git] / include / libs / template_lite / internal / template.fetch_compile_include.php
1 <?php
2 /**
3 * Template Lite template_fetch_compile_include template internal module
4 *
5 * Type: template
6 * Name: template_fetch_compile_include
7 */
8
9 function template_fetch_compile_include($_templatelite_include_file, $_templatelite_include_vars, &$object)
10 {
11 if ($object->debugging)
12 {
13 $object->_templatelite_debug_info[] = array('type' => 'template',
14 'filename' => $_templatelite_include_file,
15 'depth' => ++$object->_inclusion_depth,
16 'exec_time' => array_sum(explode(' ', microtime())) );
17 $included_tpls_idx = count($object->_templatelite_debug_info) - 1;
18 }
19
20 $object->_vars = array_merge($object->_vars, $_templatelite_include_vars);
21 $_templatelite_include_file = $object->_get_resource($_templatelite_include_file);
22 if(isset($object->_confs[0]))
23 {
24 array_unshift($object->_confs, $object->_confs[0]);
25 $_compiled_output = $object->_fetch_compile($_templatelite_include_file, true);
26 array_shift($object->_confs);
27 }
28 else
29 {
30 $_compiled_output = $object->_fetch_compile($_templatelite_include_file, true);
31 }
32
33 $object->_inclusion_depth--;
34
35 if ($object->debugging)
36 {
37 $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'] = array_sum(explode(' ', microtime())) - $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'];
38 }
39 return $_compiled_output;
40 }
41
42 ?>