--- loncom/interface/lonnavdisplay.pm 2014/05/03 15:22:02 1.26 +++ loncom/interface/lonnavdisplay.pm 2015/03/01 20:42:08 1.29 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA -# Navigate Maps Handler +# Navigate Maps Display Handler # -# $Id: lonnavdisplay.pm,v 1.26 2014/05/03 15:22:02 raeburn Exp $ +# $Id: lonnavdisplay.pm,v 1.29 2015/03/01 20:42:08 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,7 +30,7 @@ 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(); @@ -38,7 +38,6 @@ use Apache::lonhtmlcommon(); use Apache::lonnet; use Apache::lonlocal; use Apache::londocs(); -#use Time::HiRes qw( gettimeofday tv_interval ); sub handler { my $r = shift; @@ -47,7 +46,6 @@ sub handler { sub real_handler { my $r = shift; - #my $t0=[&gettimeofday()]; # Handle header-only request if ($r->header_only) { if ($env{'browser.mathml'}) { @@ -59,6 +57,16 @@ sub real_handler { return OK; } + # Check for critical messages and redirect if present. + my ($redirect,$url) = &Apache::loncommon::critical_redirect(300); + if ($redirect) { + &Apache::loncommon::content_type($r,'text/html'); + $r->header_out(Location => $url); + return REDIRECT; + } + + + # Send header, don't cache this page if ($env{'browser.mathml'}) { &Apache::loncommon::content_type($r,'text/xml'); @@ -283,8 +291,6 @@ sub real_handler { $r->print("

".&mt("This course is empty.")."

"); } } - #my $td=&tv_interval($t0); - #$r->print("
$td"); &endContentScreen($r); $r->print(&Apache::loncommon::end_page()); $r->rflush();