mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
- other update regarding {debug}
This commit is contained in:
@@ -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();
|
||||||
|
@@ -114,27 +114,23 @@ 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) {
|
$tpl_vars[$key]->scope = 'Data object';
|
||||||
$tpl_vars[$key]->scope = 'Data object';
|
|
||||||
} else {
|
|
||||||
$tpl_vars[$key]->scope = 'Smarty root';
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$tpl_vars[$key]->scope = 'local';
|
$tpl_vars[$key]->scope = 'Smarty root';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
||||||
|
Reference in New Issue
Block a user