[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /interface lonmenu.pm

raeburn raeburn@source.lon-capa.org
Thu, 13 Aug 2009 14:01:37 -0000


raeburn		Thu Aug 13 14:01:37 2009 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - Backport 1.278, 1.279.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.244.2.3 loncom/interface/lonmenu.pm:1.244.2.4
--- loncom/interface/lonmenu.pm:1.244.2.3	Thu Aug 13 13:52:01 2009
+++ loncom/interface/lonmenu.pm	Thu Aug 13 14:01:37 2009
@@ -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.4 2009/08/13 14:01:37 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -647,6 +647,13 @@
 $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.=(<<ENDREALRES);
@@ -1315,16 +1322,14 @@
                     $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 @@
     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 {