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.15 -r1.16 --- openacs-4/packages/acs-templating/tcl/form-procs.tcl 1 Sep 2003 16:30:21 -0000 1.15 +++ openacs-4/packages/acs-templating/tcl/form-procs.tcl 10 Sep 2003 15:02:57 -0000 1.16 @@ -635,9 +635,7 @@ set elements $args } else { # Get all the form elements - set level [template::adp_level] - upvar #$level $id:properties properties - set elements $properties(element_names) + set elements [get_elements $id] } foreach element_id $elements { @@ -646,7 +644,36 @@ } } +ad_proc -public template::form::get_elements { + {-no_api:boolean} + id +} { + Return a list of element names for the form with given id. + @param no_api If provided, filter out form builder and ad_form API element names + that start with the double underscore + + @author Peter Marklund +} { + set level [template::adp_level] + upvar #$level $id:properties properties + set elements $properties(element_names) + + if { $no_api_p } { + set elements_no_api [list] + foreach element $elements { + if { ![regexp {^__} $element] } { + lappend elements_no_api $element + } + } + + return $elements_no_api + } else { + return $elements + } +} + + ad_proc -public template::form::get_errors { id } { @param id The form identifier @return the list of form errors