Fisheye: Tag 1.3.4.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/navigation-procs-oracle.xql'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1.7.4.1 refers to a dead (removed) revision in file `openacs-4/packages/acs-tcl/tcl/navigation-procs-postgresql.xql'. Fisheye: No comparison available. Pass `N' to diff? 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.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 29 Sep 2002 18:21:52 -0000 1.7.2.1 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 2 Feb 2003 21:25:45 -0000 1.7.2.2 @@ -41,6 +41,32 @@ return $out } +ad_proc ad_context_node_list { node_id } { + Starting with the given node_id, return a list of + [list url instance_name] items for parent nodes. + + @author Peter Marklund +} { + set context [list] + + while { ![empty_string_p $node_id] } { + array set node [site_node::get -node_id $node_id] + + # JCD: Provide something for the name if the instance name is + # absent. name is the tail bit of the url which seems like a + # reasonable thing to display. + if {[empty_string_p $node(instance_name)]} { + set node(instance_name) $node(name) + } + + set context [concat [list [list $node(url) $node(instance_name)]] $context] + + set node_id $node(parent_id) + } + + return $context +} + ad_proc -public ad_context_bar { -node_id args @@ -55,23 +81,23 @@ @see ad_context_bar_html @see ad_admin_context_bar } { - if { ![info exists node_id] } { - set node_id [ad_conn node_id] - } 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] + } + set context [list] if {[ad_conn user_id] != 0 && ![string match /pvt/home* [ad_conn url]]} { lappend context [list "[ad_pvt_home]" "[ad_pvt_home_name]"] } - db_foreach context {} { - lappend context [list $url $object_name] - } + set context [concat $context [ad_context_node_list $node_id]] + if { [string match admin/* [ad_conn extra_url]] } { lappend context [list "[ad_conn package_url]admin/" \ "Administration"]