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

www lon-capa-cvs@mail.lon-capa.org
Tue, 12 Nov 2002 13:37:43 -0000


www		Tue Nov 12 08:37:43 2002 EDT

  Modified files:              
    /loncom/interface	lonmenu.pm 
  Log:
  Actually forward the description items from mydesk.tab to the Remote Control
  
  
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.26 loncom/interface/lonmenu.pm:1.27
--- loncom/interface/lonmenu.pm:1.26	Mon Aug 19 17:14:08 2002
+++ loncom/interface/lonmenu.pm	Tue Nov 12 08:37:43 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.26 2002/08/19 21:14:08 www Exp $
+# $Id: lonmenu.pm,v 1.27 2002/11/12 13:37:43 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -62,12 +62,12 @@
 # ============================================================ Switch Menu Item
 
 sub switchmenu {
-    my ($row,$col,$imgsrc,$texttop,$textbot,$action)=@_;
+    my ($row,$col,$imgsrc,$texttop,$textbot,$action,$description)=@_;
     my $openwin=&openmenu();
     return(<<ENDSMENU);
 <script>
    var swmenu=$openwin
-   swmenu.switchbutton($row,$col,"$imgsrc","$texttop","$textbot","$action");
+   swmenu.switchbutton($row,$col,"$imgsrc","$texttop","$textbot","$action","$description");
 </script>
 ENDSMENU
 }
@@ -82,22 +82,22 @@
 # Switch acts on the javascript that is executed when a button is clicked.  
 # The javascript is usually similar to "go('/adm/roles')" or "cstrgo(..)".
 sub switch {
-    my ($uname,$udom,$row,$col,$img,$top,$bot,$act)=@_;
+    my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc)=@_;
     $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;
     return "\n".
- qq(swmenu.switchbutton($row,$col,"$img","$top","$bot","$act"););
+ qq(swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
 }
 
 sub secondlevel {
     my $output='';
     my 
-    ($uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act)=@_;
+    ($uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc)=@_;
     if ($prt eq 'any') {
-	   $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act);
+	   $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
     } elsif ($prt=~/^r(\w+)/) {
         if ($rol eq $1) {
-           $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act);
+           $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
         }
     }
     return $output;
@@ -131,7 +131,7 @@
     my $rol=$ENV{'request.role'};
     my $requested_domain = $ENV{'request.role.domain'};
     foreach (@desklines) {
-        my ($row,$col,$pro,$prt,$img,$top,$bot,$act)=split(/\:/,$_);
+        my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc)=split(/\:/,$_);
         $prt=~s/\$uname/$uname/g;
         $prt=~s/\$udom/$udom/g;
         $prt=~s/\$crs/$crs/g; 
@@ -140,24 +140,24 @@
 	    $output.=&clear($row,$col);
         } elsif ($pro eq 'any') {
                $output.=&secondlevel(
-	  $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act);
+	  $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
 	} elsif ($pro eq 'smp') {
             unless ($adv) {
                $output.=&secondlevel(
-          $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act);
+          $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
             }
         } elsif ($pro eq 'adv') {
             if ($adv) {
                $output.=&secondlevel(
-	  $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act);
+	  $uname,$udom,$rol,$crs,$pub,$con,$row,$col,$prt,$img,$top,$bot,$act,$desc);
             }
         } elsif (($pro=~/p(\w+)/) && ($prt)) {
 	    if (&Apache::lonnet::allowed($1,$prt)) {
-               $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act);
+               $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
             }
         } elsif ($pro eq 'course') {
             if ($ENV{'request.course.fn'}) {
-               $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act);
+               $output.=switch($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc);
 	    }
         } elsif ($pro eq 'author') {
             if ($author) {
@@ -168,7 +168,7 @@
                     my $home = &Apache::lonnet::homeserver($caname,$cadom);
                     if ($home eq $r->dir_config('lonHostID')) {
                         $output.=switch($caname,$cadom,
-                                        $row,$col,$img,$top,$bot,$act);
+                                        $row,$col,$img,$top,$bot,$act,$desc);
                     }
                 } elsif ($prt eq 'any') {
                     my $home = &Apache::lonnet::homeserver
@@ -176,7 +176,7 @@
                     if ($home eq $r->dir_config('lonHostID')) {
                         $output.=switch
                             ($ENV{'user.name'},$ENV{'user.domain'},
-                             $row,$col,$img,$top,$bot,$act);
+                             $row,$col,$img,$top,$bot,$act,$desc);
                     }
                 }
             }