--- loncom/interface/lonhtmlcommon.pm 2017/01/28 02:31:51 1.379 +++ loncom/interface/lonhtmlcommon.pm 2017/02/18 23:39:16 1.380 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.379 2017/01/28 02:31:51 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.380 2017/02/18 23:39:16 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2201,11 +2201,11 @@ sub docs_breadcrumbs { my $foldername=shift(@folders); if ($folderpath) {$folderpath.='&';} $folderpath.=$folder.'&'.$foldername; - my $url; + my $url = $env{'request.use_absolute'}; if ($allowed) { - $url = '/adm/coursedocs?folderpath='; + $url .= '/adm/coursedocs?folderpath='; } else { - $url = '/adm/supplemental?folderpath='; + $url .= '/adm/supplemental?folderpath='; } $url .= &escape($folderpath); my $name=&unescape($foldername); @@ -3497,7 +3497,7 @@ ENDUTILITY sub jump_to_editres { my ($cfile,$home,$switchserver,$forceedit,$forcereg,$symb,$folderpath, $title,$idx,$suppurl,$todocs,$suppanchor) = @_; - my ($jscall,$anchor); + my ($jscall,$anchor,$usehttp); if ($switchserver) { if ($home) { $cfile = '/adm/switchserver?otherserver='.$home.'&role='. @@ -3520,6 +3520,17 @@ sub jump_to_editres { if ($cfile =~ m{^(/adm/wrapper/ext/[^#]+)#([^#]+)$}) { $cfile = $1; $anchor = $2; + } elsif ($cfile =~ m{^/public/($match_domain)/($match_courseid)/syllabus}) { + if ($ENV{'SERVER_PORT'} == 443) { + my ($cdom,$cnum) = ($1,$2); + if (($env{'request.course.id'}) && + ($env{'course.'.$env{'request.course.id'}.'.num'} eq $cnum) && + ($env{'course.'.$env{'request.course.id'}.'.domain'} eq $cdom)) { + if ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://}) { + $usehttp = 1; + } + } + } } if ($symb) { if ($anchor ne '') { @@ -3545,6 +3556,8 @@ sub jump_to_editres { } if ($forceedit) { $cfile .= (($cfile=~/\?/)?'&':'?').'forceedit=1'; + } elsif ($usehttp) { + $cfile .= (($cfile=~/\?/)?'&':'?').'usehttp=1'; } if ($forcereg) { $cfile .= (($cfile=~/\?/)?'&':'?').'register=1';