Index: openacs-4/packages/acs-templating/tcl/form-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/form-procs.tcl,v diff -u -r1.16 -r1.17 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 10 Sep 2003 15:02:57 -0000 1.16 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 22 Sep 2003 17:42:56 -0000 1.17 @@ -295,25 +295,10 @@ @return A string containing a template for the body of the form. } { + get_reference # - # Elements - # - - - set elements:rowcount 0 - - foreach element_ref $elements { - - incr elements:rowcount - - # get a reference by index for the multirow data source - upvar #$level $element_ref elements:${elements:rowcount} - set "elements:${elements:rowcount}(rownum)" ${elements:rowcount} - } - - # # Buttons # @@ -340,20 +325,35 @@ set buttons:rowcount 0 foreach button $form_properties(${form_properties(mode)}_buttons) { - incr buttons:rowcount - set label [lindex $button 0] set name [lindex $button 1] if { [string equal $name "ok"] } { # We hard-code the OK button to be wider than it otherwise would - set "buttons:${buttons:rowcount}(label)" " $label " - } else { - set "buttons:${buttons:rowcount}(label)" $label + set label " $label " } - set "buttons:${buttons:rowcount}(name)" "formbutton:$name" + set name "formbutton:$name" + + template::element create $id $name -widget submit -label $label } - + + # + # Elements + # RAL: moved this below so we could take advantage of the template::element + # API in the button loop above. The buttons multirow in standard.adp is + # no longer necessary. + # + set elements:rowcount 0 + + foreach element_ref $elements { + + incr elements:rowcount + + # get a reference by index for the multirow data source + upvar #$level $element_ref elements:${elements:rowcount} + set "elements:${elements:rowcount}(rownum)" ${elements:rowcount} + } + if { [string equal $style {}] } { set style [parameter::get \ -package_id [ad_conn subsite_id] \ @@ -397,7 +397,12 @@ @return A string containing the HTML for the body of the form. } { - set __adp_output [template $id $style] + if { [catch { + set __adp_output [template $id $style] + }] } { + set style "standard" + set __adp_output [template $id $style] + } set level [template::adp_level]