--- loncom/interface/lonnavdisplay.pm 2010/03/10 21:25:50 1.14
+++ loncom/interface/lonnavdisplay.pm 2021/03/04 14:00:19 1.22.4.9.4.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
-# Navigate Maps Handler
+# Navigate Maps Display Handler
#
-# $Id: lonnavdisplay.pm,v 1.14 2010/03/10 21:25:50 droeschl Exp $
+# $Id: lonnavdisplay.pm,v 1.22.4.9.4.2 2021/03/04 14:00:19 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -30,14 +30,15 @@
package Apache::lonnavdisplay;
use strict;
-use Apache::Constants qw(:common :http);
+use Apache::Constants qw(:common :http REDIRECT);
use Apache::lonmenu();
use Apache::loncommon();
use Apache::lonnavmaps();
use Apache::lonhtmlcommon();
use Apache::lonnet;
use Apache::lonlocal;
-use Time::HiRes qw( gettimeofday tv_interval );
+use Apache::londocs();
+use Apache::lonuserstate;
sub handler {
my $r = shift;
@@ -46,123 +47,100 @@ sub handler {
sub real_handler {
my $r = shift;
- #my $t0=[&gettimeofday()];
# Handle header-only request
if ($r->header_only) {
- if ($env{'browser.mathml'}) {
- &Apache::loncommon::content_type($r,'text/xml');
- } else {
- &Apache::loncommon::content_type($r,'text/html');
- }
+ &Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
return OK;
}
- # Send header, don't cache this page
- if ($env{'browser.mathml'}) {
- &Apache::loncommon::content_type($r,'text/xml');
- } else {
+ # Check for critical messages and redirect if present.
+ my ($redirect,$url) = &Apache::loncommon::critical_redirect(300,'contents');
+ if ($redirect) {
&Apache::loncommon::content_type($r,'text/html');
+ $r->header_out(Location => $url);
+ return REDIRECT;
}
- &Apache::loncommon::no_cache($r);
- my %toplinkitems=();
- &Apache::lonnavmaps::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='';
- my $navstatus=&Apache::lonmenu::get_nav_status();
- my $nothing = &Apache::lonhtmlcommon::javascript_nothing();
- my $mainwindow='window.open('.$nothing.',"loncapaclient","",false);';
- $menu=(<