[LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html /interface lonmenu.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 03 Apr 2003 00:52:21 -0000


www		Wed Apr  2 19:52:21 2003 EDT

  Modified files:              
    /loncom/html/res/adm/pages	menu.html 
    /loncom/interface	lonmenu.pm 
  Log:
  Continued work on "inline" Remote
  
  
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.90 loncom/html/res/adm/pages/menu.html:1.91
--- loncom/html/res/adm/pages/menu.html:1.90	Wed Apr  2 16:23:04 2003
+++ loncom/html/res/adm/pages/menu.html	Wed Apr  2 19:52:21 2003
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.90 2003/04/02 21:23:04 www Exp $
+// $Id: menu.html,v 1.91 2003/04/03 00:52:21 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -36,7 +36,7 @@
 
 <body bgcolor="#BBBBBB" 
       background="remotebg.gif"
-      onUnload="go('/adm/remote?action=collapse')"
+      onUnload="collapse();"
       onLoad="activate();"
       >
 <font size="1">
@@ -149,6 +149,12 @@
    extenddispclose();
 }
 
+function collapse() {
+   if (autologout) {
+       go('/adm/remote?action=collapse');
+   }
+}
+ 
 function logout () {
    windowcheck();
 
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.48 loncom/interface/lonmenu.pm:1.49
--- loncom/interface/lonmenu.pm:1.48	Wed Apr  2 17:02:19 2003
+++ loncom/interface/lonmenu.pm	Wed Apr  2 19:52:21 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.48 2003/04/02 22:02:19 www Exp $
+# $Id: lonmenu.pm,v 1.49 2003/04/03 00:52:21 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -120,7 +120,11 @@
 
     $Apache::lonxml::registered=1;
 
-    my $textual=($ENV{'browser.interface'} eq 'textual');
+    my $textinter=($ENV{'browser.interface'} eq 'textual');
+    my $noremote=($ENV{'environment.remote'} eq 'off');
+    
+    my $textual=($textinter || $noremote);
+
     my $reopen=&Apache::lonmenu::reopenmenu();
 
     my $newmail='';
@@ -352,9 +356,13 @@
 
 sub startupremote {
     my ($lowerurl)=@_;
-    if ($ENV{'browser.interface'} eq 'textual') {
+    if (($ENV{'browser.interface'} eq 'textual') ||
+        ($ENV{'environment.remote'} eq 'off')) {
      return ('<meta HTTP-EQUIV="Refresh" CONTENT="0.5; url='.$lowerurl.'" />');
     }
+#
+# The Remote actually gets launched!
+#
     my $configmenu=&rawconfig();
     return(<<ENDREMOTESTARTUP);
 <script>
@@ -413,7 +421,8 @@
 }
 
 sub maincall() {
-    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
+    if (($ENV{'browser.interface'} eq 'textual') ||
+        ($ENV{'environment.remote'} eq 'off')) { return ''; }
     return(<<ENDMAINCALL);
 <script>
     main();
@@ -423,7 +432,8 @@
 # ================================================================= Reopen menu
 
 sub reopenmenu {
-   if ($ENV{'browser.interface'} eq 'textual') { return ''; }
+   if (($ENV{'browser.interface'} eq 'textual') ||
+       ($ENV{'environment.remote'} eq 'off')) { return ''; }
    my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
    my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
    return('window.open('.$nothing.',"'.$menuname.'","",false);');
@@ -433,7 +443,8 @@
 
 sub open {
     my $returnval='';
-    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
+    if (($ENV{'browser.interface'} eq 'textual') ||
+        ($ENV{'environment.remote'} eq 'off')) { return ''; }
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     unless (shift eq 'unix') {
 # resizing does not work on linux because of virtual desktop sizes
@@ -457,7 +468,8 @@
 
 sub clear {
     my ($row,$col)=@_;
-    unless ($ENV{'browser.interface'} eq 'textual') {
+    unless (($ENV{'browser.interface'} eq 'textual') ||
+            ($ENV{'environment.remote'} eq 'off')) {
        return "\n".qq(window.status+='.';swmenu.clearbut($row,$col););
    } else { return ''; }
 }
@@ -470,7 +482,8 @@
     my ($uname,$udom,$row,$col,$img,$top,$bot,$act,$desc,$nobreak)=@_;
     $act=~s/\$uname/$uname/g;
     $act=~s/\$udom/$udom/g;
-    unless ($ENV{'browser.interface'} eq 'textual') {
+    unless (($ENV{'browser.interface'} eq 'textual')  ||
+            ($ENV{'environment.remote'} eq 'off')) {
        return "\n".
  qq(window.status+='.';swmenu.switchbutton($row,$col,"$img","$top","$bot","$act","$desc"););
    } else {
@@ -499,7 +512,8 @@
 
 sub openmenu {
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
-    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
+    if (($ENV{'browser.interface'} eq 'textual') ||
+        ($ENV{'environment.remote'} eq 'off')) { return ''; }
     my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
     return "window.open(".$nothing.",'".$menuname."');";
 }
@@ -507,7 +521,8 @@
 sub rawconfig {
     my $textualoverride=shift;
     my $output='';
-    unless ($ENV{'browser.interface'} eq 'textual') {
+    unless (($ENV{'browser.interface'} eq 'textual') ||
+            ($ENV{'environment.remote'} eq 'off')) {
        $output.=
  "window.status='Opening Remote Control';var swmenu=".&openmenu().
 "\nwindow.status='Configuring Remote Control ';";
@@ -580,7 +595,8 @@
             }
         }
     }
-    unless ($ENV{'browser.interface'} eq 'textual') {
+    unless (($ENV{'browser.interface'} eq 'textual') ||
+            ($ENV{'environment.remote'} eq 'off')) {
        $output.="\nwindow.status='Synchronizing Time';swmenu.syncclock(1000*".time.");\nwindow.status='Remote Control Configured.';";
     }
     return $output;
@@ -589,7 +605,8 @@
 # ======================================================================= Close
 
 sub close {
-    if ($ENV{'browser.interface'} eq 'textual') { return ''; }
+    if (($ENV{'browser.interface'} eq 'textual') ||
+        ($ENV{'environment.remote'} eq 'off')) { return ''; }
     my $menuname='LCmenu'.$Apache::lonnet::perlvar{'lonHostID'};
     return(<<ENDCLOSE);
 <script>