--- loncom/interface/londocs.pm 2017/02/20 18:29:22 1.622 +++ loncom/interface/londocs.pm 2017/03/08 02:51:07 1.623 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.622 2017/02/20 18:29:22 raeburn Exp $ +# $Id: londocs.pm,v 1.623 2017/03/08 02:51:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3988,8 +3988,15 @@ END } elsif ($url!~/\.(sequence|page)$/) { $url='/adm/coursedocs/showdoc'.$url; } - } elsif ($url=~m|^/ext/|) { - $url='/adm/wrapper'.$url; + } elsif ($url=~m{^(|/adm/wrapper)/ext/([^#]+)}) { + my $wrapped = $1; + my $exturl = $2; + if ($wrapped eq '') { + $url='/adm/wrapper'.$url; + } + if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) { + $nomodal = 1; + } } elsif ($url=~m{^/adm/$coursedom/$coursenum/\d+/exttools?$}) { $url='/adm/wrapper'.$url; } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") { @@ -4060,6 +4067,12 @@ END if ($url =~ /^([^#]+)#([^#]+)$/) { $url = $1; $anchor = $2; + if (($url =~ m{^(|/adm/wrapper)/ext/(?!https:)}) && ($ENV{'SERVER_PORT'} == 443)) { + if ($hostname ne '') { + $url = 'http://'.$hostname.$url; + } + $nomodal = 1; + } } } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { if (($ENV{'SERVER_PORT'} == 443) && @@ -6882,6 +6895,10 @@ sub editing_js { } $backtourl .= (($backtourl =~ /\?/) ? '&':'?').'usehttp=1'; } + } elsif ($backtourl =~ m{^/adm/wrapper/ext/(?!https:)}) { + if (($ENV{'SERVER_PORT'} == 443) && ($hostname ne '')) { + $backtourl = 'http://'.$hostname.$backtourl; + } } if ($anchor ne '') { $backtourl .= '#'.&HTML::Entities::encode($anchor,'<>&"');