Blame www/smarty/plugins/function.assign_debug_info.php
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
/**
|
|
Chris PeBenito |
696b41 |
* Smarty plugin
|
|
Chris PeBenito |
696b41 |
* @package Smarty
|
|
Chris PeBenito |
696b41 |
* @subpackage plugins
|
|
Chris PeBenito |
696b41 |
*/
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
/**
|
|
Chris PeBenito |
696b41 |
* Smarty {assign_debug_info} function plugin
|
|
Chris PeBenito |
696b41 |
*
|
|
Chris PeBenito |
696b41 |
* Type: function
|
|
Chris PeBenito |
696b41 |
* Name: assign_debug_info
|
|
Chris PeBenito |
696b41 |
* Purpose: assign debug info to the template
|
|
Chris PeBenito |
696b41 |
* @param array unused in this plugin, this plugin uses {@link Smarty::$_config},
|
|
Chris PeBenito |
696b41 |
* {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info}
|
|
Chris PeBenito |
696b41 |
* @param Smarty
|
|
Chris PeBenito |
696b41 |
*/
|
|
Chris PeBenito |
696b41 |
function smarty_function_assign_debug_info($params, &$smarty)
|
|
Chris PeBenito |
696b41 |
{
|
|
Chris PeBenito |
696b41 |
$assigned_vars = $smarty->_tpl_vars;
|
|
Chris PeBenito |
696b41 |
ksort($assigned_vars);
|
|
Chris PeBenito |
696b41 |
if (@is_array($smarty->_config[0])) {
|
|
Chris PeBenito |
696b41 |
$config_vars = $smarty->_config[0];
|
|
Chris PeBenito |
696b41 |
ksort($config_vars);
|
|
Chris PeBenito |
696b41 |
$smarty->assign("_debug_config_keys", array_keys($config_vars));
|
|
Chris PeBenito |
696b41 |
$smarty->assign("_debug_config_vals", array_values($config_vars));
|
|
Chris PeBenito |
696b41 |
}
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
$included_templates = $smarty->_smarty_debug_info;
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
$smarty->assign("_debug_keys", array_keys($assigned_vars));
|
|
Chris PeBenito |
696b41 |
$smarty->assign("_debug_vals", array_values($assigned_vars));
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
$smarty->assign("_debug_tpls", $included_templates);
|
|
Chris PeBenito |
696b41 |
}
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
/* vim: set expandtab: */
|
|
Chris PeBenito |
696b41 |
|
|
Chris PeBenito |
696b41 |
?>
|