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
params
condition_type

Partial Call Graph (max 5 caller/called nodes):
%3 packages/acs-templating/tcl/tag-init.tcl packages/acs-templating/ tcl/tag-init.tcl template::template_tag_if_condition template::template_tag_if_condition packages/acs-templating/tcl/tag-init.tcl->template::template_tag_if_condition ad_try ad_try (public) template::template_tag_if_condition->ad_try template::adp_append_code template::adp_append_code (public) template::template_tag_if_condition->template::adp_append_code template::adp_compile_chunk template::adp_compile_chunk (public) template::template_tag_if_condition->template::adp_compile_chunk template::template_tag_if_concat_params template::template_tag_if_concat_params (private) template::template_tag_if_condition->template::template_tag_if_concat_params template::template_tag_if_interp_expr template::template_tag_if_interp_expr (public) template::template_tag_if_condition->template::template_tag_if_interp_expr

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
[ hide source ] | [ make this the default ]
Show another procedure: