html_select_date [PATCH] (again)
| From: | Nicklas Bondesson | Date: | Mon, 04 Jul 2005 13:44:12 +0000 |
| Subject: | html_select_date [PATCH] (again) | ||
| Groups: | php.smarty.dev | ||
| Request: | Send a blank email to php-smarty-dev+get-2733@lists.php.net to get a copy of this message | ||
Attached the patch as a .txt file.
Nicklas
--- function.html_select_date.php.orig 2005-07-03 19:43:16.000000000 +0200 +++ function.html_select_date.php 2005-07-03 19:42:23.000000000 +0200 @@ -81,6 +81,9 @@ foreach ($params as $_key=>$_value) { switch ($_key) { + case 'start_year_user': + case 'start_month_user': + case 'start_day_user': case 'prefix': case 'time': case 'start_year': @@ -198,7 +201,7 @@ $month_result .= smarty_function_html_options(array('output' => $month_names, 'values' => $month_values, - 'selected' => $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', + 'selected' => $start_month_user ? $start_month_user : $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', 'print_result' => false), $smarty); $month_result .= '</select>'; @@ -233,7 +236,7 @@ $day_result .= '>'."\n"; $day_result .= smarty_function_html_options(array('output' => $days, 'values' => $day_values, - 'selected' => $time[2], + 'selected' => $start_day_user ? $start_day_user : $time[2], 'print_result' => false), $smarty); $day_result .= '</select>'; @@ -279,7 +282,7 @@ $year_result .= '>'."\n"; $year_result .= smarty_function_html_options(array('output' => $years, 'values' => $yearvals, - 'selected' => $time[0], + 'selected' => $start_year_user ? $start_year_user : $time[0], 'print_result' => false), $smarty); $year_result .= '</select>';
--- function.html_select_date.php.orig 2005-07-03 19:43:16.000000000 +0200 +++ function.html_select_date.php 2005-07-03 19:42:23.000000000 +0200 @@ -81,6 +81,9 @@ foreach ($params as $_key=>$_value) { switch ($_key) { + case 'start_year_user': + case 'start_month_user': + case 'start_day_user': case 'prefix': case 'time': case 'start_year': @@ -198,7 +201,7 @@ $month_result .= smarty_function_html_options(array('output' => $month_names, 'values' => $month_values, - 'selected' => $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', + 'selected' => $start_month_user ? $start_month_user : $a=$time[1] ? strftime($month_value_format, mktime(0, 0, 0, (int)$time[1], 1, 2000)) : '', 'print_result' => false), $smarty); $month_result .= '</select>'; @@ -233,7 +236,7 @@ $day_result .= '>'."\n"; $day_result .= smarty_function_html_options(array('output' => $days, 'values' => $day_values, - 'selected' => $time[2], + 'selected' => $start_day_user ? $start_day_user : $time[2], 'print_result' => false), $smarty); $day_result .= '</select>'; @@ -279,7 +282,7 @@ $year_result .= '>'."\n"; $year_result .= smarty_function_html_options(array('output' => $years, 'values' => $yearvals, - 'selected' => $time[0], + 'selected' => $start_year_user ? $start_year_user : $time[0], 'print_result' => false), $smarty); $year_result .= '</select>';