# $Id: theme-ges-lrn-master.tcl.txt,v 1.1 2016/11/01 09:08:33 gustafn Exp $ set user_id [ad_get_user_id] set community_id [dotlrn_community::get_community_id] set dotlrn_url [dotlrn::get_url] # Verifying if the user is external # set type_user [theme_ges::get_user_type -user_id $user_id] set extra_spaces "" set td_align "align=\"center\" valign=\"top\"" set path "comun" set cla_com_gru_is_selected 0 set c_panel_is_selected 0 set untrusted_user_id [ad_conn untrusted_user_id] set type_user $untrusted_user_id if {[dotlrn::user_p -user_id $user_id]} { set portal_id [dotlrn::get_portal_id -user_id $user_id] } if {![empty_string_p $community_id]} { set have_comm_id_p 1 } else { set have_comm_id_p 0 } if {[exists_and_not_null portal_id]} { set have_portal_id_p 1 } else { set have_portal_id_p 0 } # Verifying if the user is admin, if the user is admin then it shows # the admin tab. set sw_admin_p [acs_user::site_wide_admin_p -user_id $user_id] # navbar vars set show_navbar_p 1 if {[exists_and_not_null no_navbar_p] && $no_navbar_p} { set show_navbar_p 0 } if {![info exists link_all]} { set link_all 0 } if {![info exists return_url]} { set link [ad_conn -get extra_url] } else { set link $return_url } if {![info exists link_control_panel]} { set link_control_panel 1 } if { ![string equal [ad_conn package_key] [dotlrn::package_key]] } { # Peter M: We are in a package (an application) that may or may not be under a dotlrn instance # (i.e. in a news instance of a class) # and we want all links in the navbar to be active so the user can return easily to the class homepage # or to the My Space page set link_all 1 } if {$have_comm_id_p} { # in a community or just under one in a mounted package like /calendar # get this comm's info set control_panel_text "Administer" set portal_id [dotlrn_community::get_portal_id -community_id $community_id] set text [dotlrn_community::get_community_header_name $community_id] set link [dotlrn_community::get_community_url $community_id] set admin_p [dotlrn::user_can_admin_community_p -user_id $user_id -community_id $community_id] if {[empty_string_p $portal_id] && !$admin_p } { # not a member yet set portal_id [dotlrn_community::get_non_member_portal_id -community_id $community_id] } if { $have_portal_id_p && $show_navbar_p } { set make_navbar_p 1 } else { set make_navbar_p 0 set portal_id "" } } elseif {[parameter::get -parameter community_type_level_p] == 1} { set control_panel_text "Administer" set extra_td_html "" set link_all 1 set link [dotlrn::get_url] # in a community type set text \ [dotlrn_community::get_community_type_name [dotlrn_community::get_community_type]] if {$have_portal_id_p && $show_navbar_p} { set make_navbar_p 1 } else { set make_navbar_p 0 set portal_id "" } } else { # we could be anywhere (maybe under /dotlrn, maybe not) set control_panel_text "My Account" set link "[dotlrn::get_url]/" set community_id "" set text "" set make_navbar_p 1 if {$have_portal_id_p && $show_navbar_p} { } else { set make_navbar_p 0 set portal_id "" } } # Set up some basic stuff set user_id [ad_get_user_id] if { [ad_conn untrusted_user_id] == 0 } { set user_name {} } else { set user_name [acs_user::get_element -user_id [ad_conn untrusted_user_id] -element name] } if {![exists_and_not_null title]} { set title [ad_system_name] } if {[empty_string_p [dotlrn_community::get_parent_community_id -package_id [ad_conn package_id]]]} { set parent_comm_p 0 } else { set parent_comm_p 1 } set community_id [dotlrn_community::get_community_id] set control_panel_text [_ "dotlrn.control_panel"] if { $make_navbar_p } { set link_control_panel 0 set extra_spaces "" set subnavbar [theme_ges::portal_subnavbar \ -user_id $user_id \ -link_control_panel $link_control_panel \ -control_panel_text $control_panel_text \ -pre_html "$extra_spaces" \ -post_html $extra_spaces \ -link_all $link_all ] # If you wish add more tabs please it checks the navbar function set navbar [theme_ges::portal_navbar] # ------------ Start menu (Navbar) ------------ # Getting the tabs for the main meu set tab_space [lindex [lindex $navbar 0] 0] set tab_history [lindex [lindex $navbar 1] 0] set tab_community [lindex [lindex $navbar 2] 0] set tab_panel [lindex [lindex $navbar 3] 0] # We declare some vars for the tabs. set hist_clases_is_selected 0 set inicio_is_selected 0 set comunidad_is_selected 0 set c_panel_is_selected 0 set dotlrn_admin_is_selected 0 set cla_com_gru_is_selected 0 set current_url [ad_conn url] if {[string equal $current_url "/dotlrn/"]} { set inicio_is_selected 1 set path "comun" } elseif {[string equal $current_url "/dotlrn/courses"]} { set hist_clases_is_selected 1 set path "comun" } elseif {[string equal $current_url "/dotlrn/clubs/one-community-type"]} { set comunidad_is_selected 1 set path "comun" } elseif {[string equal $current_url "/dotlrn/control-panel"]} { set c_panel_is_selected 1 set path "comun" } elseif {[string equal $current_url "/dotlrn/admin/"] && [string equal $sw_admin_p "1"]} { set dotlrn_admin_is_selected 1 set path "comun" } elseif { [exists_and_not_null community_id] } { set cla_com_gru_is_selected 1 set type [dotlrn_community::get_community_type_from_community_id $community_id] if { $type eq "dotlrn_community" || $type eq "dotlrn_pers_community" } { set path "grupo" set url_image "/resources/theme-ges/theme-ges/images/icSubgrup.png" set community_message_key "Grupo" set url_class [dotlrn_community::get_community_url $community_id] } elseif { $type eq "dotlrn_club" } { set url_image "/resources/theme-ges/theme-ges/images/icSubcom.png" set community_message_key "Comunidad" set path "comunidad" set url_class [dotlrn_community::get_community_url $community_id] } else { set url_image "/resources/theme-ges/theme-ges/images/icClase.png" set community_message_key "Clase" set path "clase" set url_class [dotlrn_community::get_community_url $community_id] } } else { set path "comun" } # ------------ End Menu (Navbar) ------------ # ------------ Start Sub-Menu (suvnavbar) ------------ set urls "" set length [llength $subnavbar] for {set x 0} {$x<$length} {incr x} { set url [lindex [lindex $subnavbar $x] 0] append urls "