or   * output[optional] -without this one the buttons don't have names * Author: Christopher Kvarme * --------------------------------------------------------------------------------------------- */ function smarty_function_html_radios($params, &$smarty) { extract($params); $html_result = ''; settype($checked, 'array'); if (isset($radios)) { settype($radios, 'array'); foreach ($radios as $key => $value) { $html_result .= smarty_function_html_radios_optoutput($key, $value, $checked); } } else { settype($output, 'array'); settype($values, 'array'); for ($i = 0, $for_max = count($output); $i < $for_max; $i++) { if ($i < count($values)) { $html_result .= smarty_function_html_radios_optoutput($values[$i], $output[$i], $checked, $name, $separator); } else { $html_result .= smarty_function_html_radios_optoutput($output[$i], $output[$i], $checked, $name, $separator); } } } return $html_result; } function smarty_function_html_radios_optoutput($key, $value, $checked, $name, $separator) { if(!is_array($value)) { $html_result = '' . "\n"; foreach ($values as $key => $value) { $optgroup_html .= smarty_function_html_radios_optoutput($key, $value, $checked); } $optgroup_html .= "\n"; return $optgroup_html; } /* vim: set expandtab: */ ?>