Index: openacs-4/packages/dotlrn/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/tcl/navigation-procs.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 13 Nov 2001 16:21:01 -0000 1.2 +++ openacs-4/packages/dotlrn/tcl/navigation-procs.tcl 29 Nov 2001 06:05:37 -0000 1.3 @@ -23,6 +23,24 @@ return "/dotlrn" } + ad_proc -public admin_navbar { + args + } { + do an admin navbar + } { + # Prepend some args + set first_args [list [list [root_url] "dotLRN"]] + if {[llength $args] > 0} { + lappend first_args [list "[root_url]/admin" Admin] + } else { + lappend first_args Admin + } + + set args [concat $first_args $args] + + return [raw_navbar $args] + } + ad_proc -public navbar { { -community_id "" } { -community_type "" } @@ -40,16 +58,30 @@ set community_type [dotlrn_community::get_community_type_from_community_id $community_id] } - set list_of_links [list "dotLRN"] + set first_args [] + lappend first_args [list [root_url] dotLRN] + lappend first_args [list [dotlrn_community::get_community_type_url $community_type] [dotlrn_community::get_community_type_name $community_type]] - lappend list_of_links "[dotlrn_community::get_community_type_name $community_type]" - if {![empty_string_p $community_id]} { - lappend list_of_links "[dotlrn_community::get_community_name $community_id]" + lappend first_args [list [dotlrn_community::get_community_url $community_id] [dotlrn_community::get_community_name $community_id]] } + return [raw_navbar [concat $first_args $args]] + } + + ad_proc -public raw_navbar { + list_of_args + } { + do the raw navbar thing (both for admin and such) + } { + set args $list_of_args + set list_of_links [list] + set total_n_args [llength $args] + set count 0 + foreach arg $args { - if {[llength $arg] == 2} { + incr count + if {[llength $arg] == 2 && $count < $total_n_args} { lappend list_of_links "[lindex $arg 1]" } else { lappend list_of_links "$arg"