--- loncom/interface/londocs.pm 2017/02/18 14:16:47 1.620 +++ loncom/interface/londocs.pm 2017/02/18 23:39:15 1.621 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.620 2017/02/18 14:16:47 raeburn Exp $ +# $Id: londocs.pm,v 1.621 2017/02/18 23:39:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3970,7 +3970,7 @@ END } } - my ($editlink,$extresform,$anchor,$hiddenres); + my ($editlink,$extresform,$anchor,$hiddenres,$nomodal); my $orig_url = $url; $orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; $url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; @@ -3992,6 +3992,12 @@ END $url='/adm/wrapper'.$url; } elsif ($url=~m{^/adm/$coursedom/$coursenum/\d+/exttools?$}) { $url='/adm/wrapper'.$url; + } elsif ($url eq "/public/$coursedom/$coursenum/syllabus") { + if (($ENV{'SERVER_PORT'} == 443) && + ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { + $url .= '?usehttp=1'; + $nomodal = 1; + } } if (&Apache::lonnet::symbverify($symb,$url)) { my $shownsymb = $symb; @@ -4049,12 +4055,18 @@ END $url=''; } } - } elsif ($supplementalflag) { + } elsif ($supplementalflag) { if ($isexternal) { if ($url =~ /^([^#]+)#([^#]+)$/) { $url = $1; $anchor = $2; } + } elsif ($url =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { + if (($ENV{'SERVER_PORT'} == 443) && + ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) { + $url .= (($url =~ /\?/) ? '&':'?').'usehttp=1'; + $nomodal = 1; + } } } my ($rand_pick_text,$rand_order_text,$hiddenfolder); @@ -4205,6 +4217,7 @@ $form_end; $reinit = &mt('(re-initialize course to access)'); } $line.=''.$editlink.$renamelink; + my $link; if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { $line.=''; } elsif ($url) { @@ -4215,9 +4228,15 @@ $form_end; $anchor = '#'.&HTML::Entities::encode($anchor,'"<>&'); } } - $line.=&Apache::loncommon::modal_link(&js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. - (($anchor ne '')?$anchor:'')), - '',600,500); + $link = &js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. + (($anchor ne '')?$anchor:'')); + if ($nomodal) { + $line.=''. + ''; + } else { + $line.=&Apache::loncommon::modal_link($link, + '',600,500); + } } else { $line.=''; } @@ -4225,9 +4244,12 @@ $form_end; if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { $line.=''.$title.''; } elsif ($url) { - $line.=&Apache::loncommon::modal_link(&js_escape($url.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'. - (($anchor ne '')?$anchor:'')), - $title,600,500); + if ($nomodal) { + $line.=''. + $title.''; + } else { + $line.=&Apache::loncommon::modal_link($link,$title,600,500); + } } elsif (($hiddenfolder) || ($hiddenres)) { $line.=$title.' '.&mt('(Hidden)').''; } else {