very small contribution to debug
| From: | Steve | Date: | Fri, 21 Feb 2003 22:18:52 +0000 |
| Subject: | very small contribution to debug | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-814@lists.php.net to get a copy of this message | ||
I thought it would be useful to know which smarty version I am using. So, I
added it to the debug function.
Please don't beat me up if the $_version was somehow available. I didn't
see it being easily accessable without assigning it as I did.
Hope this is useful....
Steve
Here are the appropriate diffs:
libs/plugins/function.assign_debug_info.php
28d27
< $smarty->assign("_version", $smarty->_version);
libs/debug.tpl
7a8
> <HTML><TITLE>Smarty {$_version} Debug Console
> "+self.name+"</TITLE><BODY
bgcolor=#ffffff>
9c10
< <tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>
---
> <tr bgcolor=#cccccc><th colspan=2>Smarty {$_version} Debug
Console</th></tr>
12c13
< <tr bgcolor={if %templates.index% is even}#eeeeee{else}#fafafa{/if}><td
colspan=2><tt>{section name=indent
loop=$_debug_tpls[templates].depth} {/section}<font
color={if $_debug_tpls[templates].type eq "template"}brown{elseif
$_debug_tpls[templates].type eq
"insert"}black{else}green{/if}>{$_debug_tpls[templates].filename}</font>{if
isset($_debug_tpls[templates].exec_time)} <font
size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if
%templates.index% eq 0} (total){/if}</i></font>{/if}</tt></td></tr>
---
> <tr bgcolor={if %templates.index% is even}#eeeeee{else}#fafafa{/if}><td
colspan=2><tt>{section name=indent
loop=$_debug_tpls[templates].depth} {/section}<font
color={if $_debug_tpls[templates].type eq "template"}brown{elseif
$_debug_tpls[templates].type eq
"insert"}black{else}green{/if}>{$_debug_tpls[templates].filename}</font>
<font
size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if
%templates.index% eq 0} (total){/if}</i></font></tt></td></tr>
36c37
< var title = 'Console_' + self.name;
---
> var title = 'Console ' + self.name;
39c40
< _smarty_console.document.write("<HTML><TITLE>Smarty Debug
Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>");
---
> _smarty_console.document.write("<HTML><TITLE>Smarty {$_version} Debug
Console "+self.name+"</TITLE><BODY bgcolor=#ffffff>");
41c42
< _smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty
Debug Console</th></tr>");
---
> _smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty
{$_version} Debug Console</th></tr>");
44c45
< _smarty_console.document.write("<tr bgcolor={if %templates.index% is
even}#eeeeee{else}#fafafa{/if}><td colspan=2><tt>{section name=indent
loop=$_debug_tpls[templates].depth} {/section}<font
color={if $_debug_tpls[templates].type eq "template"}brown{elseif
$_debug_tpls[templates].type eq
"insert"}black{else}green{/if}>{$_debug_tpls[templates].filename}</font>{if
isset($_debug_tpls[templates].exec_time)} <font
size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if
%templates.index% eq 0}
(total){/if}</i></font>{/if}</tt></td></tr>");
---
> _smarty_console.document.write("<tr bgcolor={if %templates.index% is
even}#eeeeee{else}#fafafa{/if}><td colspan=2><tt>{section name=indent
loop=$_debug_tpls[templates].depth} {/section}<font
color={if $_debug_tpls[templates].type eq "template"}brown{elseif
$_debug_tpls[templates].type eq
"insert"}black{else}green{/if}>{$_debug_tpls[templates].filename}</font>
<font
size=-1><i>({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if
%templates.index% eq 0} (total){/if}</i></font></tt></td></tr>");