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

raeburn raeburn@source.lon-capa.org
Fri, 15 Jan 2010 04:12:54 -0000


raeburn		Fri Jan 15 04:12:54 2010 EDT

  Modified files:              (Branch: GCI_3)
    /loncom/interface	lonmenu.pm lonmainmenu.pm 
  Log:
  - Customization for GCI_3.
    - Custom menu when current user has no roles, i.e., is a user who has
      created an account but has yet to be approved for enrollment in the
      GCI Inventory course.
    - Table of pending enrollment requests displayed.
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.309.2.11 loncom/interface/lonmenu.pm:1.309.2.12
--- loncom/interface/lonmenu.pm:1.309.2.11	Fri Jan 15 04:05:21 2010
+++ loncom/interface/lonmenu.pm	Fri Jan 15 04:12:54 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.309.2.11 2010/01/15 04:05:21 raeburn Exp $
+# $Id: lonmenu.pm,v 1.309.2.12 2010/01/15 04:12:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -131,6 +131,7 @@
 use Apache::loncommon();
 use Apache::lonenc();
 use Apache::lonlocal;
+use Apache::loncoursequeueadmin;
 use LONCAPA qw(:DEFAULT :match);
 use HTML::Entities();
 
@@ -1380,7 +1381,8 @@
     undef(@inlineremote);
     undef(%category_members);
     my $output;
-    if (($context eq 'gcicustom') || ($context eq 'gcistudent')) {
+    if (($context eq 'gcicustom') || ($context eq 'gcistudent') ||
+        ($context eq 'gcinorole')) {
         $output='<table><tr>'.
                 '<td class="LC_mainmenu_col_fieldset">'.
                 '<div class="LC_Box LC_400Box">'.
@@ -1419,6 +1421,16 @@
         } else {
             $output.='</td></tr></table></div></td>';
         }
+        if ($context eq 'gcinorole') {
+            my $queued =  &Apache::loncoursequeueadmin::queued_selfenrollment('notitle');
+            if ($queued) {
+                $output .= '<td class="LC_mainmenu_col_fieldset">'.
+                           '<div class="LC_Box LC_400Box">'.
+                           '<h3 class="LC_hcell">'.&mt('Pending Enrollment Requests').'</h3>'.
+                           $queued.
+                           '</td></tr></table></div></td>';
+            }
+        }
         $output.='</tr></table>';
     } else {
         # calling rawconfig with "1" will evaluate mydesk.tab, 
Index: loncom/interface/lonmainmenu.pm
diff -u loncom/interface/lonmainmenu.pm:1.8.4.6 loncom/interface/lonmainmenu.pm:1.8.4.7
--- loncom/interface/lonmainmenu.pm:1.8.4.6	Tue Jan  5 15:27:31 2010
+++ loncom/interface/lonmainmenu.pm	Fri Jan 15 04:12:54 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the main menu
 #
-# $Id: lonmainmenu.pm,v 1.8.4.6 2010/01/05 15:27:31 raeburn Exp $
+# $Id: lonmainmenu.pm,v 1.8.4.7 2010/01/15 04:12:54 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -103,10 +103,19 @@
     $r->print(&Apache::loncommon::start_page( 'Main Menu',
                                               $script_tag,
                                               {'bread_crumbs' => 1}));
+    my $rolecount = 0;
+    unless (($custommenu) || ($env{'user.domain'} eq 'gcitest')) {
+       foreach my $envkey (keys(%env)) {
+          next unless ($envkey =~ /^user\.role\./);
+          $rolecount ++;
+       }
+    }
     if ($custommenu) {
         $r->print(&Apache::lonmenu::inlinemenu('gcicustom',$switcher).$form);
     } elsif ($env{'user.domain'} eq 'gcitest') {
         $r->print(&Apache::lonmenu::inlinemenu('gcistudent',$switcher).$form);
+    } elsif (!$rolecount) {
+        $r->print(&Apache::lonmenu::inlinemenu('gcinorole').$form);
     } else {
         $r->print(&Apache::lonmenu::inlinemenu().$form);
     }