X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=wwwroot%2Fsmarty%2Flibs%2Fplugins%2Ffunction.html_options.php;h=cebadde4794cca9e3883ef39c47828851683b754;hb=38927c4d48865f73d1b965f1a07c76efe4339a9a;hp=b6f6b74003c5f7721ec79a48f0633b124dd1a01e;hpb=e034221efbc7970ec58be22d7517fd3c503dc903;p=mirrors%2FKyberia-bloodline.git diff --git a/wwwroot/smarty/libs/plugins/function.html_options.php b/wwwroot/smarty/libs/plugins/function.html_options.php index b6f6b74..cebadde 100644 --- a/wwwroot/smarty/libs/plugins/function.html_options.php +++ b/wwwroot/smarty/libs/plugins/function.html_options.php @@ -21,6 +21,7 @@ * the passed parameters * @link http://smarty.php.net/manual/en/language.function.html.options.php {html_image} * (Smarty online manual) + * @author Monte Ohrt * @param array * @param Smarty * @return string @@ -29,25 +30,25 @@ function smarty_function_html_options($params, &$smarty) { require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); - + $name = null; $values = null; $options = null; $selected = array(); $output = null; - + $extra = ''; - + foreach($params as $_key => $_val) { switch($_key) { case 'name': $$_key = (string)$_val; break; - + case 'options': $$_key = (array)$_val; break; - + case 'values': case 'output': $$_key = array_values((array)$_val); @@ -56,7 +57,7 @@ function smarty_function_html_options($params, &$smarty) case 'selected': $$_key = array_map('strval', array_values((array)$_val)); break; - + default: if(!is_array($_val)) { $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; @@ -73,12 +74,12 @@ function smarty_function_html_options($params, &$smarty) $_html_result = ''; if (isset($options)) { - + foreach ($options as $_key=>$_val) $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected); } else { - + foreach ($values as $_i=>$_key) { $_val = isset($output[$_i]) ? $output[$_i] : ''; $_html_result .= smarty_function_html_options_optoutput($_key, $_val, $selected);