Index: openacs-4/packages/acs-templating/tcl/date-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/date-procs.tcl,v diff -u -r1.38 -r1.39 --- openacs-4/packages/acs-templating/tcl/date-procs.tcl 10 Jan 2007 21:22:12 -0000 1.38 +++ openacs-4/packages/acs-templating/tcl/date-procs.tcl 14 May 2007 20:30:27 -0000 1.39 @@ -877,7 +877,7 @@ # Display text entry for some elements, or if the type is text if { $type eq "t" || [regexp "year|short_year" $fragment] } { - set output "\n" + append output ">\n" return $output } else { # Use a default range for others @@ -1010,8 +1010,8 @@ # Just remember the format for now - in the future, allow # the user to enter a freeform format append output "\n" - append output "\n" + append output "value=\"$element(format)\" >\n" + append output "
\n" # Prepare the value to set defaults on the form if { [info exists element(value)] && @@ -1035,7 +1035,8 @@ set id_attr_name $attributes(id) } - while { $format_string ne {} } { + set tbody_content "" + while { ![string equal $format_string {}] } { # Snip off the next token regexp {([^/\-.: ]*)([/\-.: ]*)(.*)} \ @@ -1044,7 +1045,7 @@ regexp -nocase $template::util::date::token_exp $word \ match token type - append output "\n" + append tbody_content "\n" } - append output "\n" + append tbody_content "\n" # Append help text under each widget, if neccessary + set tfoot_content "" if { [info exists element(help)] } { - append output "" + + append tfoot_content "\n" foreach token $tokens { - set fragment_def $template::util::date::fragment_widgets($token) - append output "" + set fragment_def $template::util::date::fragment_widgets([string toupper $token]) + set fragment [lindex $fragment_def 1] + append tfoot_content "\n" } - append output "\n" + append tfoot_content "\n" } + append output "$tfoot_content$tbody_content" append output "
" + append tbody_content "" lappend tokens $token @@ -1053,10 +1054,10 @@ set fragment [lindex $fragment_def 1] if {[exists_and_not_null id_attr_name]} { - set attributes(id) "${id_attr_name}.${fragment}" + set attributes(id) "${id_attr_name}.${fragment}" } - append output [template::widget::[lindex $fragment_def 0] \ + append tbody_content [template::widget::[lindex $fragment_def 0] \ element \ $fragment \ [lindex $fragment_def 2] \ @@ -1067,26 +1068,30 @@ # Output the separator if {$sep eq " "} { - append output " " + append tbody_content " " } else { - append output "$sep" + append tbody_content "$sep" } - append output "
[lindex $fragment_def 3]
\n" append output "\n" @@ -1349,8 +1354,8 @@ } if {$element(mode) eq "edit"} { - append output "" - append output "" + append output "" + append output "" } else { append output $textdate append output ""