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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 08 May 2006 22:22:51 -0000


albertel		Mon May  8 18:22:51 2006 EDT

  Modified files:              
    /loncom/interface	lonpreferences.pm 
  Log:
  - adding a remote control toggel to the preferences screen
  
  
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.84 loncom/interface/lonpreferences.pm:1.85
--- loncom/interface/lonpreferences.pm:1.84	Mon May  8 14:50:27 2006
+++ loncom/interface/lonpreferences.pm	Mon May  8 18:22:48 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Preferences
 #
-# $Id: lonpreferences.pm,v 1.84 2006/05/08 18:50:27 albertel Exp $
+# $Id: lonpreferences.pm,v 1.85 2006/05/08 22:22:48 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1211,6 +1211,19 @@
                             text => 'Change Math Preferences'},
                       printmenu => 'yes',
                       }));
+
+    if ($env{'environment.remote'} eq 'off') {
+	push (@Options,({ action => 'launch',
+			  linktext => 'Launch Remote Control',
+			  href => '/adm/remote?url=/adm/preferences',
+		      }));
+    } else {
+	push (@Options,({ action => 'collapse',
+			  linktext => 'Collapse Remote Control',
+			  href => '/adm/remote?url=/adm/preferences',
+		      }));
+    }
+
     if (&Apache::lonnet::allowed('whn',$env{'request.course.id'})
 	|| &Apache::lonnet::allowed('whn',$env{'request.course.id'}.'/'
 				    .$env{'request.course.sec'})) {
@@ -1277,9 +1290,10 @@
         foreach my $option(@Options) {
             my $optiontext = '';
             if (exists($option->{'href'})) {
-                $optiontext .= 
-                    '<a href="'.$option->{'href'}.
-                    '?action='.$option->{'action'}.'">'.
+		$option->{'href_args'}{'action'}=$option->{'action'};
+		$optiontext .= 
+                    '<a href="'.&add_get_param($option->{'href'},
+					       $option->{'href_args'}).'">'.
                     &mt($option->{'linktext'}).'</a>';
             }
             if (exists($option->{'text'})) {