fix html_select_date separator when parts are missing (thanks to kayk for the patch)

This commit is contained in:
mohrt
2007-03-06 20:13:55 +00:00
parent 1f2852d1da
commit e4ed759394
2 changed files with 8 additions and 1 deletions

3
NEWS
View File

@@ -1,3 +1,6 @@
- fix html_select_date separator when parts are missing (hayk,
monte)
Version 2.6.17 (Mar 5th, 2007)
------------------------------

View File

@@ -178,7 +178,9 @@ function smarty_function_html_select_date($params, &$smarty)
$html_result = $month_result = $day_result = $year_result = "";
$field_separator_count = -1;
if ($display_months) {
$field_separator_count++;
$month_names = array();
$month_values = array();
if(isset($month_empty)) {
@@ -216,6 +218,7 @@ function smarty_function_html_select_date($params, &$smarty)
}
if ($display_days) {
$field_separator_count++;
$days = array();
if (isset($day_empty)) {
$days[''] = $day_empty;
@@ -251,6 +254,7 @@ function smarty_function_html_select_date($params, &$smarty)
}
if ($display_years) {
$field_separator_count++;
if (null !== $field_array){
$year_name = $field_array . '[' . $prefix . 'Year]';
} else {
@@ -314,7 +318,7 @@ function smarty_function_html_select_date($params, &$smarty)
break;
}
// Add the field seperator
if($i != 2) {
if($i < $field_separator_count) {
$html_result .= $field_separator;
}
}