|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Wed Apr 18, 2007 12:32 pm Post subject: [patch] field_separator for html_select_time |
|
|
hi,
here is a patch to add field_separator option to html_select_time, like it is for html_select_date
the separator is only added between hours, minutes and seconds - not before display_meridian
patch/diff against CVS head:
Code: |
Index: libs/plugins/function.html_select_time.php
===================================================================
RCS file: /repository/smarty/libs/plugins/function.html_select_time.php,v
retrieving revision 1.14
diff -u -r1.14 function.html_select_time.php
--- libs/plugins/function.html_select_time.php 11 Oct 2005 16:22:56 -0000 1.14
+++ libs/plugins/function.html_select_time.php 18 Apr 2007 12:17:16 -0000
@@ -45,6 +45,8 @@
$minute_extra = null;
$second_extra = null;
$meridian_extra = null;
+ /* String printed between the different fields. */
+ $field_separator = "\n";
foreach ($params as $_key=>$_value) {
switch ($_key) {
@@ -56,6 +58,7 @@
case 'minute_extra':
case 'second_extra':
case 'meridian_extra':
+ case 'field_separator':
$$_key = (string)$_value;
break;
@@ -81,7 +84,9 @@
$html_result = '';
+ $field_separator_add = false;
if ($display_hours) {
+ $field_separator_add = true;
$hours = $use_24_hours ? range(0, 23) : range(1, 12);
$hour_fmt = $use_24_hours ? '%H' : '%I';
for ($i = 0, $for_max = count($hours); $i < $for_max; $i++)
@@ -108,6 +113,10 @@
}
if ($display_minutes) {
+ if ($field_separator_add) {
+ $html_result .= $field_separator;
+ }
+ $field_separator_add = true;
$all_minutes = range(0, 59);
for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval)
$minutes[] = sprintf('%02d', $all_minutes[$i]);
@@ -135,6 +144,9 @@
}
if ($display_seconds) {
+ if ($field_separator_add) {
+ $html_result .= $field_separator;
+ }
$all_seconds = range(0, 59);
for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval)
$seconds[] = sprintf('%02d', $all_seconds[$i]);
|
Last edited by cybot on Thu Apr 19, 2007 7:04 am; edited 1 time in total |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Apr 18, 2007 6:45 pm Post subject: |
|
|
You could just make $field_separator = '' (empty) by default, and always catenate it (instead of testing for $field_separator_add) |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Thu Apr 19, 2007 7:02 am Post subject: |
|
|
no,
- $field_separator is empty by default, i just used "\n" to be in sync with html_select_date
- $field_separator_add is used to check if there is really a field before so not end up in
HH:MM:SS
:MM:SS
::SS
but
HH:MM:SS
MM:SS
SS
$field_separator_add is not an user option, only $field_separator like with html_select_date, $field_separator_add is only used to ensure display $field_separator ONLY BETWEEN fields even if not all fields displayed |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Thu Apr 19, 2007 7:03 am Post subject: |
|
|
btw. is this the right place to post patches? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Apr 19, 2007 4:04 pm Post subject: |
|
|
You can post patches here, if for no other reason to get some initial feedback. The best place to post patches is probably the smarty-dev mailing list. Include your patches as plain text attachments and for best results, makes sure the file is using unix line endings. |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Thu Apr 19, 2007 4:12 pm Post subject: |
|
|
i have to subscribe to the dev mailinglist just for submitting one patch?
... complicated ... |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Thu Apr 19, 2007 4:24 pm Post subject: |
|
|
No, like I said, you can submit patches here; however, the smarty-dev mailing list is low volume and if you are submitting patches, it wouldn't (shouldn't!) hurt for you to be subscribed. Finally, it really isn't complicated. I don't really know why you would say that it is. AFAIK, it is fairly standard for FLOSS projects. Its not like you need an developer account or have to pass some sort of vetting process.
Anyways, we are here and we are listening |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Fri Apr 20, 2007 7:37 am Post subject: |
|
|
oh, thats fine, i missread your post somehow.
i know about lists, dev and all that stuff ... (phpMyAdmin dev team)
i was just get your last post wrong. |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Tue Apr 24, 2007 8:38 am Post subject: |
|
|
will this be accepted, or does it require some work to be accepted? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Apr 24, 2007 2:23 pm Post subject: |
|
|
Seems okay to me. I've been too busy to test recently -- if no one else gets to it, I will try get it committed in the next few days.
Thanks for the patch, cybot! |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Tue Jun 12, 2007 7:56 am Post subject: |
|
|
any chance to get this patch applied?
any changes required?
patch for doc required too?
i just ask if it is a time problem so i can save my time too providing new patches ... |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Tue Jun 12, 2007 8:18 am Post subject: |
|
|
patch for the doc:
Code: | Index: docs/de/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/de/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.2
diff -u -r1.2 language-function-html-select-time.xml
--- docs/de/designers/language-custom-functions/language-function-html-select-time.xml 16 Jul 2004 14:32:28 -0000 1.2
+++ docs/de/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:06:04 -0000
@@ -125,6 +125,13 @@
<entry>null</entry>
<entry>Fügt dem Meridian-'select'-Tag zusätzliche Attribute hinzu.</entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>string</entry>
+ <entry>Nein</entry>
+ <entry>\n</entry>
+ <entry>Zeichenkette die zwischen den Feldern ausgegeben werden soll.</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/en/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/en/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.9
diff -u -r1.9 language-function-html-select-time.xml
--- docs/en/designers/language-custom-functions/language-function-html-select-time.xml 27 Sep 2006 08:47:37 -0000 1.9
+++ docs/en/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:05:13 -0000
@@ -141,6 +141,13 @@
<entry>Adds extra attributes to select/input tags if
given</entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>\n</entry>
+ <entry>String printed between different fields</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/es/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/es/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.2
diff -u -r1.2 language-function-html-select-time.xml
--- docs/es/designers/language-custom-functions/language-function-html-select-time.xml 8 Nov 2005 23:37:10 -0000 1.2
+++ docs/es/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:10:07 -0000
@@ -129,6 +129,13 @@
<entry>adiciona atributos extras a las etiquetas select/input
si fueron proporcionados</entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>\n</entry>
+ <entry>Cadena a mostrar entre los diferentes campos</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/fr/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/fr/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.8
diff -u -r1.8 language-function-html-select-time.xml
--- docs/fr/designers/language-custom-functions/language-function-html-select-time.xml 3 Oct 2006 18:55:36 -0000 1.8
+++ docs/fr/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:10:05 -0000
@@ -147,6 +147,14 @@
<entry>Ajoute des attributs supplmentaires aux balises
select / input du mridian.</entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>chane de caractres</entry>
+ <entry>Non</entry>
+ <entry>\n</entry>
+ <entry>la chane de caractres affiche entre les
+ diffrents champs.</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/it/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/it/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.1
diff -u -r1.1 language-function-html-select-time.xml
--- docs/it/designers/language-custom-functions/language-function-html-select-time.xml 1 Dec 2004 18:55:24 -0000 1.1
+++ docs/it/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:10:02 -0000
@@ -126,6 +126,13 @@
<entry>null</entry>
<entry>se presente aggiunge attributi extra al tag select/input</entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>stringa</entry>
+ <entry>no</entry>
+ <entry>\n</entry>
+ <entry>stringa di separazione fra i campi</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/ja/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/ja/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.1
diff -u -r1.1 language-function-html-select-time.xml
--- docs/ja/designers/language-custom-functions/language-function-html-select-time.xml 21 Apr 2007 12:13:33 -0000 1.1
+++ docs/ja/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:08:54 -0000
@@ -138,6 +138,13 @@
<entry>null</entry>
<entry>am/pmのselect/inputタグに拡張属性を追 </entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>\n</entry>
+ <entry>フィールド間に表示する文字列</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/pt_BR/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/pt_BR/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.3
diff -u -r1.3 language-function-html-select-time.xml
--- docs/pt_BR/designers/language-custom-functions/language-function-html-select-time.xml 2 Oct 2004 12:49:28 -0000 1.3
+++ docs/pt_BR/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:09:16 -0000
@@ -130,6 +130,13 @@
<entry>adiciona atributos
extras para tags select/input se fornecidas</entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>string</entry>
+ <entry>No</entry>
+ <entry>\n</entry>
+ <entry>string exibida entre os diferentes campos</entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
Index: docs/ru/designers/language-custom-functions/language-function-html-select-time.xml
===================================================================
RCS file: /repository/smarty/docs/ru/designers/language-custom-functions/language-function-html-select-time.xml,v
retrieving revision 1.8
diff -u -r1.8 language-function-html-select-time.xml
--- docs/ru/designers/language-custom-functions/language-function-html-select-time.xml 30 Dec 2005 15:43:38 -0000 1.8
+++ docs/ru/designers/language-custom-functions/language-function-html-select-time.xml 12 Jun 2007 08:09:53 -0000
@@ -132,6 +132,13 @@
<entry>null</entry>
<entry> select </entry>
</row>
+ <row>
+ <entry>field_separator</entry>
+ <entry>string</entry>
+ <entry></entry>
+ <entry>\n</entry>
+ <entry>, </entry>
+ </row>
</tbody>
</tgroup>
</informaltable>
|
|
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Jun 12, 2007 5:48 pm Post subject: |
|
|
Monte, Messju, can you take a look and commit? Seems okay to me -- I'm just swamped and can't get to this for now. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Jun 12, 2007 6:33 pm Post subject: |
|
|
Send your patches to the dev list, phpbb doesn't seem to like them.
Thanks |
|
Back to top |
|
cybot Smarty Regular
Joined: 20 Apr 2005 Posts: 83
|
Posted: Tue Jun 12, 2007 10:19 pm Post subject: |
|
|
why not enable file uploads in forum? |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|