--- loncom/interface/lonnavdisplay.pm 2022/10/19 00:03:10 1.40 +++ loncom/interface/lonnavdisplay.pm 2025/02/07 20:46:01 1.45 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Display Handler # -# $Id: lonnavdisplay.pm,v 1.40 2022/10/19 00:03:10 raeburn Exp $ +# $Id: lonnavdisplay.pm,v 1.45 2025/02/07 20:46:01 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -120,7 +120,7 @@ ENDCLOSE if ($result eq 'supp') { $possdel = 1; } - my ($supplemental,$refs_updated) = &Apache::lonnet::get_supplemental($cnum,$cdom,'',$possdel); + my ($supplemental,$refs_updated) = &Apache::loncommon::get_supplemental($cnum,$cdom,'',$possdel); unless ($refs_updated) { &Apache::loncommon::set_supp_httprefs($cnum,$cdom,$supplemental,$possdel); } @@ -129,14 +129,16 @@ ENDCLOSE my $course_type = &Apache::loncommon::course_type(); if (($course_type eq 'Placement') && (!$env{'request.role.adv'})) { my $furl = &Apache::lonpageflip::first_accessible_resource(); - if ($result eq 'update') { + if (($result eq 'main') || ($result eq 'both')) { &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); $r->print($closure.&Apache::loncommon::end_page()); return OK; } else { - &Apache::loncommon::content_type($r,'text/html'); - $r->header_out(Location => $furl); - return REDIRECT; + unless ($furl eq '/adm/navmaps') { + &Apache::loncommon::content_type($r,'text/html'); + $r->header_out(Location => $furl); + return REDIRECT; + } } } @@ -158,7 +160,7 @@ ENDCLOSE my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { - if ($result eq 'update') { + if (($result eq 'main') || ($result eq 'both')) { &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); $r->print($closure.&Apache::loncommon::end_page()); } @@ -168,7 +170,7 @@ ENDCLOSE return HTTP_NOT_ACCEPTABLE; } - if ($result eq 'update') { + if (($result eq 'main') || ($result eq 'both')) { $r->rflush(); &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); $r->print($closure); @@ -180,8 +182,8 @@ ENDCLOSE &startpage($r); } - &startContentScreen($r,'navmaps'); - unless ($result eq 'update') { + &startContentScreen($r,'navmaps',$course_type); + unless (($result eq 'main') || ($result eq 'both')) { $r->rflush(); } @@ -315,13 +317,14 @@ ENDCLOSE '
'); } @@ -369,8 +372,7 @@ sub startpage { no_mt => 1}, ]; my $args = {'bread_crumbs' => $brcrum}; - my $start_page = &Apache::loncommon::start_page($title,undef,$args); - $r->print($start_page. + $r->print(&Apache::loncommon::start_page($title,undef,$args). '