chat_scope_context_bar_ws_or_index chat_room_id argsWhat it does:
assumes scope is set in the callers environment. if scope=group, it assumes that group_context_bar_list are set in the callers environment. returns a Yahoo-style hierarchical contextbar for appropriate scope, starting with a link to either the workspace or /, depending on whether or not the user is logged in. Makes sure that everytime a link on the context bar is clicked, it is noted that the user has left the roomDefined in: /web/philip/tcl/chat-defs.tcl
Source code:
if { [ad_get_user_id] == 0 } { set choices [list "<a href=\"exit-room?[export_url_scope_vars chat_room_id]&newlocation=/\">[ad_system_name]</a>"] } else { set choices [list "<a href=\"exit-room?[export_url_scope_vars chat_room_id]&newlocation=[ad_pvt_home]\">Your Workspace</a>"] } set all_args [list] if { [uplevel [ad_scope_upvar_level] {info exists scope}] } { upvar [ad_scope_upvar_level] scope scope } else { set scope public } switch $scope { public { set all_args $args } group { upvar [ad_scope_upvar_level] group_vars_set group_vars_set set group_context_bar_list [ns_set get $group_vars_set group_context_bar_list] eval "lappend all_args $group_context_bar_list" foreach arg $args { lappend all_args $arg } } user { # this may be later modified if we allow users to customize the display of their pages set all_args $args } } set index 0 foreach arg $all_args { incr index if { $index == [llength $all_args] } { lappend choices $arg } else { lappend choices "<a href=\"exit-room?[export_url_scope_vars chat_room_id]&newlocation=[lindex $arg 0]\">[lindex $arg 1]</a>" } } return [join $choices " : "]