[LON-CAPA-cvs] cvs: loncom(version_2_10_X) /interface loncommon.pm lonmenu.pm lonnavdisplay.pm

raeburn raeburn@source.lon-capa.org
Thu, 30 Dec 2010 21:36:50 -0000


raeburn		Thu Dec 30 21:36:50 2010 EDT

  Modified files:              (Branch: version_2_10_X)
    /loncom/interface	loncommon.pm lonmenu.pm lonnavdisplay.pm 
  Log:
  - Support for pop-up Course Contents window (remotenavmap) retained in 2.10.
  
  
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.948.2.18 loncom/interface/loncommon.pm:1.948.2.19
--- loncom/interface/loncommon.pm:1.948.2.18	Sat Dec 25 17:35:53 2010
+++ loncom/interface/loncommon.pm	Thu Dec 30 21:36:49 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # a pile of common routines
 #
-# $Id: loncommon.pm,v 1.948.2.18 2010/12/25 17:35:53 raeburn Exp $
+# $Id: loncommon.pm,v 1.948.2.19 2010/12/30 21:36:49 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4689,11 +4689,11 @@
     $role = '<span class="LC_nobreak">('.$role.')</span>' if $role;
     &get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['inhibitmenu']);
 
-    if ($env{'environment.remote'} eq 'off') {
+    if ($env{'environment.remote'} ne 'on') {
         # No Remote
         if ($no_nav_bar || $env{'form.inhibitmenu'} eq 'yes') { 
-            return $bodytag; 
-        } 
+            return $bodytag;
+        }
 
         if ($env{'request.state'} eq 'construct') { $forcereg=1; }
 
@@ -4711,6 +4711,10 @@
                 <em>$realm</em> $dc_info</div>|;
             return $bodytag;
         }
+        if (($env{'request.noversionuri'} =~ m{^/adm/navmaps}) &&
+             ($env{'environment.remotenavmap'} eq 'on')) {
+            return $bodytag;
+        }
 
         unless ($env{'request.symb'} =~ m/\.page___\d+___/) {
             $bodytag .= qq|<div id="LC_nav_bar">$name $role</div>|;
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.315.2.5 loncom/interface/lonmenu.pm:1.315.2.6
--- loncom/interface/lonmenu.pm:1.315.2.5	Sat Dec 25 00:32:05 2010
+++ loncom/interface/lonmenu.pm	Thu Dec 30 21:36:50 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines to control the menu
 #
-# $Id: lonmenu.pm,v 1.315.2.5 2010/12/25 00:32:05 raeburn Exp $
+# $Id: lonmenu.pm,v 1.315.2.6 2010/12/30 21:36:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -474,8 +474,12 @@
         my @crumbs;
         unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')
                 && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {
+            my $navhref = "javascript:gopost('/adm/navmaps','')";
+            if ($env{'environment.remotenavmap'} eq 'on') {
+                 $navhref = "javascript:gonav('/adm/navmaps');";
+            }
             @crumbs = ({text  => $contentstext,
-                        href  => "Javascript:gopost('/adm/navmaps','')"});
+                        href  => $navhref});
         }
         if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) { 
             push(@crumbs, {text  => '...',
@@ -1336,6 +1340,13 @@
         my ($row,$col,$pro,$prt,$img,$top,$bot,$act,$desc,$cat)=split(/\:/,$line);
         $prt=~s/\$uname/$uname/g;
         $prt=~s/\$udom/$udom/g;
+        if ($env{'environment.remotenavmap'} eq 'on') {
+             unless ($env{'environment.remote'} eq 'on') {
+                 if ($img eq 'nav.gif') {
+                     $act = "gonav('/adm/navmaps','')";
+                 }
+             }
+        }
         if ($prt =~ /\$crs/) {
             next unless ($env{'request.course.id'});
             next if ($crstype eq 'Community');
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.13.4.3 loncom/interface/lonnavdisplay.pm:1.13.4.4
--- loncom/interface/lonnavdisplay.pm:1.13.4.3	Sat Aug 14 21:42:59 2010
+++ loncom/interface/lonnavdisplay.pm	Thu Dec 30 21:36:50 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavdisplay.pm,v 1.13.4.3 2010/08/14 21:42:59 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.13.4.4 2010/12/30 21:36:50 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -165,13 +165,21 @@
     }
     if ($env{'form.register'}) {
         $args = {'force_register' => $env{'form.register'}};
+        if ($body_only && $env{'environment.remote'} eq 'on') {
+            $args->{only_body} = 1;
+        }
         $start_page = &Apache::loncommon::start_page($title,$js,$args);
     } else {
         my $brcrum = [{href => '/adm/navmaps',
                        text => $breadcrumb_text,
                        no_mt => 1},
                      ];
-        $args = {'bread_crumbs' => $brcrum};
+        unless ($env{'environment.remotenavmap'} eq 'on') {
+            $args = {'bread_crumbs' => $brcrum};
+        }
+        if ($body_only && $env{'environment.remote'} eq 'on') {
+            $args->{only_body} = 1;
+        }
         $start_page = &Apache::loncommon::start_page($title,$js,$args);
     }
     $r->print($start_page.