Changeset 23384 for trunk/include/smarty/libs/debug.tpl
- Timestamp:
- Jun 20, 2013, 5:38:47 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/smarty/libs/debug.tpl
r3282 r23384 1 {* Smarty *} 2 {* debug.tpl, last updated version 2.1.0 *} 3 {assign_debug_info} 4 {capture assign=debug_output} 1 {capture name='_smarty_debug' assign=debug_output} 5 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 6 3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> 7 4 <head> 8 5 <title>Smarty Debug Console</title> 6 <style type="text/css"> 9 7 {literal} 10 <style type="text/css">11 /* <![CDATA[ */12 8 body, h1, h2, td, th, p { 13 9 font-family: sans-serif; … … 86 82 color: maroon; 87 83 } 88 /* ]]> */ 84 {/literal} 89 85 </style> 90 {/literal}91 86 </head> 92 87 <body> 93 88 94 <h1>Smarty Debug Console </h1>89 <h1>Smarty Debug Console - {if isset($template_name)}{$template_name|debug_print_var nofilter}{else}Total Time {$execution_time|string_format:"%.5f"}{/if}</h1> 95 90 91 {if !empty($template_data)} 96 92 <h2>included templates & config files (load time in seconds)</h2> 97 93 98 94 <div> 99 {section name=templates loop=$_debug_tpls} 100 {section name=indent loop=$_debug_tpls[templates].depth} {/section} 101 <font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}> 102 {$_debug_tpls[templates].filename|escape:html}</font> 103 {if isset($_debug_tpls[templates].exec_time)} 104 <span class="exectime"> 105 ({$_debug_tpls[templates].exec_time|string_format:"%.5f"}) 106 {if %templates.index% eq 0}(total){/if} 107 </span> 108 {/if} 109 <br /> 110 {sectionelse} 111 <p>no templates included</p> 112 {/section} 95 {foreach $template_data as $template} 96 <font color=brown>{$template.name}</font> 97 <span class="exectime"> 98 (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"}) 99 </span> 100 <br> 101 {/foreach} 113 102 </div> 103 {/if} 114 104 115 105 <h2>assigned template variables</h2> 116 106 117 107 <table id="table_assigned_vars"> 118 {section name=vars loop=$_debug_keys} 119 <tr class="{cycle values="odd,even"}"> 120 <th>{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}</th> 121 <td>{$_debug_vals[vars]|@debug_print_var}</td></tr> 122 {sectionelse} 123 <tr><td><p>no template variables assigned</p></td></tr> 124 {/section} 108 {foreach $assigned_vars as $vars} 109 <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> 110 <th>${$vars@key|escape:'html'}</th> 111 <td>{$vars|debug_print_var nofilter}</td></tr> 112 {/foreach} 125 113 </table> 126 114 … … 128 116 129 117 <table id="table_config_vars"> 130 {section name=config_vars loop=$_debug_config_keys} 131 <tr class="{cycle values="odd,even"}"> 132 <th>{ldelim}#{$_debug_config_keys[config_vars]|escape:'html'}#{rdelim}</th> 133 <td>{$_debug_config_vals[config_vars]|@debug_print_var}</td></tr> 134 {sectionelse} 135 <tr><td><p>no config vars assigned</p></td></tr> 136 {/section} 118 {foreach $config_vars as $vars} 119 <tr class="{if $vars@iteration % 2 eq 0}odd{else}even{/if}"> 120 <th>{$vars@key|escape:'html'}</th> 121 <td>{$vars|debug_print_var nofilter}</td></tr> 122 {/foreach} 123 137 124 </table> 138 125 </body> 139 126 </html> 140 127 {/capture} 141 {if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}142 {$debug_output}143 {else}144 128 <script type="text/javascript"> 145 // <![CDATA[ 146 if ( self.name == '' ) {ldelim} 147 var title = 'Console'; 148 {rdelim} 149 else {ldelim} 150 var title = 'Console_' + self.name; 151 {rdelim} 152 _smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes"); 153 _smarty_console.document.write('{$debug_output|escape:'javascript'}'); 129 {$id = $template_name|default:''|md5} 130 _smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes"); 131 _smarty_console.document.write("{$debug_output|escape:'javascript' nofilter}"); 154 132 _smarty_console.document.close(); 155 // ]]>156 133 </script> 157 {/if}
Note: See TracChangeset
for help on using the changeset viewer.