mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fixed bug with label of html_options
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
|||||||
|
- fixed bug with label for html_options (Monte)
|
||||||
- added caching to config file loading (Monte)
|
- added caching to config file loading (Monte)
|
||||||
- added "extra" parameter to mailto function (Monte,
|
- added "extra" parameter to mailto function (Monte,
|
||||||
Massimiliano Perantoni)
|
Massimiliano Perantoni)
|
||||||
|
@@ -43,7 +43,7 @@ function smarty_function_html_options($params, &$smarty)
|
|||||||
|
|
||||||
function smarty_function_html_options_optoutput($key, $value, $selected) {
|
function smarty_function_html_options_optoutput($key, $value, $selected) {
|
||||||
if(!is_array($value)) {
|
if(!is_array($value)) {
|
||||||
$html_result = "<option label=\"$key\" value=\"$key\"";
|
$html_result = "<option label=\"$value\" value=\"$key\"";
|
||||||
if (in_array($key, $selected))
|
if (in_array($key, $selected))
|
||||||
$html_result .= " selected=\"selected\"";
|
$html_result .= " selected=\"selected\"";
|
||||||
$html_result .= ">$value</option>\n";
|
$html_result .= ">$value</option>\n";
|
||||||
@@ -54,7 +54,7 @@ function smarty_function_html_options_optoutput($key, $value, $selected) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function smarty_function_html_options_optgroup($key, $values, $selected) {
|
function smarty_function_html_options_optgroup($key, $values, $selected) {
|
||||||
$optgroup_html = "<optgroup label=\"$key\">\n";
|
$optgroup_html = "<optgroup label=\"$value\">\n";
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
$optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
|
$optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@ function smarty_function_html_options($params, &$smarty)
|
|||||||
|
|
||||||
function smarty_function_html_options_optoutput($key, $value, $selected) {
|
function smarty_function_html_options_optoutput($key, $value, $selected) {
|
||||||
if(!is_array($value)) {
|
if(!is_array($value)) {
|
||||||
$html_result = "<option label=\"$key\" value=\"$key\"";
|
$html_result = "<option label=\"$value\" value=\"$key\"";
|
||||||
if (in_array($key, $selected))
|
if (in_array($key, $selected))
|
||||||
$html_result .= " selected=\"selected\"";
|
$html_result .= " selected=\"selected\"";
|
||||||
$html_result .= ">$value</option>\n";
|
$html_result .= ">$value</option>\n";
|
||||||
@@ -54,7 +54,7 @@ function smarty_function_html_options_optoutput($key, $value, $selected) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function smarty_function_html_options_optgroup($key, $values, $selected) {
|
function smarty_function_html_options_optgroup($key, $values, $selected) {
|
||||||
$optgroup_html = "<optgroup label=\"$key\">\n";
|
$optgroup_html = "<optgroup label=\"$value\">\n";
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
$optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
|
$optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user