--- loncom/interface/lonmenu.pm 2009/07/21 14:36:08 1.276 +++ loncom/interface/lonmenu.pm 2009/09/08 20:56:46 1.281 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.276 2009/07/21 14:36:08 droeschl Exp $ +# $Id: lonmenu.pm,v 1.281 2009/09/08 20:56:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -149,7 +149,7 @@ my @inlineremote; sub initlittle { return &Apache::lonlocal::texthash('ret' => 'Return to Last Location', - 'nav' => 'Navigate Contents', + 'nav' => 'Course Contents', 'main' => 'Main Menu', 'roles' => (&Apache::loncommon::show_course()? 'Courses':'Roles'), @@ -299,8 +299,8 @@ ENDCRELOAD my $helplink = &Apache::loncommon::top_nav_help('Help'); return (< -// BEGIN LON-CAPA Internal // @@ -357,8 +357,14 @@ sub registerurl { (!&Apache::lonnet::is_on_map( &unescape($env{'request.noversionuri'})))) && (!$forcereg))) { - return $result. - ''.$force_title; + return + $result + .'' + .$force_title; } # Graphical display after login only if ($env{'request.registered'} && !$forcereg) { return ''; } @@ -611,6 +617,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 } @@ -762,6 +777,7 @@ ENDDONOTREGTEXT $result = (< +// ENDDONOTREGTHIS } @@ -856,6 +873,7 @@ sub startupremote { my $message=&mt('"Waiting for Remote Control window to load: "+[_1]','waited'); return(< +// ENDREMOTESTARTUP } @@ -913,8 +932,10 @@ ENDREMOTESTARTUP sub setflags() { return(< +// ENDSETFLAGS } @@ -923,7 +944,9 @@ sub maincall() { if ($env{'environment.remote'} eq 'off') { return ''; } return(< +// ENDMAINCALL } @@ -965,7 +988,12 @@ sub reopenmenu { sub open { my $returnval=''; if ($env{'environment.remote'} eq 'off') { - return ''; + return + ''; } my $menuname = &get_menu_name(); @@ -978,11 +1006,13 @@ sub open { #} #ENDRESIZE # } - $returnval.=(< ENDOPEN return ''; } @@ -1248,16 +1278,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; @@ -1278,6 +1306,28 @@ sub rawconfig { return $output; } +sub check_for_rcrs { + my $showreqcrs = 0; + my @reqtypes = ('official','unofficial','community'); + foreach my $type (@reqtypes) { + if (&Apache::lonnet::usertools_access($env{'user.name'}, + $env{'user.domain'}, + $type,undef,'requestcourses')) { + $showreqcrs = 1; + last; + } + } + if (!$showreqcrs) { + foreach my $type (@reqtypes) { + if ($env{'environment.reqcrsotherdom.'.$type} ne '') { + $showreqcrs = 1; + last; + } + } + } + return $showreqcrs; +} + # ======================================================================= Close sub close { @@ -1285,6 +1335,7 @@ sub close { my $menuname = &get_menu_name(); return(< +// ENDCLOSE }