template::form::template (private)
template::form::template id [ style ]
Defined in packages/acs-templating/tcl/form-procs.tcl
Auto-generate the template for a form
- Parameters:
- id (required)
- The form identifier
- style (optional)
- The style template to use when generating the form. Form style templates must be placed in the forms subdirectory of the ATS resources directory.
- Returns:
- A string containing a template for the body of the form.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: get_reference # # 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 {$style eq {}} { set style [parameter::get -package_id [ad_conn subsite_id] -parameter DefaultFormStyle -default [parameter::get -package_id [apm_package_id_from_key "acs-templating"] -parameter DefaultFormStyle -default "standard-lars"]] } set file_stub [template::resource_path -type forms -style $style] if { ![file exists "$file_stub.adp"] } { # We always have a template named 'standard' set file_stub [template::resource_path -type forms -style standard] } # # Ensure that the style template has been compiled and is # up-to-date, and execute the result into __adp_output. The only # data source on which this template depends is the "elements" # multirow data source. The output of this procedure will be # placed in __adp_output in this stack frame. # [template::adp_init adp $file_stub] return $__adp_outputXQL Not present: Generic, PostgreSQL, Oracle