[LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm mydesk.tab

droeschl droeschl@source.lon-capa.org
Fri, 28 May 2010 13:21:13 -0000


droeschl		Fri May 28 13:21:13 2010 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm mydesk.tab 
  Log:
  - menu entries renamed according to 3.0 draft
      - [Course|Community] Contents -> Contents
  - menu entries added:
      - primary menu: Home
      - secondary menu: What's New, People, Settings
  - moved 'Return to Last Location' to the far right to keep links with a more static nature together. 
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.326 loncom/interface/lonmenu.pm:1.327
--- loncom/interface/lonmenu.pm:1.326	Mon Apr 19 09:22:14 2010
+++ loncom/interface/lonmenu.pm	Fri May 28 13:21:13 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.326 2010/04/19 09:22:14 bisitz Exp $
+# $Id: lonmenu.pm,v 1.327 2010/05/28 13:21:13 droeschl Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -230,15 +230,21 @@
     my $menu;
 
     my $crstype = &Apache::loncommon::course_type();
-    my $canedit = &Apache::lonnet::allowed('mdc', $env{'request.course.id'});
-    my $canviewgrps = &Apache::lonnet::allowed('vcg', $env{'request.course.id'}
-                   . ($env{'request.course.sec'} ? "/$env{'request.course.sec'}"
-                                                 : '')); 
+    my $crs_sec = $env{'request.course.id'} . ($env{'request.course.sec'} 
+                                               ? "/$env{'request.course.sec'}"
+                                               : '');
+    my $canedit       = &Apache::lonnet::allowed('mdc', $env{'request.course.id'});
+    my $canviewgrps   = &Apache::lonnet::allowed('vcg', $crs_sec); 
+    my $canmodifyuser = &Apache::lonnet::allowed('cst', $crs_sec); 
+    my $canviewwnew   = &Apache::lonnet::allowed('whn', $crs_sec); 
+    my $canmodpara    = &Apache::lonnet::allowed('opa', $crs_sec); 
+
     my $showlink = &show_return_link();
     my %groups = &Apache::lonnet::get_active_groups(
                      $env{'user.domain'}, $env{'user.name'},
                      $env{'course.' . $env{'request.course.id'} . '.domain'},
                      $env{'course.' . $env{'request.course.id'} . '.num'});
+
     foreach my $menuitem (@secondary_menu) {
         # evaluate conditions 
         next if    ref($menuitem)  ne 'ARRAY';
@@ -253,10 +259,12 @@
                 && $crstype eq 'Community';
         next if    $$menuitem[4]  eq 'mdcCommunity'
                 && $crstype ne 'Community';
-        next if    $$menuitem[4] =~ /^Course$/
-                && $crstype eq 'Community';
-        next if    $$menuitem[4] =~ /^Community$/
-                && $crstype ne 'Community';
+        next if    $$menuitem[4]   eq 'cst'
+                && !$canmodifyuser;
+        next if    $$menuitem[4]   eq 'whn'
+                && !$canviewwnew;
+        next if    $$menuitem[4]   eq 'opa'
+                && !$canmodpara;
         next if    $$menuitem[4]   =~ /showgroups$/
                 && !$canviewgrps
                 && !%groups;
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.133 loncom/interface/mydesk.tab:1.134
--- loncom/interface/mydesk.tab:1.133	Wed Apr 14 13:58:11 2010
+++ loncom/interface/mydesk.tab	Fri May 28 13:21:13 2010
@@ -16,6 +16,7 @@
 #   - courses: show Courses instead of Roles
 # prim:link:icon:alt:text:condition
 prim:/adm/about.html:/adm/lonIcons/minilogo.gif:LON-CAPA Logo:About:public
+prim:/adm/menu:::Home:
 prim:/adm/communicate:::Messages:nonewmsg
 prim:/adm/communicate:::New Messages:newmsg
 prim:/adm/preferences:::Preferences:
@@ -42,17 +43,19 @@
 #   - mdcCourse: user can modify course contents and course is a regular course
 #   - showgroups: user is member of a group
 #   - always: show this link even if user hasn't selected a role
-#   - Community: course is of type Community
-#   - Course: course is of type Course
+#   - whn: access what's new
+#   - cst: Grant/revoke role of Student:Grant/revoke role of Member 
+#   - opa: Set assessment parameters
 # prim:link:icon:alt:text:condition
-scnd:/adm/menu:::Main Menu:always
-scnd:/adm/flip?postdata=return%3a:::Return to Last Location:showreturn
-scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Course Contents:Course
-scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Community Contents:Community
+scnd:/adm/whatsnew:::What's New:whn
+scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Contents:
+scnd:/adm/createuser:::People:cst
+scnd:/adm/coursegroups:::Groups:showgroups
 scnd:/adm/coursedocs:::Course Editor:mdcCourse
 scnd:/adm/coursedocs:::Community Editor:mdcCommunity
-scnd:/adm/coursegroups:::Groups:showgroups
+scnd:/adm/courseprefs:::Settings:opa
 scnd:/adm/roles:::Roles:
+scnd:/adm/flip?postdata=return%3a:::Return to Last Location:showreturn
 
 
 # Categories for main menu