cvs: smarty / NEWS /docs designers.sgml /plugins function.html_select_time.php
| From: | Monte Ohrt | Date: | Mon, 29 Jul 2002 14:21:54 +0000 |
| Subject: | cvs: smarty / NEWS /docs designers.sgml /plugins function.html_select_time.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-218@lists.php.net to get a copy of this message | ||
mohrt Mon Jul 29 10:21:54 2002 EDT
Modified files:
/smarty NEWS
/smarty/docs designers.sgml
/smarty/plugins function.html_select_time.php
Log:
added paramters to html_select_time plugin
Index: smarty/NEWS
diff -u smarty/NEWS:1.223 smarty/NEWS:1.224
--- smarty/NEWS:1.223 Wed Jul 24 09:21:51 2002
+++ smarty/NEWS Mon Jul 29 10:21:52 2002
@@ -1,3 +1,6 @@
+ - added $all_extra, $hour_extra, $minute_extra,
+ $second_extra and $meridian_extra parameters to
+ html_select_time function (Rainer Collet, Monte)
- update debug console to print objects (Simon Willison,
Monte)
- fix Config_File class to not error when there are no
Index: smarty/docs/designers.sgml
diff -u smarty/docs/designers.sgml:1.38 smarty/docs/designers.sgml:1.39
--- smarty/docs/designers.sgml:1.38 Wed Jul 17 17:16:43 2002
+++ smarty/docs/designers.sgml Mon Jul 29 10:21:53 2002
@@ -3480,6 +3480,46 @@
<entry>n/a</entry>
<entry>outputs values to array of this name</entry>
</row>
+ <row>
+ <entry>all_extra</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>null</entry>
+ <entry>adds extra attributes to select/input tags if
+ given</entry>
+ </row>
+ <row>
+ <entry>hour_extra</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>null</entry>
+ <entry>adds extra attributes to select/input tags if
+ given</entry>
+ </row>
+ <row>
+ <entry>minute_extra</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>null</entry>
+ <entry>adds extra attributes to select/input tags if
+ given</entry>
+ </row>
+ <row>
+ <entry>second_extra</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>null</entry>
+ <entry>adds extra attributes to select/input tags if
+ given</entry>
+ </row>
+ <row>
+ <entry>meridian_extra</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>null</entry>
+ <entry>adds extra attributes to select/input tags if
+ given</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: smarty/plugins/function.html_select_time.php
diff -u smarty/plugins/function.html_select_time.php:1.6
smarty/plugins/function.html_select_time.php:1.7
--- smarty/plugins/function.html_select_time.php:1.6 Wed Jun 26 10:51:12 2002
+++ smarty/plugins/function.html_select_time.php Mon Jul 29 10:21:54 2002
@@ -27,6 +27,11 @@
"birthday[Minute]", "birthday[Seconds]" &
"birthday[Meridian]".
Can be combined with prefix. */
$field_array = null;
+ $all_extra = null;
+ $hour_extra = null;
+ $minute_extra = null;
+ $second_extra = null;
+ $meridian_extra = null;
extract($params);
@@ -41,10 +46,17 @@
$hours[$i] = sprintf('%02d', $hours[$i]);
$html_result .= '<select name=';
if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix .
'Hour]">'."\n";
+ $html_result .= '"' . $field_array . '[' . $prefix .
'Hour]"';
} else {
- $html_result .= '"' . $prefix .
'Hour">'."\n";
+ $html_result .= '"' . $prefix . 'Hour"';
}
+ if (null !== $hour_extra){
+ $html_result .= ' ' . $hour_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
+ }
+ $html_result .= '>'."\n";
$html_result .= smarty_function_html_options(array('output' =>
$hours,
'values' =>
$hours,
'selected' =>
strftime($hour_fmt, $time),
@@ -60,10 +72,18 @@
$selected = intval(floor(strftime('%M', $time) / $minute_interval) *
$minute_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix .
'Minute]">'."\n";
+ $html_result .= '"' . $field_array . '[' . $prefix .
'Minute]"';
} else {
- $html_result .= '"' . $prefix .
'Minute">'."\n";
+ $html_result .= '"' . $prefix . 'Minute"';
+ }
+ if (null !== $minute_extra){
+ $html_result .= ' ' . $minute_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
}
+ $html_result .= '>'."\n";
+
$html_result .= smarty_function_html_options(array('output' =>
$minutes,
'values' =>
$minutes,
'selected' =>
$selected,
@@ -79,10 +99,19 @@
$selected = intval(floor(strftime('%S', $time) / $second_interval) *
$second_interval);
$html_result .= '<select name=';
if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix .
'Second]">'."\n";
+ $html_result .= '"' . $field_array . '[' . $prefix .
'Second]"';
} else {
- $html_result .= '"' . $prefix .
'Second">'."\n";
+ $html_result .= '"' . $prefix . 'Second"';
}
+
+ if (null !== $second_extra){
+ $html_result .= ' ' . $second_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
+ }
+ $html_result .= '>'."\n";
+
$html_result .= smarty_function_html_options(array('output' =>
$seconds,
'values' =>
$seconds,
'selected' =>
$selected,
@@ -94,10 +123,19 @@
if ($display_meridian && !$use_24_hours) {
$html_result .= '<select name=';
if (null !== $field_array) {
- $html_result .= '"' . $field_array . '[' . $prefix .
'Meridian]">'."\n";
+ $html_result .= '"' . $field_array . '[' . $prefix .
'Meridian]"';
} else {
- $html_result .= '"' . $prefix .
'Meridian">'."\n";
+ $html_result .= '"' . $prefix . 'Meridian"';
+ }
+
+ if (null !== $meridian_extra){
+ $html_result .= ' ' . $meridian_extra;
+ }
+ if (null !== $all_extra){
+ $html_result .= ' ' . $all_extra;
}
+ $html_result .= '>'."\n";
+
$html_result .= smarty_function_html_options(array('output' =>
array('AM', 'PM'),
'values' =>
array('am', 'pm'),
'selected' =>
strtolower(strftime('%p', $time)),