--- loncom/interface/lonnavmaps.pm 2004/05/27 22:25:14 1.260
+++ loncom/interface/lonnavmaps.pm 2005/04/16 15:33:14 1.327
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.260 2004/05/27 22:25:14 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.327 2005/04/16 15:33:14 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -30,12 +30,16 @@
package Apache::lonnavmaps;
use strict;
+use GDBM_File;
use Apache::Constants qw(:common :http);
use Apache::loncommon();
use Apache::lonmenu();
+use Apache::lonenc();
use Apache::lonlocal;
+use Apache::lonnet;
use POSIX qw (floor strftime);
-use Data::Dumper; # for debugging, not always used
+use Data::Dumper; # for debugging, not always
+use Time::HiRes qw( gettimeofday tv_interval );
# symbolic constants
sub SYMB { return 1; }
@@ -83,6 +87,56 @@ my %colormap =
# is not yet done and due in less then 24 hours
my $hurryUpColor = "#FF0000";
+sub launch_win {
+ my ($mode,$script,$toplinkitems)=@_;
+ my $result;
+ if ($script ne 'no') {
+ $result.='';
+ }
+ if ($mode eq 'link') {
+ &add_linkitem($toplinkitems,'launchnav','launch_navmapwin()',
+ "Launch navigation window");
+ }
+ return $result;
+}
+
+sub close {
+ if ($env{'environment.remotenavmap'} ne 'on') { return ''; }
+ return(<
+window.status='Accessing Nav Control';
+menu=window.open("/adm/rat/empty.html","loncapanav",
+ "height=600,width=400,scrollbars=1");
+window.status='Closing Nav Control';
+menu.close();
+window.status='Done.';
+
+ENDCLOSE
+}
+
+sub update {
+ if ($env{'environment.remotenavmap'} ne 'on') { return ''; }
+ if (!$env{'request.course.id'}) { return ''; }
+ if ($ENV{'REQUEST_URI'}=~m|^/adm/navmaps|) { return ''; }
+ return(<
+
+ENDUPDATE
+}
+
sub handler {
my $r = shift;
real_handler($r);
@@ -90,10 +144,10 @@ sub handler {
sub real_handler {
my $r = shift;
-
+ #my $t0=[&gettimeofday()];
# Handle header-only request
if ($r->header_only) {
- if ($ENV{'browser.mathml'}) {
+ if ($env{'browser.mathml'}) {
&Apache::loncommon::content_type($r,'text/xml');
} else {
&Apache::loncommon::content_type($r,'text/html');
@@ -103,7 +157,7 @@ sub real_handler {
}
# Send header, don't cache this page
- if ($ENV{'browser.mathml'}) {
+ if ($env{'browser.mathml'}) {
&Apache::loncommon::content_type($r,'text/xml');
} else {
&Apache::loncommon::content_type($r,'text/html');
@@ -111,38 +165,98 @@ sub real_handler {
&Apache::loncommon::no_cache($r);
$r->send_http_header;
+ my %toplinkitems=();
+ &add_linkitem(\%toplinkitems,'blank','',"Select Action");
+ 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=(<