--- loncom/interface/lonnavmaps.pm 2018/11/13 03:59:00 1.543 +++ loncom/interface/lonnavmaps.pm 2020/03/03 01:17:48 1.548 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.543 2018/11/13 03:59:00 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.548 2020/03/03 01:17:48 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1490,10 +1490,13 @@ sub render { if ($args->{'iterator_map'}) { my $map = $args->{'iterator_map'}; $map = $navmap->getResourceByUrl($map); - my $firstResource = $map->map_start(); - my $finishResource = $map->map_finish(); - - $args->{'iterator'} = $it = $navmap->getIterator($firstResource, $finishResource, $filterHash, $condition); + if (ref($map)) { + my $firstResource = $map->map_start(); + my $finishResource = $map->map_finish(); + $args->{'iterator'} = $it = $navmap->getIterator($firstResource, $finishResource, $filterHash, $condition); + } else { + return; + } } else { $args->{'iterator'} = $it = $navmap->getIterator(undef, undef, $filterHash, $condition,undef,$args->{'include_top_level_map'}); } @@ -1828,7 +1831,7 @@ END } } else { my $deeplink = $navmap->get_mapparam(undef,$mapname,"0.deeplink"); - if (($deeplink eq 'absent') || ($deeplink eq 'grades')) { + if ($deeplink =~ /^(absent|grades),/) { if ($userCanSeeHidden) { $args->{'mapUnlisted'} = 1; } else { @@ -1899,10 +1902,10 @@ END } } # If deep-link parameter is set (and is not set to full) suppress link - # unless priviliged user, or calling context is sequence, and parameter + # unless privileged user, or calling context is sequence, and parameter # set at map level if ((!$curRes->deeplink($args->{'caller'})) || - ($curRes->deeplink($args->{'caller'}) eq 'full') || &advancedUser()) { + ($curRes->deeplink($args->{'caller'}) =~ /^full,/) || &advancedUser()) { $args->{'resource_nolink'} = 0; } else { $args->{'resource_nolink'} = 1; @@ -1933,14 +1936,20 @@ END if ($env{'request.course.id'}) { if (($is_ssl) && ($src =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) && ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { - if ($hostname ne '') { - $src = 'http://'.$hostname.$src; + unless (&Apache::lonnet::uses_sts()) { + if ($hostname ne '') { + $src = 'http://'.$hostname.$src; + } + $src .= ($srcHasQuestion? '&' : '?') . 'usehttp=1'; + $srcHasQuestion = 1; } - $src .= ($srcHasQuestion? '&' : '?') . 'usehttp=1'; - $srcHasQuestion = 1; } elsif (($is_ssl) && ($src =~ m{^\Q/adm/wrapper/ext/\E(?!https:)})) { - if ($hostname ne '') { - $src = 'http://'.$hostname.$src; + unless (&Apache::lonnet::uses_sts()) { + if ($hostname ne '') { + $src = 'http://'.$hostname.$src; + } + $src .= ($srcHasQuestion? '&' : '?') . 'usehttp=1'; + $srcHasQuestion = 1; } } } @@ -1979,7 +1988,7 @@ END $currentJumpDelta) { # Jam the anchor after the