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

raeburn raeburn@source.lon-capa.org
Sun, 23 Aug 2009 13:22:16 -0000


raeburn		Sun Aug 23 13:22:16 2009 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	lonmenu.pm 
  Log:
  - Backport 1.280.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.244.2.6 loncom/interface/lonmenu.pm:1.244.2.7
--- loncom/interface/lonmenu.pm:1.244.2.6	Thu Aug 20 06:04:14 2009
+++ loncom/interface/lonmenu.pm	Sun Aug 23 13:22:16 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.244.2.6 2009/08/20 06:04:14 raeburn Exp $
+# $Id: lonmenu.pm,v 1.244.2.7 2009/08/23 13:22:16 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1353,7 +1353,8 @@
 
 sub check_for_rcrs {
     my $showreqcrs = 0;
-    foreach my $type ('official','unofficial','community') {
+    my @reqtypes = ('official','unofficial','community');
+    foreach my $type (@reqtypes) {
         if (&Apache::lonnet::usertools_access($env{'user.name'},
                                               $env{'user.domain'},
                                               $type,undef,'requestcourses')) {
@@ -1361,6 +1362,14 @@
             last;
         }
     }
+    if (!$showreqcrs) {
+        foreach my $type (@reqtypes) {
+            if ($env{'environment.reqcrsotherdom.'.$type} ne '') {
+                $showreqcrs = 1;
+                last;
+            }
+        }
+    }
     return $showreqcrs;
 }