subsite::add_section_row (public)

 subsite::add_section_row -array array -base_url base_url \
    -multirow multirow [ -section section ]

Defined in packages/acs-subsite/tcl/subsite-procs.tcl

Helper proc for adding rows of sections to the page flow of the subsite.

Switches:
-array (required)
-base_url (required)
-multirow (required)
-section (optional)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 subsite::define_pageflow subsite::define_pageflow (public) subsite::add_section_row subsite::add_section_row subsite::define_pageflow->subsite::add_section_row ad_conn ad_conn (public) subsite::add_section_row->ad_conn ad_file ad_file (public) subsite::add_section_row->ad_file site_node::closest_ancestor_package site_node::closest_ancestor_package (public) subsite::add_section_row->site_node::closest_ancestor_package subsite::package_keys subsite::package_keys (public) subsite::add_section_row->subsite::package_keys template::multirow template::multirow (public) subsite::add_section_row->template::multirow

Testcases:
No testcase defined.
Source code:
    upvar $array info

    # the folder index page is called .
    if { $info(url) eq ""
         || $info(url) eq "index"
         || [string match "*/" $info(url)]
         || [string match "*/index" $info(url)]
     } {
        set info(url) "[string range $info(url) 0 [string last / $info(url)]]."
    }

    if { [ad_conn node_id] ==
         [site_node::closest_ancestor_package -include_self  -package_key [subsite::package_keys]  -url [ad_conn url]] } {
        set current_url [ad_conn extra_url]
    } else {
        # Need to prepend the path from the subsite to this package
        set current_url [string range [ad_conn url] [string length $base_url] end]
    }
    if { $current_url eq ""
         || $current_url eq "index"
         || [string match "*/" $current_url]
         || [string match "*/index" $current_url]
     } {
        set current_url "[string range $current_url 0 [string last / $current_url]]."
    }

    set info(url) [ad_file join $info(folder) $info(url)]
    regsub {/\.$} $info(url) / info(url)

    # Default to not selected
    set selected_p 0

    if { $current_url eq $info(url) || $info(name) eq $section } {
        set selected_p 1
    } else {
        foreach pattern $info(selected_patterns) {
            set full_pattern [ad_file join $info(folder) $pattern]
            if { [string match $full_pattern $current_url] } {
                set selected_p 1
                break
            }
        }
    }

    set link_p [expr {$current_url ne $info(url) }]

    template::multirow append $multirow  $info(name)  $info(label)  $info(title)  [ad_file join $base_url $info(url)]  $selected_p  $link_p

    return $selected_p
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-subsite/tcl/subsite-procs-postgresql.xql

Oracle XQL file:
packages/acs-subsite/tcl/subsite-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: