mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-07 11:54:26 +02:00
fix html_select_date separator when parts are missing (thanks to kayk for the patch)
This commit is contained in:
3
NEWS
3
NEWS
@@ -1,3 +1,6 @@
|
|||||||
|
- fix html_select_date separator when parts are missing (hayk,
|
||||||
|
monte)
|
||||||
|
|
||||||
Version 2.6.17 (Mar 5th, 2007)
|
Version 2.6.17 (Mar 5th, 2007)
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
@@ -178,7 +178,9 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
|
|
||||||
$html_result = $month_result = $day_result = $year_result = "";
|
$html_result = $month_result = $day_result = $year_result = "";
|
||||||
|
|
||||||
|
$field_separator_count = -1;
|
||||||
if ($display_months) {
|
if ($display_months) {
|
||||||
|
$field_separator_count++;
|
||||||
$month_names = array();
|
$month_names = array();
|
||||||
$month_values = array();
|
$month_values = array();
|
||||||
if(isset($month_empty)) {
|
if(isset($month_empty)) {
|
||||||
@@ -216,6 +218,7 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($display_days) {
|
if ($display_days) {
|
||||||
|
$field_separator_count++;
|
||||||
$days = array();
|
$days = array();
|
||||||
if (isset($day_empty)) {
|
if (isset($day_empty)) {
|
||||||
$days[''] = $day_empty;
|
$days[''] = $day_empty;
|
||||||
@@ -251,6 +254,7 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($display_years) {
|
if ($display_years) {
|
||||||
|
$field_separator_count++;
|
||||||
if (null !== $field_array){
|
if (null !== $field_array){
|
||||||
$year_name = $field_array . '[' . $prefix . 'Year]';
|
$year_name = $field_array . '[' . $prefix . 'Year]';
|
||||||
} else {
|
} else {
|
||||||
@@ -314,7 +318,7 @@ function smarty_function_html_select_date($params, &$smarty)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Add the field seperator
|
// Add the field seperator
|
||||||
if($i != 2) {
|
if($i < $field_separator_count) {
|
||||||
$html_result .= $field_separator;
|
$html_result .= $field_separator;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user