--- loncom/interface/lonmenu.pm 2010/10/07 15:39:27 1.309.2.17 +++ loncom/interface/lonmenu.pm 2010/11/30 05:51:55 1.309.2.19 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.309.2.17 2010/10/07 15:39:27 raeburn Exp $ +# $Id: lonmenu.pm,v 1.309.2.19 2010/11/30 05:51:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -165,8 +165,14 @@ sub prep_menuitem { sub primary_menu { my $menu; my $custommenu = &Apache::loncommon::needs_gci_custom(); + my $numdc = &Apache::loncommon::check_for_gci_dc(); # each element of @primary contains following array: # (link url, icon path, alt text, link text, condition) + my $public; + if ((($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) + || (($env{'user.name'} eq '') && ($env{'user.domain'} eq ''))) { + $public = 1; + } foreach my $menuitem (@primary_menu) { # evaluate conditions next if ref($menuitem) ne 'ARRAY'; # @@ -175,15 +181,16 @@ sub primary_menu { next if $$menuitem[4] eq 'newmsg' # arrived or not && !&Apache::lonmsg::mynewmail(); # next if $$menuitem[4] !~ /public/ ##we've a public user, - && $env{'user.name'} eq 'public' ##who should not see all - && $env{'user.domain'} eq 'public'; ##links + && $public; ##who should not see all + ##links next if $$menuitem[4] eq 'onlypublic'# hide links which are - && $env{'user.name'} ne 'public' # only visible to public - && $env{'user.domain'} ne 'public'; # users + && !$public; # only visible to public + # users next if $$menuitem[4] eq 'gci' && (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/}); next if $$menuitem[4] eq 'home' - && (($custommenu) || ($env{'user.domain'} eq 'gcitest')); + && (($custommenu) || ($env{'user.domain'} eq 'gcitest') || + (($env{'user.domain'} eq 'gci') && !$numdc)); next if $$menuitem[4] eq 'gcitest' && (($env{'user.domain'} eq 'gci') || ($env{'request.role'} eq 'cm')); next if $$menuitem[4] eq 'roles' # hide links which are @@ -321,7 +328,11 @@ sub gci_secondary_menu { foreach my $key (keys(%courses)) { $links{$key} = "javascript:switchpage('$key');"; if ($env{'request.course.id'} eq $courses{$key}) { - $links{$key} = '/adm/navmaps'; + if ($env{'environment.remotenavmap'} eq 'on') { + $links{$key} = "javascript:gonav('/adm/navmaps')"; + } else { + $links{$key} = '/adm/navmaps'; + } $current = $key; $links{'managetest'} = '/adm/roles?selectrole=1&cm=1&orgurl=%2fadm%2fmenu'; } @@ -330,10 +341,10 @@ sub gci_secondary_menu { my $tabs; foreach my $item (@menutabs) { if ($item eq $current) { - $tabs .= '