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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 13 Aug 2004 20:12:11 -0000


albertel		Fri Aug 13 16:12:11 2004 EDT

  Modified files:              
    /loncom/interface	mydesk.tab lonnavmaps.pm lonmenu.pm 
    /loncom/html/res/adm/pages	menu.html 
  Log:
  - BUG3231, now the nav link in remote remote mode should recreate the remote nav window 
  
  
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.55 loncom/interface/mydesk.tab:1.56
--- loncom/interface/mydesk.tab:1.55	Tue Jan 20 15:18:43 2004
+++ loncom/interface/mydesk.tab	Fri Aug 13 16:12:11 2004
@@ -21,7 +21,7 @@
 1:2:pmdc:$crs:docs.gif:edit crs[_1]:docs[_2]:go('/adm/coursedocs');:Edit and view documents included in this course
 2:1:clear
 2:2:clear
-2:2:course:any:nav.gif:navigate[_1]:contents[_1]:gopost('/adm/navmaps',currentURL);:Navigate the table of contents for this course
+2:2:course:any:nav.gif:navigate[_1]:contents[_1]:gonav('/adm/navmaps');:Navigate the table of contents for this course
 2:3:clear
 3:1:clear
 4:1:clear
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.274 loncom/interface/lonnavmaps.pm:1.275
--- loncom/interface/lonnavmaps.pm:1.274	Tue Aug 10 16:52:03 2004
+++ loncom/interface/lonnavmaps.pm	Fri Aug 13 16:12:11 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.274 2004/08/10 20:52:03 matthew Exp $
+# $Id: lonnavmaps.pm,v 1.275 2004/08/13 20:12:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -164,13 +164,24 @@
     if ($ENV{QUERY_STRING} eq 'collapseExternal') {
 	&Apache::lonnet::put('environment',{'remotenavmap' => 'off'});
 	&Apache::lonnet::appenv('environment.remotenavmap' => 'off');
+	my $menu=&Apache::lonmenu::reopenmenu();
+	my $navstatus=&Apache::lonmenu::get_nav_status();
+	if ($menu) {
+	    $menu=(<<MENU)
+             swmenu=$menu
+             swmenu.clearTimeout(swmenu.menucltim);
+	     $navstatus
+MENU
+	}
 	$r->print(<<"ENDSUBM");
 	<html>
         <head>
 	  <script type="text/javascript">
  	    function submitthis() {
+		    $menu
 		    self.close();
 	    }
+	
   	  </script>
         </head>
 	<body bgcolor="#FFFFFF" onLoad="submitthis()"></body>
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.112 loncom/interface/lonmenu.pm:1.113
--- loncom/interface/lonmenu.pm:1.112	Tue Aug 10 14:05:12 2004
+++ loncom/interface/lonmenu.pm	Fri Aug 13 16:12:11 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.112 2004/08/10 18:05:12 albertel Exp $
+# $Id: lonmenu.pm,v 1.113 2004/08/13 20:12:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -420,6 +420,7 @@
         } else {
 	    my $requri=(split(/\?/,$ENV{'request.noversionuri'}))[0];
 	    $requri=&Apache::lonnet::unescape($requri);
+	    my $navstatus=&get_nav_status();
 	    $result = (<<ENDREGTHIS);
      
 <script language="JavaScript">
@@ -437,6 +438,7 @@
           swmenu.currentSymb="$ENV{'request.symb'}";
           swmenu.reloadSymb="$ENV{'request.symb'}";
           swmenu.currentStale=0;
+	  $navstatus
           $hwkadd
           $editbutton
     }
@@ -929,6 +931,17 @@
 </form>
 ENDSERVERFORM
 }
+
+sub get_nav_status {
+    my $navstatus="swmenu.w_loncapanav_flag=";
+    if ($ENV{'environment.remotenavmap'} eq 'on') {
+	$navstatus.="1";
+    } else {
+	$navstatus.="-1";
+    }
+    return $navstatus;
+}
+
 # ================================================ Handler when called directly
 
 
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.111 loncom/html/res/adm/pages/menu.html:1.112
--- loncom/html/res/adm/pages/menu.html:1.111	Sun Nov  9 19:39:28 2003
+++ loncom/html/res/adm/pages/menu.html	Fri Aug 13 16:12:11 2004
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.111 2003/11/10 00:39:28 www Exp $
+// $Id: menu.html,v 1.112 2004/08/13 20:12:11 albertel Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -61,7 +61,6 @@
 var reloadSymb='';
 var currentStale=1;
 var menucltim;
-
 var clockdelta=0;
 
 var w_extdisp_flag=-1;
@@ -81,6 +80,7 @@
 var w_BookmarkPal_flag=-1;
 var w_LONcatInfo_flag=-1;
 var w_LONchat_flag=-1;
+var w_loncapanav_flag=-1;
  // 1 means currently open
  // 0 means closed (but has been open)
  // -1 means never yet opened/defined
@@ -103,6 +103,7 @@
 
 var clienthost=window.location.host;
 var clientwindow=opener;
+var navwindow;
 
 function syncclock(servertime) {
     var clientclock=new Date;
@@ -150,6 +151,13 @@
    extenddispclose();
 }
 
+function navwindowcheck() {
+   if (navwindow==null || navwindow.closed) {
+      navwindow=window.open("http://"+clienthost+"/adm/navmaps#curloc",
+                  "loncapanav","height=600,width=400,scrollbars=1"); 
+   }
+}
+
 function collapse() {
    if (autologout) {
        go('/adm/remote?action=collapse');
@@ -251,6 +259,25 @@
    }
 }
 
+function gonav(url) {
+   if (w_loncapanav_flag != 1) {
+      go(url);
+   }  else {
+      navwindowcheck();
+      statuslocked=0;
+      this.document['led'].src="http://"+clienthost+imgpath+"ledsend.gif";
+      if (url!='' && url!= null) {
+         this.document.server.action="http://"+clienthost+url;
+         this.document.server.target="loncapanav";
+         this.document.server.postdata.value='';
+         this.document.server.command.value='';
+         this.document.server.url.value='';
+         this.document.server.postsymb.value='';
+         this.document.server.submit();
+      }
+   }
+}
+
 function gopost(url,postdata,makenewwin) {
    windowcheck();
    statuslocked=0;
@@ -268,8 +295,8 @@
       this.document.server.command.value='';
       this.document.server.url.value='';
       this.document.server.postsymb.value='';
-      this.document.server.submit();
       this.document.server.target='loncapaclient';
+      this.document.server.submit();
    }
 }