debug.tpl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. {capture assign=debug_output}
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  4. <head>
  5. <title>Smarty Debug Console</title>
  6. <style type="text/css">
  7. {literal}
  8. body, h1, h2, td, th, p {
  9. font-family: sans-serif;
  10. font-weight: normal;
  11. font-size: 0.9em;
  12. margin: 1px;
  13. padding: 0;
  14. }
  15. h1 {
  16. margin: 0;
  17. text-align: left;
  18. padding: 2px;
  19. background-color: #f0c040;
  20. color: black;
  21. font-weight: bold;
  22. font-size: 1.2em;
  23. }
  24. h2 {
  25. background-color: #9B410E;
  26. color: white;
  27. text-align: left;
  28. font-weight: bold;
  29. padding: 2px;
  30. border-top: 1px solid black;
  31. }
  32. body {
  33. background: black;
  34. }
  35. p, table, div {
  36. background: #f0ead8;
  37. }
  38. p {
  39. margin: 0;
  40. font-style: italic;
  41. text-align: center;
  42. }
  43. table {
  44. width: 100%;
  45. }
  46. th, td {
  47. font-family: monospace;
  48. vertical-align: top;
  49. text-align: left;
  50. width: 50%;
  51. }
  52. td {
  53. color: green;
  54. }
  55. .odd {
  56. background-color: #eeeeee;
  57. }
  58. .even {
  59. background-color: #fafafa;
  60. }
  61. .exectime {
  62. font-size: 0.8em;
  63. font-style: italic;
  64. }
  65. #table_assigned_vars th {
  66. color: blue;
  67. }
  68. #table_config_vars th {
  69. color: maroon;
  70. }
  71. {/literal}
  72. </style>
  73. </head>
  74. <body>
  75. <h1>Smarty Debug Console - Total Time {$execution_time|string_format:"%.5f"}</h1>
  76. <h2>included templates &amp; config files (load time in seconds)</h2>
  77. <div>
  78. {foreach $template_data as $template}
  79. <font color=brown>{$template.name}</font>
  80. <span class="exectime">
  81. (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
  82. </span>
  83. <br>
  84. {/foreach}
  85. </div>
  86. <h2>assigned template variables</h2>
  87. <table id="table_assigned_vars">
  88. {foreach $assigned_vars as $vars}
  89. <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
  90. <th>${$vars@key|escape:'html'}</th>
  91. <td>{$vars|debug_print_var}</td></tr>
  92. {/foreach}
  93. </table>
  94. <h2>assigned config file variables (outer template scope)</h2>
  95. <table id="table_config_vars">
  96. {foreach $config_vars as $vars}
  97. <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
  98. <th>{$vars@key|escape:'html'}</th>
  99. <td>{$vars|debug_print_var}</td></tr>
  100. {/foreach}
  101. </table>
  102. </body>
  103. </html>
  104. {/capture}
  105. <script type="text/javascript">
  106. {literal} if ( self.name == '' ) {
  107. var title = 'Console';
  108. }
  109. else {
  110. var title = 'Console_' + self.name;
  111. }{/literal}
  112. _smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
  113. _smarty_console.document.write("{$debug_output|escape:'javascript'}");
  114. _smarty_console.document.close();
  115. </script>