--- loncom/interface/lonnavdisplay.pm 2010/05/27 21:37:13 1.13.4.1 +++ loncom/interface/lonnavdisplay.pm 2023/01/20 23:15:35 1.22.4.10.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA -# Navigate Maps Handler +# Navigate Maps Display Handler # -# $Id: lonnavdisplay.pm,v 1.13.4.1 2010/05/27 21:37:13 raeburn Exp $ +# $Id: lonnavdisplay.pm,v 1.22.4.10.2.3 2023/01/20 23:15:35 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,137 +47,114 @@ 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=&Apache::lonmenu::reopenmenu(); - my $navstatus=&Apache::lonmenu::get_nav_status(); - if ($menu) { - $menu=(<