html_options passthru all unknown paramters now

This commit is contained in:
messju
2003-03-17 16:36:02 +00:00
parent 61a223dae8
commit ddcd30be99
2 changed files with 11 additions and 1 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- html_options passthru all unknown paramters now
- fix link functionality of html_image, also make
output XHTML compatible (Hinrich Donner, Monte)
- append "@" to default modifier vars/args

View File

@@ -35,8 +35,17 @@ function smarty_function_html_options($params, &$smarty)
}
}
/* passthru all unknown params to $extra */
$extra = '';
unset($params['values']);
unset($params['output']);
unset($params['selected']);
unset($params['options']);
unset($params['name']);
foreach ($params as $key=>$value) $extra .= ' ' . $key . '="'. htmlspecialchars($value) . '"';
if(!empty($name)) {
$html_result = '<select name="' . $name . '">' . "\n" . $html_result . '</select>' . "\n";
$html_result = '<select name="' . $name . '"' . $extra . '>' . "\n" . $html_result . '</select>' . "\n";
}
return $html_result;
}