--- loncom/interface/lonmenu.pm 2009/05/20 20:11:35 1.244.2.1 +++ loncom/interface/lonmenu.pm 2009/08/20 06:04:14 1.244.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.244.2.1 2009/05/20 20:11:35 raeburn Exp $ +# $Id: lonmenu.pm,v 1.244.2.6 2009/08/20 06:04:14 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -351,8 +351,8 @@ ENDCRELOAD my $helplink=&Apache::loncommon::top_nav_help('Help'); return (< -// BEGIN LON-CAPA Internal // @@ -409,7 +409,9 @@ sub registerurl { &unescape($env{'request.noversionuri'})))) && (!$forcereg))) { return $result. - ''.$force_title; + ''.$force_title; } # Graphical display after login only if ($env{'request.registered'} && !$forcereg) { return ''; } @@ -645,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.=(< +// ENDREGTHIS } @@ -800,6 +811,7 @@ ENDDONOTREGTEXT $result = (< +// ENDDONOTREGTHIS } @@ -895,6 +908,7 @@ sub startupremote { my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited'); return(< +// ENDREMOTESTARTUP } @@ -952,8 +966,10 @@ ENDREMOTESTARTUP sub setflags() { return(< +// ENDSETFLAGS } @@ -963,7 +979,9 @@ sub maincall() { ($env{'environment.remote'} eq 'off')) { return ''; } return(< +// ENDMAINCALL } @@ -1008,7 +1026,12 @@ sub open { my $returnval=''; if (($env{'browser.interface'} eq 'textual') || ($env{'environment.remote'} eq 'off')) { - return ''; + return + ''; } my $menuname = &get_menu_name(); @@ -1021,11 +1044,13 @@ sub open { #} #ENDRESIZE # } - $returnval.=(< ENDOPEN return ''; } @@ -1168,7 +1193,6 @@ sub inlinemenu { } foreach my $item (sort(keys(%active))) { $output.=$inlineremote[$item]; - &Apache::lonnet::logthis("item=$item output=$inlineremote[$item]"); } $output.=''; $output.=''; @@ -1297,16 +1321,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; @@ -1329,6 +1351,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 { @@ -1337,6 +1372,7 @@ sub close { my $menuname = &get_menu_name(); return(< +// ENDCLOSE } @@ -1778,8 +1815,9 @@ sub jump_to_role { ' numsec['.$i.'] = "'.$seccount->{$items[$i]}.'";'."\n"; } } - my $output = <<"END"; + return <<"END"; END - return $output; }