Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 7 Nov 2003 17:20:11 -0000 1.17 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 8 Feb 2004 18:37:24 -0000 1.18 @@ -78,6 +78,52 @@ return $context } +ad_proc -public ad_context_bar_multirow { + {-from_node ""} + -node_id + {-multirow "context"} + context +} { + Returns a Yahoo-style hierarchical navbar. Includes "Administration" + if applicable, and the subsite if not global. 'args' can be either + one or more lists, or a simple string. + + @param node_id If provided work up from this node, otherwise the current node + @param from_node If provided do not generate links to the given node and above. + @param separator The text placed between each link (passed to ad_context_bar_html if provided) + @return an html fragment generated by ad_context_bar_html + + @see ad_context_bar_html +} { + if {![parameter::get -package_id [site_node_closest_ancestor_package "acs-subsite"] -parameter ShowContextBarP -default 1]} { + return "" + } + + if { ![exists_and_not_null node_id] } { + set node_id [ad_conn node_id] + } + + template::multirow create $multirow url label + + foreach elm [ad_context_node_list -from_node $from_node $node_id] { + template::multirow append $multirow [lindex $elm 0] [lindex $elm 1] + } + + if { [string match "admin/*" [ad_conn extra_url]] } { + template::multirow append $multirow "[ad_conn package_url]admin/" "Administration" + } + + if { [llength $context] == 0 } { + # fix last element to just be literal string + template::multirow set $multirow [template::multirow size $multirow] url {} + } + + foreach elm [lrange $context 0 end-1] { + template::multirow append $multirow [lindex $elm 0] [lindex $elm 1] + } + template::multirow append $multirow {} [lindex $context end] +} + ad_proc -public ad_context_bar { {-from_node ""} -node_id