--- loncom/interface/lonnavmaps.pm 2018/01/04 12:07:53 1.539 +++ loncom/interface/lonnavmaps.pm 2018/01/15 00:51:42 1.540 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.539 2018/01/04 12:07:53 raeburn Exp $ +# $Id: lonnavmaps.pm,v 1.540 2018/01/15 00:51:42 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -966,7 +966,28 @@ sub render_resource { # links to open and close the folder my $whitespace = $location.'/whitespace_21.gif'; - my $linkopen = "".""; + my $linkopen = ""; + my $nomodal; + if (($params->{'modalLink'}) && (!$resource->is_sequence())) { + if ($link =~m{^(?:|/adm/wrapper)/ext/([^#]+)}) { + my $exturl = $1; + if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) { + $nomodal = 1; + } + } elsif (($link eq "/public/$LONCAPA::match_domain/$LONCAPA::match_courseid/syllabus") && + ($env{'request.course.id'}) && ($ENV{'SERVER_PORT'} == 443) && + ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { + $nomodal = 1; + } + my $esclink = &js_escape($link); + if ($nomodal) { + $linkopen .= ""; + } else { + $linkopen .= ""; + } + } else { + $linkopen .= ""; + } my $linkclose = ""; # Default icon: unknown page @@ -1094,10 +1115,19 @@ sub render_resource { } if (!$params->{'resource_nolink'} && !$resource->is_sequence() && !$resource->is_empty_sequence) { - $result .= "$curMarkerBegin$title$partLabel$curMarkerEnd$editmapLink$nonLinkedText"; - } else { - $result .= "$curMarkerBegin$linkopen$title$partLabel$curMarkerEnd$editmapLink$nonLinkedText"; + $linkclose = ''; + if ($params->{'modalLink'}) { + my $esclink = &js_escape($link); + if ($nomodal) { + $linkopen = ""; + } else { + $linkopen = ""; + } + } else { + $linkopen = ""; + } } + $result .= "$curMarkerBegin$linkopen$title$partLabel$linkclose$curMarkerEnd$editmapLink$nonLinkedText"; return $result; } @@ -1735,6 +1765,11 @@ END $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; } + my $inhibitmenu; + if ($args->{'modalLink'}) { + $inhibitmenu = '&inhibitmenu=yes'; + } + while (1) { if ($args->{'sort'}) { $curRes = shift(@resources); @@ -1888,7 +1923,7 @@ END } else { $args->{"resourceLink"} = $src. ($srcHasQuestion?'&':'?') . - 'symb=' . &escape($symb).$anchor; + 'symb=' . &escape($symb).$inhibitmenu.$anchor; } } # Now, we've decided what parts to show. Loop through them and