- bugfix on {debug}

This commit is contained in:
uwe.tews@googlemail.com
2010-11-13 01:53:38 +00:00
parent 626b95dfb4
commit 3c04e4ff37
3 changed files with 18 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
13/11/2010
- bugfix on {debug}
===== Smarty 3.0.2 =====
12/11/2010
- reactivated $error_reporting property handling
- fixed typo in compile_continue

View File

@@ -30,7 +30,7 @@ class Smarty_Internal_Compile_Debug extends Smarty_Internal_CompileBase {
$this->compiler->tag_nocache = true;
// display debug template
$_output = "<?php Smarty_Internal_Plugin_Loader::loadPlugin('Smarty_Internal_Debug', \$_smarty_tpl->smarty->plugins_dir); Smarty_Internal_Debug::display_debug(\$_smarty_tpl->smarty); ?>";
$_output = "<?php Smarty_Internal_Plugin_Loader::loadPlugin('Smarty_Internal_Debug', \$_smarty_tpl->smarty->plugins_dir); Smarty_Internal_Debug::display_debug(\$_smarty_tpl); ?>";
return $_output;
}
}

View File

@@ -73,12 +73,21 @@ class Smarty_Internal_Debug extends Smarty_Internal_Data {
/**
* Opens a window for the Smarty Debugging Consol and display the data
*/
public static function display_debug($smarty)
public static function display_debug($obj)
{
// prepare information of assigned variables
$_assigned_vars = $smarty->tpl_vars;
$ptr = $obj;
while (isset($ptr->parent)) {
$ptr = $ptr->parent;
}
if ($obj instanceof Smarty) {
$smarty = $obj;
} else {
$smarty = $obj->smarty;
}
$_assigned_vars = $ptr->tpl_vars;
ksort($_assigned_vars);
$_config_vars = $smarty->config_vars;
$_config_vars = $ptr->config_vars;
ksort($_config_vars);
$ldelim = $smarty->left_delimiter;
$rdelim = $smarty->right_delimiter;