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.32 -r1.33 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 3 Jul 2015 09:53:18 -0000 1.32 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 7 Aug 2017 23:47:59 -0000 1.33 @@ -39,8 +39,9 @@ } set out {} - foreach element [lrange $context 0 [llength $context]-2] { - append out [subst {[ns_quotehtml [lindex $element 1]] $separator }] + foreach element [lrange $context 0 [llength $context]-2] { + lassign $element href label + append out [subst {[ns_quotehtml $label] $separator }] } append out [ns_quotehtml [lindex $context end]] @@ -61,9 +62,9 @@ } { set context [list] - while { $node_id ne "" } { + while { $node_id ne "" } { 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. @@ -72,13 +73,17 @@ set node(instance_name) $node(name) } - set context [concat [list [list $node(url) [ad_quotehtml $node(instance_name)]]] $context] + # Don't collect link for nodes without an object underneath + # (e.g. empty site folders), as they would just be dead links + if {$node(object_id) ne ""} { + set context [list [list $node(url) [ns_quotehtml $node(instance_name)]] {*}$context] + } # We have the break here, so that 'from_node' itself is included if {$node_id eq $from_node} { break } - + set node_id $node(parent_id) } @@ -286,11 +291,14 @@ ad_proc -public util_current_location_node_id { } { returns node_id of util_current_location. Useful for hostnode mapped sites using ad_context_bar } { - regexp {^([a-z]+://)?([^:]+)(:[0-9]*)?$} [util_current_location] match location_proto location_hostname location_port + util::split_location [util_current_location] .proto location_hostname .port + if { [string match -nocase "www.*" $location_hostname] } { set location_hostname [string range $location_hostname 4 end] } - db_0or1row -cache_key util-${location_hostname}-node-id get_node_id_from_hostname "select node_id from host_node_map where host = :location_hostname" + db_0or1row -cache_key util-${location_hostname}-node-id get_node_id_from_hostname { + select node_id from host_node_map where host = :location_hostname + } if { ![info exists node_id ] } { set node_id "" } @@ -302,7 +310,7 @@ proc ad_no_uplevel_patterns {} { set regexp_patterns [list] lappend regexp_patterns "*/pvt/home.tcl" - # tcl files in the root directory + # Tcl files in the root directory lappend regexp_patterns "^/\[^/\]*\.tcl\$" lappend regexp_patterns "/admin*" } @@ -375,273 +383,293 @@ set return_string "" set counter 0 - append return_string "
-}] + template::add_event_listener \ + -id $selectid -event change \ + -script {go_to_url(this.options[this.selectedIndex].value);} + foreach item $items { set url_stub [ad_conn url] # if the url matches the url you would redirect to, as determined # either by highlight_url, or if highlight_url is not set, # the current url then select it if {$highlight_url ne "" && $highlight_url == [lindex $urls $counter]} { - append return_string "