43 require_once $smarty->_get_plugin_filepath(
'shared',
'escape_special_chars');
55 foreach($params as $_key => $_val) {
59 $$_key = (string)$_val;
65 $smarty->trigger_error(
'html_radios: the "' . $_key .
'" attribute cannot be an array', E_USER_WARNING);
67 $selected = (string)$_val;
77 $$_key = (array)$_val;
82 $$_key = array_values((array)$_val);
86 $smarty->trigger_error(
'html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING);
94 if(!is_array($_val)) {
97 $smarty->trigger_error(
"html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
103 if (!isset(
$options) && !isset($values))
106 $_html_result = array();
115 foreach ($values as $_i=>$_key) {
116 $_val = isset($output[$_i]) ? $output[$_i] :
'';
122 if(!empty($params[
'assign'])) {
123 $smarty->assign($params[
'assign'], $_html_result);
125 return implode(
"\n",$_html_result);
135 $_output .=
'<label for="' . $_id .
'">';
137 $_output .=
'<label>';
140 $_output .=
'<input type="radio" name="'
144 if ($labels && $label_ids) $_output .=
' id="' . $_id .
'"';
146 if ((
string)$value==$selected) {
147 $_output .=
' checked="checked"';
149 $_output .= $extra .
' />' . $output;
150 if ($labels) $_output .=
'</label>';
151 $_output .= $separator;