template.generate_debug_output.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Template Lite template_generate_debug_output template internal module
  4. *
  5. * Type: template
  6. * Name: template_generate_debug_output
  7. */
  8. function template_generate_debug_output(&$object)
  9. {
  10. $assigned_vars = $object->_vars;
  11. ksort($assigned_vars);
  12. if (@is_array($object->_config[0]))
  13. {
  14. $config_vars = $object->_config[0];
  15. ksort($config_vars);
  16. $object->assign("_debug_config_keys", array_keys($config_vars));
  17. $object->assign("_debug_config_vals", array_values($config_vars));
  18. }
  19. $included_templates = $object->_templatelite_debug_info;
  20. $object->assign("_debug_keys", array_keys($assigned_vars));
  21. $object->assign("_debug_vals", array_values($assigned_vars));
  22. $object->assign("_debug_tpls", $included_templates);
  23. $object->assign("_templatelite_debug_output", "");
  24. $object->_templatelite_debug_loop = true;
  25. $object->_templatelite_debug_dir = $object->template_dir;
  26. $object->template_dir = TEMPLATE_LITE_DIR . "internal/";
  27. $debug_output = $object->fetch("debug.tpl");
  28. $object->template_dir = $object->_templatelite_debug_dir;
  29. $object->_templatelite_debug_loop = false;
  30. return $debug_output;
  31. }
  32. ?>