32 require_once $smarty->_get_plugin_filepath(
'shared',
'escape_special_chars');
42 foreach($params as $_key => $_val) {
45 $$_key = (string)$_val;
49 $$_key = (array)$_val;
54 $$_key = array_values((array)$_val);
58 $$_key = array_map(
'strval', array_values((array)$_val));
62 if(!is_array($_val)) {
65 $smarty->trigger_error(
"html_options: extra attribute '$_key' cannot be an array", E_USER_NOTICE);
71 if (!isset(
$options) && !isset($values))
83 foreach ($values as $_i=>$_key) {
84 $_val = isset($output[$_i]) ? $output[$_i] :
'';
91 $_html_result =
'<select name="' . $name .
'"' . $extra .
'>' .
"\n" . $_html_result .
'</select>' .
"\n";
99 if(!is_array($value)) {
102 if (in_array((
string)$key, $selected))
103 $_html_result .=
' selected="selected"';
108 return $_html_result;
113 foreach ($values as $key => $value) {
116 $optgroup_html .=
"</optgroup>\n";
117 return $optgroup_html;