--- loncom/interface/lonmenu.pm 2010/03/03 21:33:15 1.315 +++ loncom/interface/lonmenu.pm 2010/05/26 19:50:46 1.315.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.315 2010/03/03 21:33:15 droeschl Exp $ +# $Id: lonmenu.pm,v 1.315.2.1 2010/05/26 19:50:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -220,6 +220,11 @@ sub primary_menu { my $menu; # 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'; # @@ -227,18 +232,18 @@ sub primary_menu { && &Apache::lonmsg::mynewmail(); # whether a new msg 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 - 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 + next if $$menuitem[4] !~ /public/ ##we've a public user, + && $public; ##who should not see all + ##links + next if $$menuitem[4] eq 'onlypublic'# hide links which are + && !$public; # only visible to public + # users next if $$menuitem[4] eq 'roles' ##show links depending on - && &Apache::loncommon::show_course(); ##term 'Courses' or + && &Apache::loncommon::show_course(); ##term 'Courses' or next if $$menuitem[4] eq 'courses' ##'Roles' wanted && !&Apache::loncommon::show_course(); ## - - + + if ($$menuitem[3] eq 'Help') { # special treatment for helplink $menu .= '
  • '.&Apache::loncommon::top_nav_help('Help').'
  • '; } else { @@ -336,6 +341,11 @@ sub secondary_menu { } sub show_return_link { + if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)}) + || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) { + + return if ($env{'form.register'}); + } return (($env{'request.noversionuri'}=~m{^/(res|public)/} && $env{'request.symb'} eq '') || @@ -344,7 +354,7 @@ sub show_return_link { (($env{'request.noversionuri'}=~/^\/adm\//) && ($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) && ($env{'request.noversionuri'}!~ - m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)]) + m[^/adm/.*/(smppg|bulletinboard)($|\?)]) )); } @@ -417,9 +427,12 @@ sub innerregister { } else { $contentstext = &mt('Course Contents'); } - my @crumbs = ({text => $contentstext, - href => "Javascript:gonav('/adm/navmaps')"}); - + my @crumbs; + unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps') + && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) { + @crumbs = ({text => $contentstext, + href => "Javascript:gopost('/adm/navmaps','')"}); + } if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { push(@crumbs, {text => '...', no_mt => 1}); @@ -663,7 +676,7 @@ $menuitems.="Make notes and annotations "&go('/adm/requestcourse')&Course requests\n"; } } - unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { + unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|viewclasslist|portfolio)(\?|$)/) { if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) { $menuitems.=(<