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

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 23 Aug 2004 21:05:04 -0000


albertel		Mon Aug 23 17:05:04 2004 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm lonmenu.pm 
    /loncom/html/res/adm/pages	menu.html 
  Log:
  - inline remote with external navmap works well now
  
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.277 loncom/interface/lonnavmaps.pm:1.278
--- loncom/interface/lonnavmaps.pm:1.277	Fri Aug 20 16:14:27 2004
+++ loncom/interface/lonnavmaps.pm	Mon Aug 23 17:05:03 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.277 2004/08/20 20:14:27 matthew Exp $
+# $Id: lonnavmaps.pm,v 1.278 2004/08/23 21:05:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -119,6 +119,23 @@
 ENDCLOSE
 }
 
+sub nav_control_js {
+    my $nav=($ENV{'environment.remotenavmap'} eq 'on');
+    return (<<NAVCONTROL);
+    var w_loncapanav_flag="$nav";
+
+
+function gonav(url) {
+   if (w_loncapanav_flag != 1) {
+      go(url);
+   }  else {
+      navwindow=window.open(url,
+                  "loncapanav","height=600,width=400,scrollbars=1"); 
+   }
+}
+NAVCONTROL
+}
+
 sub update {
     if ($ENV{'environment.remotenavmap'} ne 'on') { return ''; }
     if (!$ENV{'request.course.id'}) { return ''; }
@@ -211,6 +228,7 @@
 # ----------------------------------------------------- Force menu registration
     my $addentries='';
     my $more_unload;
+    my $body_only='';
     if ($ENV{'environment.remotenavmap'} eq 'on') {
 	$r->print('<script type="text/javascript">
                       function collapse() {
@@ -219,6 +237,7 @@
                    </script>');
 # FIXME need to be smarter to only catch window close events
 #	$more_unload="collapse()"
+	$body_only=1;
     }
     if ($ENV{'form.register'}) {
 	$addentries=' onLoad="'.&Apache::lonmenu::loadevents().
@@ -232,7 +251,8 @@
     # Header
     $r->print('</head>'.
               &Apache::loncommon::bodytag('Navigate Course Contents','',
-                                    $addentries,'','',$ENV{'form.register'}));
+					  $addentries,$body_only,'',
+					  $ENV{'form.register'}));
     $r->print('<script>window.focus();</script>'.
 	      &Apache::loncommon::help_open_menu('','Navigation Screen','Navigation_Screen','',undef,'RAT'));
      
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.113 loncom/interface/lonmenu.pm:1.114
--- loncom/interface/lonmenu.pm:1.113	Fri Aug 13 16:12:11 2004
+++ loncom/interface/lonmenu.pm	Mon Aug 23 17:05:03 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.113 2004/08/13 20:12:11 albertel Exp $
+# $Id: lonmenu.pm,v 1.114 2004/08/23 21:05:03 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -133,11 +133,15 @@
         my $sidebg=&Apache::loncommon::designparm($function.'.sidebg',$domain);
 # Do we have a NAV link?
         if ($ENV{'request.course.id'}) {
-	    $navmaps=(<<ENDNAVREM);
+	    my $navcontrol=&Apache::lonnavmaps::nav_control_js();
+	    $navmaps=(<<ENDNAV);
 <td bgcolor="$tabbg">
-<a href="/adm/navmaps?postdata=$escurl&postsymb=$escsymb" target="_top"><font color="$font">$lt{'nav'}</font></a></td>
-ENDNAVREM
-            if (($ENV{'request.noversionuri'}=~/^\/adm\//) &&
+<script type="text/javascript">
+$navcontrol
+</script>
+<a href="javascript:gonav('/adm/navmaps?postdata=$escurl&postsymb=$escsymb')"><font color="$font">$lt{'nav'}</font></a></td>
+ENDNAV
+	    if (($ENV{'request.noversionuri'}=~/^\/adm\//) &&
                 ($ENV{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
          ($ENV{'request.noversionuri'}!~/^\/adm\/.*\/(smppg|bulletinboard|aboutme)(\?|$)/)) {
                 my $escreload=&Apache::lonnet::escape('return:');
@@ -874,12 +878,15 @@
         ($ENV{'environment.remote'} eq 'off')) { return ''; }
     my $currenturl=$ENV{'request.noversionuri'};
     my $currentsymb=$ENV{'request.symb'};
+    my $nav_control=&Apache::lonnavmaps::nav_control_js();
 return (<<ENDUTILITY)
 
     var currentURL="$currenturl";
     var reloadURL="$currenturl";
     var currentSymb="$currentsymb";
 
+$nav_control
+
 function go(url) {
    if (url!='' && url!= null) {
        currentURL = null;
Index: loncom/html/res/adm/pages/menu.html
diff -u loncom/html/res/adm/pages/menu.html:1.113 loncom/html/res/adm/pages/menu.html:1.114
--- loncom/html/res/adm/pages/menu.html:1.113	Fri Aug 13 16:30:01 2004
+++ loncom/html/res/adm/pages/menu.html	Mon Aug 23 17:05:03 2004
@@ -4,7 +4,7 @@
 Remote Control
 
 //
-// $Id: menu.html,v 1.113 2004/08/13 20:30:01 albertel Exp $
+// $Id: menu.html,v 1.114 2004/08/23 21:05:03 albertel Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -484,6 +484,9 @@
 }
 //-->
 </script>
+<display>
+return '<script type="text/javascript">w_loncapanav_flag=\''.('on' eq &EXT('user.environment.remotenavmap')).'\';</script>';
+</display>
 </block>
 <block condition="&EXT('request.browser.textremote')">
 <script type="text/javascript">