update debug console to show objects, fix warning in debug.tpl

This commit is contained in:
mohrt
2002-07-24 13:21:51 +00:00
parent 0466121f7d
commit 363d635f0c
5 changed files with 20 additions and 2 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- update debug console to print objects (Simon Willison,
Monte)
- fix Config_File class to not error when there are no - fix Config_File class to not error when there are no
sections (Peter Kmet, Monte) sections (Peter Kmet, Monte)
- add default modifier logic (Monte) - add default modifier logic (Monte)

View File

@@ -4,7 +4,7 @@
{assign_debug_info} {assign_debug_info}
{if $_smarty_debug_output eq "html"} {if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
<HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff> <HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>
<table border=0 width=100%> <table border=0 width=100%>
<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr> <tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>

View File

@@ -4,7 +4,7 @@
{assign_debug_info} {assign_debug_info}
{if $_smarty_debug_output eq "html"} {if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"}
<HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff> <HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>
<table border=0 width=100%> <table border=0 width=100%>
<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr> <tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>

View File

@@ -17,6 +17,14 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
$results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return"; $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
} }
return $results; return $results;
} else if (is_object($var)) {
$object_vars = get_object_vars($var);
$results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
foreach ($object_vars as $curr_key => $curr_val) {
$return = smarty_modifier_debug_print_var($curr_val, $depth+1);
$results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
}
return $results;
} else { } else {
if (empty($var) && $var != "0") { if (empty($var) && $var != "0") {
return '<i>empty</i>'; return '<i>empty</i>';

View File

@@ -17,6 +17,14 @@ function smarty_modifier_debug_print_var($var, $depth = 0, $length = 40)
$results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return"; $results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
} }
return $results; return $results;
} else if (is_object($var)) {
$object_vars = get_object_vars($var);
$results = "<b>".get_class($var)." Object (".count($object_vars).")</b>";
foreach ($object_vars as $curr_key => $curr_val) {
$return = smarty_modifier_debug_print_var($curr_val, $depth+1);
$results .= '<br>\r'.str_repeat('&nbsp;', $depth*2)."<b>$curr_key</b> =&gt; $return";
}
return $results;
} else { } else {
if (empty($var) && $var != "0") { if (empty($var) && $var != "0") {
return '<i>empty</i>'; return '<i>empty</i>';