You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

debug.tpl 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. {capture name='_smarty_debug' 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, h3, 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. h3 {
  33. text-align: left;
  34. font-weight: bold;
  35. color: black;
  36. font-size: 0.7em;
  37. padding: 2px;
  38. }
  39. body {
  40. background: black;
  41. }
  42. p, table, div {
  43. background: #f0ead8;
  44. }
  45. p {
  46. margin: 0;
  47. font-style: italic;
  48. text-align: center;
  49. }
  50. table {
  51. width: 100%;
  52. }
  53. th, td {
  54. font-family: monospace;
  55. vertical-align: top;
  56. text-align: left;
  57. }
  58. td {
  59. color: green;
  60. }
  61. .odd {
  62. background-color: #eeeeee;
  63. }
  64. .even {
  65. background-color: #fafafa;
  66. }
  67. .exectime {
  68. font-size: 0.8em;
  69. font-style: italic;
  70. }
  71. #bold div {
  72. color: black;
  73. font-weight: bold;
  74. }
  75. #blue h3 {
  76. color: blue;
  77. }
  78. #normal div {
  79. color: black;
  80. font-weight: normal;
  81. }
  82. #table_assigned_vars th {
  83. color: blue;
  84. font-weight: bold;
  85. }
  86. #table_config_vars th {
  87. color: maroon;
  88. }
  89. {/literal}
  90. </style>
  91. </head>
  92. <body>
  93. <h1>Smarty {Smarty::SMARTY_VERSION} Debug Console
  94. - {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1>
  95. {if !empty($template_data)}
  96. <h2>included templates &amp; config files (load time in seconds)</h2>
  97. <div>
  98. {foreach $template_data as $template}
  99. <font color=brown>{$template.name}</font>
  100. <br>&nbsp;&nbsp;<span class="exectime">
  101. (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
  102. </span>
  103. <br>
  104. {/foreach}
  105. </div>
  106. {/if}
  107. <h2>assigned template variables</h2>
  108. <table id="table_assigned_vars">
  109. {foreach $assigned_vars as $vars}
  110. <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
  111. <td><h3><font color=blue>${$vars@key}</font></h3>
  112. {if isset($vars['nocache'])}<b>Nocache</b></br>{/if}
  113. {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}
  114. </td>
  115. <td><h3>Value</h3>{$vars['value']|debug_print_var:10:80 nofilter}</td>
  116. <td>{if isset($vars['attributes'])}<h3>Attributes</h3>{$vars['attributes']|debug_print_var nofilter} {/if}</td>
  117. {/foreach}
  118. </table>
  119. <h2>assigned config file variables</h2>
  120. <table id="table_config_vars">
  121. {foreach $config_vars as $vars}
  122. <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}">
  123. <td><h3><font color=blue>#{$vars@key}#</font></h3>
  124. {if isset($vars['scope'])}<b>Origin:</b> {$vars['scope']|debug_print_var nofilter}{/if}
  125. </td>
  126. <td>{$vars['value']|debug_print_var:10:80 nofilter}</td>
  127. </tr>
  128. {/foreach}
  129. </table>
  130. </body>
  131. </html>
  132. {/capture}
  133. <script type="text/javascript">
  134. {$id = '__Smarty__'}
  135. {if $display_mode}{$id = "$offset$template_name"|md5}{/if}
  136. _smarty_console = window.open("", "console{$id}", "width=1024,height=600,left={$offset},top={$offset},resizable,scrollbars=yes");
  137. _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}");
  138. _smarty_console.document.close();
  139. </script>