--- loncom/interface/lonprintout.pm 2019/02/06 01:10:09 1.627.2.26 +++ loncom/interface/lonprintout.pm 2019/07/31 20:10:26 1.627.2.28 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.627.2.26 2019/02/06 01:10:09 raeburn Exp $ +# $Id: lonprintout.pm,v 1.627.2.28 2019/07/31 20:10:26 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -848,8 +848,8 @@ sub set_font_size { if ($font_size ne '') { $text =~ s/\\begin\{document}/\\begin{document}{\\$font_size/; + $text =~ s/\\end\{document}/}\\end{document}/; } - $text =~ s/\\end\{document}/}\\end{document}/; return $text; @@ -3455,12 +3455,35 @@ ENDPART $URLback=$helper->{'VARS'}->{'filename'}; } elsif ($helper->{VARS}{'symb'}) { my ($map, $id, $url) = &Apache::lonnet::decode_symb($helper->{VARS}{'symb'}); + my $cdom =$env{'course.'.$env{'request.course.id'}.'.domain'}; + my $cnum =$env{'course.'.$env{'request.course.id'}.'.num'}; + my ($anchor,$usehttp); $url = &Apache::lonnet::clutter($url); + if (($ENV{'SERVER_PORT'} == 443) && ($env{'request.course.id'}) && + (($url =~ m{^\Q/public/$cdom/$cnum/syllabus\E($|\?)}) || + ($url =~ m{^\Q/adm/wrapper/ext/\E(?!https:)}))) { + unless (&Apache::lonnet::uses_sts()) { + $usehttp = 1; + } + } if ($env{'request.enc'}) { $url = &Apache::lonenc::encrypted($url); } if ($url ne '') { - $URLback = $url.(($url =~ /\?/) ? '&':'?').'symb='.$helper->{VARS}{'symb'}; + my $symb = $helper->{VARS}{'symb'}; + if ($url =~ m{^\Q/adm/wrapper/ext/\E}) { + my $link = $url; + ($link,$anchor) = ($url =~ /^([^\#]+)(?:|(\#[^\#]+))$/); + if ($anchor) { + ($symb) = ($helper->{VARS}{'symb'} =~ /^([^\#]+)/); + } + $url = $link; + } + $URLback = $url; + if ($usehttp) { + $URLback .= (($URLback =~ /\?/) ? '&':'?').'usehttp=1'; + } + $URLback .= (($URLback =~ /\?/) ? '&':'?').'symb='.&escape($symb.$anchor); } } # @@ -4808,7 +4831,7 @@ CHOOSE_FROM_ANY_SEQUENCE my $xmlfrag = << "FONT_SELECTION"; - + return 'normalsize';