template::list::template (private)

 template::list::template -name name [ -style style ]

Defined in packages/acs-templating/tcl/list-procs.tcl

Process a list template with the special hacks into becoming a 'real' ADP template, as if it was included directly in the page. Will provide that template with a multirow named 'elements'.

Switches:
-name (required)
-style (optional)

Partial Call Graph (max 5 caller/called nodes):
%3 template::list::render template::list::render (public) template::list::template template::list::template template::list::render->template::list::template ad_conn ad_conn (public) template::list::template->ad_conn apm_package_id_from_key apm_package_id_from_key (public) template::list::template->apm_package_id_from_key parameter::get parameter::get (public) template::list::template->parameter::get template::adp_init template::adp_init (public) template::list::template->template::adp_init template::adp_level template::adp_level (public) template::list::template->template::adp_level

Testcases:
No testcase defined.
Source code:
    set level [template::adp_level]

    # Get an upvar'd reference to list_properties
    get_reference -name $name

    #
    # Create 'actions' and 'bulk_actions' multirows
    #

    # Manually construct a multirow by setting the relevant variables
    foreach type { actions bulk_actions } {
        set ${type}:rowcount 0

        foreach { label url title } $list_properties(${type}) {
            incr ${type}:rowcount
            set "${type}:[set "${type}:rowcount"](label)" $label
            set "${type}:[set "${type}:rowcount"](url)" $url
            set "${type}:[set "${type}:rowcount"](title)" $title
            set "${type}:[set "${type}:rowcount"](rownum)" [set "${type}:rowcount"]
        }
    }

    #
    # Create 'elements' multirow
    #

    # Manually construct a multirow by upvar'ing each of the element refs
    set elements:rowcount 0

    foreach element_name $list_properties(display_elements) {
        set element_ref [template::list::element::get_refname  -list_name $name  -element_name $element_name]
        upvar #$level $element_ref element_properties

        if { ![string is true -strict $element_properties(hide_p)] } {
            incr elements:rowcount

            # get a reference by index for the multirow data source
            upvar #$level $element_ref elements:${elements:rowcount}

            # Also set the rownum pseudocolumn
            set "elements:${elements:rowcount}(rownum)" ${elements:rowcount}
        }
    }

    # Table tag HTML attributes
    set list_properties(table_attributes) [template::list::util_html_to_attributes_string $list_properties(html) 1]

    #
    # Find the list template
    #

    if {$style eq ""} {
        set style $list_properties(style)
    }

    if {$style eq ""} {
        set style [parameter::get  -package_id [ad_conn subsite_id]  -parameter DefaultListStyle  -default [parameter::get  -package_id [apm_package_id_from_key "acs-templating"]  -parameter DefaultListStyle  -default "table"]]
    }

    set file_stub [template::resource_path -type lists -style $style]

    #
    # Ensure that the ADP template has been compiled and is
    # up-to-date, and execute it to update __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_output
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: