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

www www@source.lon-capa.org
Mon, 13 Jul 2009 08:24:21 -0000


www		Mon Jul 13 08:24:21 2009 EDT

  Modified files:              
    /loncom/interface	lonmainmenu.pm lonmenu.pm mydesk.tab 
  Log:
  Saving my work: lonmenu cleanup; more weird little menus should be controlled
  by mydesk.tab
  
  
Index: loncom/interface/lonmainmenu.pm
diff -u loncom/interface/lonmainmenu.pm:1.7 loncom/interface/lonmainmenu.pm:1.8
--- loncom/interface/lonmainmenu.pm:1.7	Wed May 27 16:54:57 2009
+++ loncom/interface/lonmainmenu.pm	Mon Jul 13 08:24:21 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # displays the main menu
 #
-# $Id: lonmainmenu.pm,v 1.7 2009/05/27 16:54:57 www Exp $
+# $Id: lonmainmenu.pm,v 1.8 2009/07/13 08:24:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -66,6 +66,8 @@
 ENDSCRIPT
     }
 # ---- Print the screen, pretend to be in text mode to generate text-based menu
+# temporarily set interface to "faketextual" and remote to "off", which renders
+# the main menu
     $env{'browser.interface'}='faketextual';
     $env{'environment.remote'}='off';
 
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.274 loncom/interface/lonmenu.pm:1.275
--- loncom/interface/lonmenu.pm:1.274	Sat Jul 11 19:58:29 2009
+++ loncom/interface/lonmenu.pm	Mon Jul 13 08:24:21 2009
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.274 2009/07/11 19:58:29 www Exp $
+# $Id: lonmenu.pm,v 1.275 2009/07/13 08:24:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -997,6 +997,7 @@
 sub clear {
     my ($row,$col)=@_;
     unless ($env{'environment.remote'} eq 'off') {
+       if (($row<1) || ($row>13)) { return ''; }
        return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
    } else { 
        $inlineremote[10*$row+$col]='';
@@ -1022,6 +1023,7 @@
     $category_members{$cat}.=':'.$idx;
 
     unless ($env{'environment.remote'} eq 'off') {
+       if (($row<1) || ($row>13)) { return ''; }
 # Remote
        return "\n".
  qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
@@ -1095,6 +1097,7 @@
 sub inlinemenu {
     undef(@inlineremote);
     undef(%category_members);
+# calling rawconfig with "1" will evaluate mydesk.tab, even if there is no active remote control
     &rawconfig(1);
     my $output='<table id="LC_mainmenu"><tr>';
     for (my $col=1; $col<=2; $col++) {
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.108 loncom/interface/mydesk.tab:1.109
--- loncom/interface/mydesk.tab:1.108	Mon Jun  8 09:14:07 2009
+++ loncom/interface/mydesk.tab	Mon Jul 13 08:24:21 2009
@@ -1,5 +1,6 @@
 # Categories
 # cat:column,row:title
+cat:0,0:none:No category, inline menu
 cat:1,2:com:Communication
 cat:1,3:set:My Space
 cat:2,1:umn:User Management
@@ -23,7 +24,7 @@
 # bot-> txt for the bottom row of the remote
 # act-> javascrtip to excute when clicked
 # txt-> text to display in the extended remote or inline remote
-# cat-> category that this belongs into
+# cat-> category that this belongs into (or "none" if in top menus)
 #
 # pro = clear    clear the button
 # pro = any      any permission level is allowed this button
@@ -38,8 +39,29 @@
 # course_p???    allowed if in course and have permissions
 # courseenv_????   allowed if in course and course environment key exists
 # author         allowed if an author
-# tools          allowed if user has access to particular user tool (= prt) 
-#
+# tools          allowed if user has access to particular user tool (= prt)
+# editpriv       allowed if user has edit privileges for the current resource 
+# retlink        there is a valid location to return to
+
+# 0 is very top menu line
+
+0:1:any:any::::go('/adm/communicate');:Messages:none
+0:2:shc:any::::go('/adm/roles');:Courses:none
+0:2:shc:rst::::go('/adm/roles');:Courses:none
+0:2:nsc:any::::go('/adm/roles');:Roles:none
+0:2:nsc:rcm::::go('/adm/roles');:Roles:none
+0:3:any:any::::helpMenu('display');:Help:none
+0:4:any:any::::go('/adm/logout');:Logout:none
+
+# 15 is primary inline menu
+
+15:1:any:any::::go('/adm/menu');:Main Menu:none
+
+# 16 is secondary inline menu
+
+
+# 0<n<15 is remote and main menu
+
 1:1:shc:any:courses.gif:choose[_1]:course[_1]:go('/adm/roles');:Choose the course to work on:rcr
 1:1:shc:rst:courses.gif:switch[_1]:course[_2]:go('/adm/roles');:Switch to another course:rcr
 1:1:nsc:any:roles.gif:switch[_2]:role[_1]:go('/adm/roles');:Switch to another user role:rol