--- loncom/interface/londocs.pm 2019/08/16 16:12:37 1.484.2.82 +++ loncom/interface/londocs.pm 2020/01/20 20:09:37 1.484.2.86 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.82 2019/08/16 16:12:37 raeburn Exp $ +# $Id: londocs.pm,v 1.484.2.86 2020/01/20 20:09:37 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2122,7 +2122,7 @@ sub copy_templated_files { if (grep(/^\Q$qtype\E$/,@simpleprobqtypes)) { my %newdata = ( $newprefix.'questiontype' => $qtype, - ) + ); foreach my $type (@simpleprobqtypes) { if ($type eq $qtype) { $newdata{"$weightprefix.$type.weight"}=1; @@ -5690,6 +5690,7 @@ HIDDENFORM # my $savefolderpath; + my $hostname = $r->hostname(); if ($allowed) { my $folder=$env{'form.folder'}; @@ -5936,7 +5937,7 @@ unless ($container eq 'page') { unless (($supplementalflag || $toolsflag)) { my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, $supplementalflag,\%orderhash,$iconpath,$pathitem, - $canedit,\$navmap,$hiddentop); + $canedit,$hostname,\$navmap,$hiddentop); undef($navmap); if ($error) { $r->print('

'.$error.'

'); @@ -6074,7 +6075,7 @@ my %suporderhash = ( if ($supplementalflag) { my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, $supplementalflag,\%suporderhash,$iconpath,$pathitem, - $canedit); + $canedit,$hostname); if ($error) { $r->print('

'.$error.'

'); } else { @@ -6094,7 +6095,7 @@ my %suporderhash = ( } } elsif ($supplementalflag) { my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, - $supplementalflag,'',$iconpath,$pathitem); + $supplementalflag,'',$iconpath,$pathitem,'',$hostname); if ($error) { $r->print('

'.$error.'

'); } @@ -6547,8 +6548,13 @@ sub editing_js { } else { $url = $res; } - $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"').'?symb='. - &HTML::Entities::encode($caller,'<>&"'); + $backtourl = &HTML::Entities::encode(&Apache::lonnet::clutter($url),'<>&"'); + if ($backtourl =~ m{^\Q/uploaded/$coursedom/$coursenum/\Edefault_\d+\.sequence$}) { + $backtourl .= '?navmap=1'; + } else { + $backtourl .= '?symb='. + &HTML::Entities::encode($caller,'<>&"'); + } if ($backtourl =~ m{^\Q/public/$coursedom/$coursenum/syllabus\E}) { if (($ENV{'SERVER_PORT'} == 443) && ($env{'course.'.$env{'request.course.id'}.'.externalsyllabus'} =~ m{^http://})) {