' . "\n";
foreach ($tree as $node) {
$output .= '
' . $node['value'] . '';
if ($node['info']) {
$output .= ' - ' . $node['info'];
}
if ($node['children']) {
$output .= "\n" . print_tree_rec($node['children'], $level+1);
}
$output .= "\n";
}
$output .= "\n";
return $output;
}
function print_tree($params, Smarty_Internal_Template $template) {
if (empty($params['level'])) {
$level = 0;
} else {
$level = $params['level'];
}
if (empty($params['tree'])) {
return '';
} else {
return print_tree_rec($params['tree'], $level);
}
}