--- loncom/interface/lonmenu.pm 2010/10/07 15:39:27 1.309.2.17 +++ loncom/interface/lonmenu.pm 2010/12/02 13:07:08 1.309.2.20 @@ -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.20 2010/12/02 13:07:08 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 @@ -197,7 +204,18 @@ sub primary_menu { if ($$menuitem[3] eq 'Help') { # special treatment for helplink - $menu .= '