| 1 | cvsjoko | 1.1 | <?php | 
| 2 |  |  |  | 
| 3 |  |  | /* | 
| 4 |  |  | * Smarty plugin | 
| 5 |  |  | * ------------------------------------------------------------- | 
| 6 |  |  | * Type:     function | 
| 7 |  |  | * Name:     assign_debug_info | 
| 8 |  |  | * Purpose:  assign debug info to the template | 
| 9 |  |  | * ------------------------------------------------------------- | 
| 10 |  |  | */ | 
| 11 |  |  | function smarty_function_assign_debug_info($params, &$smarty) | 
| 12 |  |  | { | 
| 13 |  |  | $assigned_vars = $smarty->_tpl_vars; | 
| 14 |  |  | ksort($assigned_vars); | 
| 15 |  |  | if (@is_array($smarty->_config[0])) { | 
| 16 |  |  | $config_vars = $smarty->_config[0]; | 
| 17 |  |  | ksort($config_vars); | 
| 18 |  |  | $smarty->assign("_debug_config_keys", array_keys($config_vars)); | 
| 19 |  |  | $smarty->assign("_debug_config_vals", array_values($config_vars)); | 
| 20 |  |  | } | 
| 21 |  |  |  | 
| 22 |  |  | $included_templates = $smarty->_smarty_debug_info; | 
| 23 |  |  |  | 
| 24 |  |  | $smarty->assign("_debug_keys", array_keys($assigned_vars)); | 
| 25 |  |  | $smarty->assign("_debug_vals", array_values($assigned_vars)); | 
| 26 |  |  |  | 
| 27 |  |  | $smarty->assign("_debug_tpls", $included_templates); | 
| 28 |  |  | } | 
| 29 |  |  |  | 
| 30 |  |  | /* vim: set expandtab: */ | 
| 31 |  |  |  | 
| 32 |  |  | ?> |