home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / xoops-2.0.18.1.exe / xoops-2.0.18.1 / htdocs / class / smarty / debug.tpl < prev    next >
Encoding:
Text File  |  2007-09-09  |  3.5 KB  |  157 lines

  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. body, h1, h2, td, th, p {
  13.     font-family: sans-serif;
  14.     font-weight: normal;
  15.     font-size: 0.9em;
  16.     margin: 1px;
  17.     padding: 0;
  18. }
  19.  
  20. h1 {
  21.     margin: 0;
  22.     text-align: left;
  23.     padding: 2px;
  24.     background-color: #f0c040;
  25.     color:  black;
  26.     font-weight: bold;
  27.     font-size: 1.2em;
  28.  }
  29.  
  30. h2 {
  31.     background-color: #9B410E;
  32.     color: white;
  33.     text-align: left;
  34.     font-weight: bold;
  35.     padding: 2px;
  36.     border-top: 1px solid black;
  37. }
  38.  
  39. body {
  40.     background: black; 
  41. }
  42.  
  43. p, table, div {
  44.     background: #f0ead8;
  45.  
  46. p {
  47.     margin: 0;
  48.     font-style: italic;
  49.     text-align: center;
  50. }
  51.  
  52. table {
  53.     width: 100%;
  54. }
  55.  
  56. th, td {
  57.     font-family: monospace;
  58.     vertical-align: top;
  59.     text-align: left;
  60.     width: 50%;
  61. }
  62.  
  63. td {
  64.     color: green;
  65. }
  66.  
  67. .odd {
  68.     background-color: #eeeeee;
  69. }
  70.  
  71. .even {
  72.     background-color: #fafafa;
  73. }
  74.  
  75. .exectime {
  76.     font-size: 0.8em;
  77.     font-style: italic;
  78. }
  79.  
  80. #table_assigned_vars th {
  81.     color: blue;
  82. }
  83.  
  84. #table_config_vars th {
  85.     color: maroon;
  86. }
  87. /* ]]> */
  88. </style>
  89. {/literal}
  90. </head>
  91. <body>
  92.  
  93. <h1>Smarty Debug Console</h1>
  94.  
  95. <h2>included templates & config files (load time in seconds)</h2>
  96.  
  97. <div>
  98. {section name=templates loop=$_debug_tpls}
  99.     {section name=indent loop=$_debug_tpls[templates].depth}   {/section}
  100.     <font color={if $_debug_tpls[templates].type eq "template"}brown{elseif $_debug_tpls[templates].type eq "insert"}black{else}green{/if}>
  101.         {$_debug_tpls[templates].filename|escape:html}</font>
  102.     {if isset($_debug_tpls[templates].exec_time)}
  103.         <span class="exectime">
  104.         ({$_debug_tpls[templates].exec_time|string_format:"%.5f"})
  105.         {if %templates.index% eq 0}(total){/if}
  106.         </span>
  107.     {/if}
  108.     <br />
  109. {sectionelse}
  110.     <p>no templates included</p>
  111. {/section}
  112. </div>
  113.  
  114. <h2>assigned template variables</h2>
  115.  
  116. <table id="table_assigned_vars">
  117.     {section name=vars loop=$_debug_keys}
  118.         <tr class="{cycle values="odd,even"}">
  119.             <th>{ldelim}${$_debug_keys[vars]|escape:'html'}{rdelim}</th>
  120.             <td>{$_debug_vals[vars]|@debug_print_var}</td></tr>
  121.     {sectionelse}
  122.         <tr><td><p>no template variables assigned</p></td></tr>
  123.     {/section}
  124. </table>
  125.  
  126. <h2>assigned config file variables (outer template scope)</h2>
  127.  
  128. <table id="table_config_vars">
  129.     {section name=config_vars loop=$_debug_config_keys}
  130.         <tr class="{cycle values="odd,even"}">
  131.             <th>{ldelim}#{$_debug_config_keys[config_vars]|escape:'html'}#{rdelim}</th>
  132.             <td>{$_debug_config_vals[config_vars]|@debug_print_var}</td></tr>
  133.     {sectionelse}
  134.         <tr><td><p>no config vars assigned</p></td></tr>
  135.     {/section}
  136. </table>
  137. </body>
  138. </html>
  139. {/capture}
  140. {if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
  141.     {$debug_output}
  142. {else}
  143. <script type="text/javascript">
  144. // <![CDATA[
  145.     if ( self.name == '' ) {ldelim}
  146.        var title = 'Console';
  147.     {rdelim}
  148.     else {ldelim}
  149.        var title = 'Console_' + self.name;
  150.     {rdelim}
  151.     _smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
  152.     _smarty_console.document.write('{$debug_output|escape:'javascript'}');
  153.     _smarty_console.document.close();
  154. // ]]>
  155. </script>
  156. {/if}