- other update regarding {debug}

This commit is contained in:
uwe.tews@googlemail.com
2010-12-01 23:34:06 +00:00
parent 176c3d625c
commit 5139a6fcd1
2 changed files with 7 additions and 17 deletions

View File

@@ -127,12 +127,6 @@ td {
{/capture} {/capture}
<script type="text/javascript"> <script type="text/javascript">
{$id = $template_name|default:''|md5} {$id = $template_name|default:''|md5}
if ( self.name == '' ) {
var title = 'Console{$id}';
}
else {
var title = 'Console_{$id}' + self.name;
}
_smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes"); _smarty_console = window.open("","console{$id}","width=680,height=600,resizable,scrollbars=yes");
_smarty_console.document.write("{$debug_output|escape:'javascript'}"); _smarty_console.document.write("{$debug_output|escape:'javascript'}");
_smarty_console.document.close(); _smarty_console.document.close();

View File

@@ -114,13 +114,12 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
/* /*
* Recursively gets variables from all template/data scopes * Recursively gets variables from all template/data scopes
*/ */
public static function get_debug_vars($obj, $is_parent = false) public static function get_debug_vars($obj)
{ {
$config_vars = $obj->config_vars; $config_vars = $obj->config_vars;
$tpl_vars = array(); $tpl_vars = array();
foreach ($obj->tpl_vars as $key => $var) { foreach ($obj->tpl_vars as $key => $var) {
$tpl_vars[$key] = clone $var; $tpl_vars[$key] = clone $var;
if (true) {
if ($obj instanceof Smarty_Internal_Template) { if ($obj instanceof Smarty_Internal_Template) {
$tpl_vars[$key]->scope = $obj->resource_type.':'.$obj->resource_name; $tpl_vars[$key]->scope = $obj->resource_type.':'.$obj->resource_name;
} elseif ($obj instanceof Smarty_Data) { } elseif ($obj instanceof Smarty_Data) {
@@ -128,13 +127,10 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
} else { } else {
$tpl_vars[$key]->scope = 'Smarty root'; $tpl_vars[$key]->scope = 'Smarty root';
} }
} else {
$tpl_vars[$key]->scope = 'local';
}
} }
if (isset($obj->parent)) { if (isset($obj->parent)) {
$parent = self::get_debug_vars($obj->parent, true); $parent = self::get_debug_vars($obj->parent);
$tpl_vars = array_merge($parent->tpl_vars, $tpl_vars); $tpl_vars = array_merge($parent->tpl_vars, $tpl_vars);
$config_vars = array_merge($parent->config_vars, $config_vars); $config_vars = array_merge($parent->config_vars, $config_vars);
} else { } else {