subsite_navigation::add_section_row (private)

 subsite_navigation::add_section_row [ -subsite_id subsite_id ] \
    -array array -base_url base_url -multirow multirow -group group \
    [ -section section ] [ -parent parent ]

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

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

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

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

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  -node_id [site_node::get_node_id_from_object_id -object_id $subsite_id]  -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]
    }

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

    # Default to not selected
    set selected_p 0

    set info(tabindex) [template::multirow size $multirow]
    if { $info(accesskey) eq "" } {
        set info(accesskey) $info(tabindex)
    }
    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
            }
        }
    }

    # DRB: Expr thinks "-" is a subtraction operator thus this caveman if...
    if { $selected_p } {
        set navigation_id ${group}-navigation-active
    } else {
        set navigation_id ""
    }

    set joined_url [ad_file join $base_url $info(url)]
    if {[string index $info(url) end] eq "/"} {
        append joined_url /
    }

    template::multirow append $multirow  $group $info(label) $joined_url  "" $info(title) "" $info(accesskey) "" $navigation_id [template::multirow size $multirow]  $info(name) $parent $info(display_template)

    return $selected_p
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: