4
Okay, just tried to add smarty-debug and found a snippet for doing this. Unfortunately this code is a bit outdated and shows up not collapsed in FirePHP. So use this at your own risk.
Step 1: edit class/template.php should be line 56 from
if ( $xoopsConfig['debug_mode'] == 2 ) {
to
if ( $xoopsConfig['debug_mode'] == 1 ) {
Step 2: edit include/common.php should be line 182 from
if ( $xoopsConfig['debug_mode'] == 1 || $xoopsConfig['debug_mode'] == 2 ) {
to
if ( $xoopsConfig['debug_mode'] == 1 || $xoopsConfig['debug_mode'] == 2 || $xoopsConfig['debug_mode'] == 3 ) {
Step 3: edit class/smarty/internals/core.display_debug_console.php and replace the complete code with this
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty debug_console function plugin
*
* Type: core
* Name: display_debug_console
* Purpose: display the javascript debug console window
* @param array Format: null
* @param Smarty
*/
if (!defined('XOOPS_ROOT_PATH')) die('XOOPS_ROOT_PATH not defined');
require_once XOOPS_ROOT_PATH.'/FirePHPCore/FirePHP.class.php';
function smarty_core_display_debug_console($params, &$smarty)
{
//get required debug variables
$assigned_vars = $smarty->_tpl_vars;
ksort($assigned_vars);
$config_vars = array();
if(@is_array($smarty->_config[0])){
$config_vars = $smarty->_config[0];
ksort($config_vars);
}
$firephp = FirePHP::getInstance(true);
$firephp->group('Smarty Debug Output');
/*Log template files*/
$firephp->group('included templates & config files (load time in seconds)');
foreach( $smarty->_smarty_debug_info as $tml ){
$msg = str_repeat('--', $tml['depth']);
$msg .= ( $tml['depth'] != 0 ) ? '>' : '';
if (isset($tml['exec_time'])) $getthetime = ' (' . substr($tml['exec_time'], 0, 7) . 's)';
else $getthetime = '';
$msg .= $tml['filename'] . $getthetime;
$firephp->log($msg);
}
$firephp->groupEnd(); //end group 'included templates &...'
/*Log assigned template variables*/
$firephp->group('assigned template variables');
foreach( $assigned_vars as $key => $value ){
$firephp->log($value, '{$' . $key . '}');
}
$firephp->groupEnd(); //end group 'assigned template variables'
/*Log assigned config file variables (outer template scope)*/
$firephp->group('assigned config file variables (outer template scope)');
/*Check if there is something in the config*/
if(!empty($config_vars)){
foreach( $config_vars as $key => $value ){
$firephp->log($value, '{#' . $key . '#}');
}
} else{
$firephp->log("No configuration values available");
}
$firephp->groupEnd(); //end group 'assigned config file variables (outer template scope)'
$firephp->groupEnd(); //end group 'Smarty Debug Output'
}
/* vim: set expandtab: */
?>
Have fun!