--- loncom/interface/lonmenu.pm 2009/08/13 13:52:01 1.244.2.3 +++ loncom/interface/lonmenu.pm 2009/08/14 12:21:32 1.244.2.5 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.244.2.3 2009/08/13 13:52:01 raeburn Exp $ +# $Id: lonmenu.pm,v 1.244.2.5 2009/08/14 12:21:32 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -647,6 +647,13 @@ if(length($annotation) > 0){ $menuitems.="&anno-[_1]&tations[_1]&annotate()&"; $menuitems.="Make notes and annotations about this resource&&1\n"; + unless ($noremote) { + my $showreqcrs = &check_for_rcrs(); + if ($showreqcrs) { + $menuitems.="s&8&1&rcrs.gif&request[_1]&course[_16]". + "&go('/adm/requestcourse')&Course requests\n"; + } + } unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) { if (!$env{'request.enc'}) { $menuitems.=(<'."\n". - '// '."\n" + '// ]]>'."\n". ''; } my $menuname = &get_menu_name(); @@ -1315,16 +1322,14 @@ sub rawconfig { $output.=&clear($row,$col); next; } - } elsif ($prt eq 'reqcrs') { - my $showreqcrs = 0; - foreach my $type ('official','unofficial') { - if (&Apache::lonnet::usertools_access($env{'user.name'}, - $env{'user.domain'}, - $type,undef,'requestcourses')) { - $showreqcrs = 1; - last; - } + } elsif (($prt eq 'reqcrsnsc') || ($prt eq 'reqcrsshc')) { + if (($prt eq 'reqcrsnsc') && ($show_course)) { + next; + } + if (($prt eq 'reqcrsshc') && (!$show_course)) { + next; } + my $showreqcrs = &check_for_rcrs(); if (!$showreqcrs) { $output.=&clear($row,$col); next; @@ -1347,6 +1352,19 @@ sub rawconfig { return $output; } +sub check_for_rcrs { + my $showreqcrs = 0; + foreach my $type ('official','unofficial','community') { + if (&Apache::lonnet::usertools_access($env{'user.name'}, + $env{'user.domain'}, + $type,undef,'requestcourses')) { + $showreqcrs = 1; + last; + } + } + return $showreqcrs; +} + # ======================================================================= Close sub close {