| 1 | {* Smarty *} |
|---|
| 2 | {* debug.tpl, last updated version 2.1.0 *} |
|---|
| 3 | {assign_debug_info} |
|---|
| 4 | {capture assign=debug_output} |
|---|
| 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
|---|
| 6 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
|---|
| 7 | <head> |
|---|
| 8 | <title>Smarty Debug Console</title> |
|---|
| 9 | {literal} |
|---|
| 10 | <style type="text/css"> |
|---|
| 11 | /* <![CDATA[ */ |
|---|
| 12 | .exectime { |
|---|
| 13 | font-size: 0.8em; |
|---|
| 14 | font-style: italic; |
|---|
| 15 | } |
|---|
| 16 | |
|---|
| 17 | #table_assigned_vars th { |
|---|
| 18 | color: blue; |
|---|
| 19 | } |
|---|
| 20 | |
|---|
| 21 | #table_config_vars th { |
|---|
| 22 | color: maroon; |
|---|
| 23 | } |
|---|
| 24 | /* ]]> */ |
|---|
| 25 | </style> |
|---|
| 26 | {/literal} |
|---|
| 27 | </head> |
|---|
| 28 | <body> |
|---|
| 29 | |
|---|
| 30 | <h1>Smarty Debug Console</h1> |
|---|
| 31 | |
|---|
| 32 | <h2>included templates & config files (load time in seconds)</h2> |
|---|
| 33 | |
|---|
| 34 | <div> |
|---|
| 35 | {section name=templates loop=$_debug_tpls} |
|---|
| 36 | {section name=indent loop=$_debug_tpls[templates].depth} {/section} |
|---|
| 37 | <font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}> |
|---|
| 38 | {$_debug_tpls[templates].filename|escape:html}</font> |
|---|
| 39 | {if isset($_debug_tpls[templates].exec_time|smarty:nodefaults)} |
|---|
| 40 | <span class="exectime"> |
|---|
| 41 | ({$_debug_tpls[templates].exec_time|string_format:"%.5f"}) |
|---|
| 42 | {if %templates.index% eq 0}(total){/if} |
|---|
| 43 | </span> |
|---|
| 44 | {/if} |
|---|
| 45 | <br /> |
|---|
| 46 | {sectionelse} |
|---|
| 47 | <p>no templates included</p> |
|---|
| 48 | {/section} |
|---|
| 49 | </div> |
|---|
| 50 | |
|---|
| 51 | <h2>assigned template variables</h2> |
|---|
| 52 | |
|---|
| 53 | <table id="table_assigned_vars"> |
|---|
| 54 | {section name=vars loop=$_debug_keys} |
|---|
| 55 | <tr class="{cycle values="odd,even"}"> |
|---|
| 56 | <th>{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}</th> |
|---|
| 57 | <td>{$_debug_vals[vars]|@debug_print_var}</td></tr> |
|---|
| 58 | {sectionelse} |
|---|
| 59 | <tr><td><p>no template variables assigned</p></td></tr> |
|---|
| 60 | {/section} |
|---|
| 61 | </table> |
|---|
| 62 | |
|---|
| 63 | <h2>assigned config file variables (outer template scope)</h2> |
|---|
| 64 | |
|---|
| 65 | <table id="table_config_vars"> |
|---|
| 66 | {section name=config_vars loop=$_debug_config_keys} |
|---|
| 67 | <tr class="{cycle values="odd,even"}"> |
|---|
| 68 | <th>{ldelim}#{$_debug_config_keys[config_vars]|escape:'html'}#{rdelim}</th> |
|---|
| 69 | <td>{$_debug_config_vals[config_vars]|@debug_print_var}</td></tr> |
|---|
| 70 | {sectionelse} |
|---|
| 71 | <tr><td><p>no config vars assigned</p></td></tr> |
|---|
| 72 | {/section} |
|---|
| 73 | </table> |
|---|
| 74 | </body> |
|---|
| 75 | </html> |
|---|
| 76 | {/capture} |
|---|
| 77 | {if isset($_smarty_debug_output|smarty:nodefaults) and $_smarty_debug_output eq "html"} |
|---|
| 78 | {$debug_output} |
|---|
| 79 | {else} |
|---|
| 80 | <script type="text/javascript"> |
|---|
| 81 | // <![CDATA[ |
|---|
| 82 | if ( self.name == '' ) {ldelim} |
|---|
| 83 | var title = 'Console'; |
|---|
| 84 | {rdelim} |
|---|
| 85 | else {ldelim} |
|---|
| 86 | var title = 'Console_' + self.name; |
|---|
| 87 | {rdelim} |
|---|
| 88 | _smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes"); |
|---|
| 89 | _smarty_console.document.write('{$debug_output|escape:'javascript'}'); |
|---|
| 90 | _smarty_console.document.close(); |
|---|
| 91 | // ]]> |
|---|
| 92 | </script> |
|---|
| 93 | {/if} |
|---|