Ignore:
Timestamp:
Jun 20, 2013, 5:38:47 AM (11 years ago)
Author:
rvelices
Message:

smarty 3 - first pass for tests

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}
    52<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    63<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    74<head>
    85    <title>Smarty Debug Console</title>
     6<style type="text/css">
    97{literal}
    10 <style type="text/css">
    11 /* <![CDATA[ */
    128body, h1, h2, td, th, p {
    139    font-family: sans-serif;
     
    8682    color: maroon;
    8783}
    88 /* ]]> */
     84{/literal}
    8985</style>
    90 {/literal}
    9186</head>
    9287<body>
    9388
    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>
    9590
     91{if !empty($template_data)}
    9692<h2>included templates &amp; config files (load time in seconds)</h2>
    9793
    9894<div>
    99 {section name=templates loop=$_debug_tpls}
    100     {section name=indent loop=$_debug_tpls[templates].depth}&nbsp;&nbsp;&nbsp;{/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}
    113102</div>
     103{/if}
    114104
    115105<h2>assigned template variables</h2>
    116106
    117107<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}
    125113</table>
    126114
     
    128116
    129117<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
    137124</table>
    138125</body>
    139126</html>
    140127{/capture}
    141 {if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
    142     {$debug_output}
    143 {else}
    144128<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}");
    154132    _smarty_console.document.close();
    155 // ]]>
    156133</script>
    157 {/if}
Note: See TracChangeset for help on using the changeset viewer.