template.fetch_compile_include.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. function template_fetch_compile_include($_templatelite_include_file, $_templatelite_include_vars, &$object)
  9. {
  10. if ($object->debugging)
  11. {
  12. $object->_templatelite_debug_info[] = array('type' => 'template',
  13. 'filename' => $_templatelite_include_file,
  14. 'depth' => ++$object->_inclusion_depth,
  15. 'exec_time' => array_sum(explode(' ', microtime())) );
  16. $included_tpls_idx = count($object->_templatelite_debug_info) - 1;
  17. }
  18. $object->_vars = array_merge($object->_vars, $_templatelite_include_vars);
  19. $_templatelite_include_file = $object->_get_resource($_templatelite_include_file);
  20. if(isset($object->_confs[0]))
  21. {
  22. array_unshift($object->_confs, $object->_confs[0]);
  23. $_compiled_output = $object->_fetch_compile($_templatelite_include_file);
  24. array_shift($object->_confs);
  25. }
  26. else
  27. {
  28. $_compiled_output = $object->_fetch_compile($_templatelite_include_file);
  29. }
  30. $object->_inclusion_depth--;
  31. if ($object->debugging)
  32. {
  33. $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'] = array_sum(explode(' ', microtime())) - $object->_templatelite_debug_info[$included_tpls_idx]['exec_time'];
  34. }
  35. return $_compiled_output;
  36. }
  37. ?>