debug.tpl 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {* templatelite debug console *}
  2. {if isset($_templatelite_debug_output) and $_templatelite_debug_output eq "html"}
  3. <table border=0 width=100%>
  4. <tr bgcolor=#cccccc><th colspan=2>Template Lite Debug Console</th></tr>
  5. <tr bgcolor=#cccccc><td colspan=2><b>Included templates & config files (load time in seconds):</b></td></tr>
  6. {foreach key=key value=templates from=$_debug_tpls}
  7. <tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>
  8. <td colspan=2><tt>{for start=0 stop=$_debug_tpls[$key].depth}&nbsp;&nbsp;&nbsp;{/for}
  9. <font color={if $_debug_tpls[$key].type eq "template"}brown{elseif $_debug_tpls[$key].type eq "insert"}black{else}green{/if}>
  10. {$_debug_tpls[$key].filename}</font>{if isset($_debug_tpls[$key].exec_time)}
  11. <font size=-1><i>({$_debug_tpls[$key].exec_time|string_format:"%.5f"} seconds){if $key eq 0} (total){/if}
  12. </i></font>{/if}</tt></td></tr>
  13. {foreachelse}
  14. <tr bgcolor=#eeeeee><td colspan=2><tt><i>No template assigned</i></tt></td></tr>
  15. {/foreach}
  16. <tr bgcolor=#cccccc><td colspan=2><b>Assigned template variables:</b></td></tr>
  17. {foreach key=key value=vars from=$_debug_keys}
  18. <tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>
  19. <td valign=top><tt><font color=blue>{ldelim}${$_debug_keys[$key]}{rdelim}</font></tt></td>
  20. <td nowrap><tt><font color=green>{$_debug_vals[$key]|@debug_print_var}</font></tt></td></tr>
  21. {foreachelse}
  22. <tr bgcolor=#eeeeee><td colspan=2><tt><i>No template variables assigned</i></tt></td></tr>
  23. {/foreach}
  24. <tr bgcolor=#cccccc><td colspan=2><b>Assigned config file variables (outer template scope):</b></td></tr>
  25. {foreach key=key value=config_vars from=$_debug_config_keys}
  26. <tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>
  27. <td valign=top><tt><font color=maroon>{ldelim}#{$_debug_config_keys[$key]}#{rdelim}</font></tt></td>
  28. <td><tt><font color=green>{$_debug_config_vals[$key]|@debug_print_var}</font></tt></td></tr>
  29. {foreachelse}
  30. <tr bgcolor=#eeeeee><td colspan=2><tt><i>No config vars assigned</i></tt></td></tr>
  31. {/foreach}
  32. </table>
  33. {else}
  34. <SCRIPT language=javascript>
  35. if( self.name == '' ) {ldelim}
  36. var title = 'Console';
  37. {rdelim}
  38. else {ldelim}
  39. var title = 'Console_' + self.name;
  40. {rdelim}
  41. _templatelite_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
  42. _templatelite_console.document.write("<HTML><TITLE>Template Lite Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>");
  43. _templatelite_console.document.write("<table border=0 width=100%>");
  44. _templatelite_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Template Lite Debug Console</th></tr>");
  45. _templatelite_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>Included templates & config files (load time in seconds):</b></td></tr>");
  46. {foreach key=key value=templates from=$_debug_tpls}
  47. _templatelite_console.document.write("<tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>");
  48. _templatelite_console.document.write("<td colspan=2><tt>{for start=0 stop=$_debug_tpls[$key].depth}&nbsp;&nbsp;&nbsp;{/for}");
  49. _templatelite_console.document.write("<font color={if $_debug_tpls[$key].type eq "template"}brown{elseif $_debug_tpls[$key].type eq "insert"}black{else}green{/if}>");
  50. _templatelite_console.document.write("{$_debug_tpls[$key].filename}</font>{if isset($_debug_tpls[$key].exec_time)} ");
  51. _templatelite_console.document.write("<font size=-1><i>({$_debug_tpls[$key].exec_time|string_format:"%.5f"} seconds){if $key eq 0} (total){/if}");
  52. _templatelite_console.document.write("</i></font>{/if}</tt></td></tr>");
  53. {foreachelse}
  54. _templatelite_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>No template assigned</i></tt></td></tr> ");
  55. {/foreach}
  56. _templatelite_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>Assigned template variables:</b></td></tr>");
  57. {foreach key=key value=vars from=$_debug_keys}
  58. _templatelite_console.document.write("<tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>");
  59. _templatelite_console.document.write("<td valign=top><tt><font color=blue>{ldelim}${$_debug_keys[$key]}{rdelim}</font></tt></td>");
  60. _templatelite_console.document.write("<td nowrap><tt><font color=green>{$_debug_vals[$key]|@debug_print_var}</font></tt></td></tr>");
  61. {foreachelse}
  62. _templatelite_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>No template variables assigned</i></tt></td></tr>");
  63. {/foreach}
  64. _templatelite_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>Assigned config file variables (outer template scope):</b></td></tr>");
  65. {foreach key=key value=config_vars from=$_debug_config_keys}
  66. _templatelite_console.document.write("<tr bgcolor={if $key % 2}#eeeeee{else}#fafafa{/if}>");
  67. _templatelite_console.document.write("<td valign=top><tt><font color=maroon>{ldelim}#{$_debug_config_keys[$key]}#{rdelim}</font></tt></td>");
  68. _templatelite_console.document.write("<td><tt><font color=green>{$_debug_config_vals[$key]|@debug_print_var}</font></tt></td></tr>");
  69. {foreachelse}
  70. _templatelite_console.document.write("<tr bgcolor=#eeeeee><td colspan=2><tt><i>No config vars assigned</i></tt></td></tr>");
  71. {/foreach}
  72. _templatelite_console.document.write("</table>");
  73. _templatelite_console.document.write("</BODY></HTML>");
  74. _templatelite_console.document.close();
  75. </SCRIPT>
  76. {/if}