template::template_tag_if_condition (private)
template::template_tag_if_condition chunk params condition_type
Defined in packages/acs-templating/tcl/tag-procs.tcl
- Parameters:
- chunk (required)
- params (required)
- condition_type (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set condition "$condition_type \{" # parse simplified conditional expression set args [template_tag_if_concat_params $params] ad_try { while { 1 } { # process the conditional expression template_tag_if_interp_expr # Stop when we run out of args if { [llength $args] == 0 } { break } set conjunction [lindex $args 0] switch -- $conjunction { and { append condition " && " } or { append condition " || " } default { error "Invalid conjunction <tt>$conjunction</tt> in $condition_type tag" } } set args [lrange $args 1 end] } } on error {errorMsg} { set condition "$condition_type \{ 1 " set chunk $errorMsg } append condition "\} \{" switch -- $condition_type { if {template::adp_append_code $condition} elseif {template::adp_append_code $condition -nobreak} } # Done evaluating condition; evaluate body template::adp_compile_chunk $chunk # Add closing code template::adp_append_code "\}"XQL Not present: Generic, PostgreSQL, Oracle