version 1.484.2.86, 2020/01/20 20:09:37
|
version 1.484.2.87, 2020/03/05 22:35:58
|
Line 1059 sub update_paste_buffer {
|
Line 1059 sub update_paste_buffer {
|
# Construct identifiers for current contents of user's paste buffer |
# Construct identifiers for current contents of user's paste buffer |
if (@currpaste) { |
if (@currpaste) { |
foreach my $suffix (@currpaste) { |
foreach my $suffix (@currpaste) { |
my $cid = $env{'docs.markedcopy_crs_'.$suffix}; |
my $cid = $env{'docs.markedcopy_crs_'.$suffix}; |
my $url = $env{'docs.markedcopy_url_'.$suffix}; |
my $url = $env{'docs.markedcopy_url_'.$suffix}; |
my $mapidx = $env{'docs.markedcopy_map_'.$suffix}; |
my $mapidx = $env{'docs.markedcopy_map_'.$suffix}; |
if (($cid =~ /^$match_domain(?:_)$match_courseid$/) && |
if (($cid =~ /^$match_domain(?:_)$match_courseid$/) && |
($url ne '')) { |
($url ne '')) { |
$pasteurls{$cid.'_'.$url.'_'.$mapidx} = 1; |
if ($url eq '/res/lib/templates/simpleproblem.problem') { |
} |
$pasteurls{$cid.'_'.$mapidx} = 1; |
|
} elsif ($url =~ m{^/res/$match_domain/$match_username/}) { |
|
$pasteurls{$url} = 1; |
|
} else { |
|
$pasteurls{$cid.'_'.$url} = 1; |
|
} |
|
} |
} |
} |
} |
} |
|
|
Line 1074 sub update_paste_buffer {
|
Line 1080 sub update_paste_buffer {
|
|
|
my @pathitems = split(/\&/,$env{'form.folderpath'}); |
my @pathitems = split(/\&/,$env{'form.folderpath'}); |
my @folderconf = split(/\:/,$pathitems[-1]); |
my @folderconf = split(/\:/,$pathitems[-1]); |
my $ispage = $folderconf[4]; |
my $ispage = $folderconf[5]; |
|
|
foreach my $item (@possibles) { |
foreach my $item (@possibles) { |
my ($orderidx,$cmd) = split(/:/,$item); |
my ($orderidx,$cmd) = split(/:/,$item); |
Line 1087 sub update_paste_buffer {
|
Line 1093 sub update_paste_buffer {
|
$env{'form.folderpath'},\%curr_groups); |
$env{'form.folderpath'},\%curr_groups); |
next if ($denied{'copy'}); |
next if ($denied{'copy'}); |
$url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$url=~s{http(:|:)//https(:|:)//}{https$2//}; |
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$mapidx})); |
if ($url eq '/res/lib/templates/simpleproblem.problem') { |
|
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$mapidx})); |
|
} elsif ($url =~ m{^/res/$match_domain/$match_username/}) { |
|
next if (exists($pasteurls{$url})); |
|
} else { |
|
next if (exists($pasteurls{$coursedom.'_'.$coursenum.'_'.$url})); |
|
} |
my ($suffix,$errortxt,$locknotfreed) = |
my ($suffix,$errortxt,$locknotfreed) = |
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste'); |
&new_timebased_suffix($env{'user.domain'},$env{'user.name'},'paste'); |
if ($suffix ne '') { |
if ($suffix ne '') { |
Line 3874 END
|
Line 3886 END
|
my ($editlink,$extresform,$anchor,$hiddenres,$nomodal); |
my ($editlink,$extresform,$anchor,$hiddenres,$nomodal); |
my $orig_url = $url; |
my $orig_url = $url; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$orig_url=~s{http(:|:)//https(:|:)//}{https$2//}; |
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
if ($container eq 'page') { |
|
$url=~s{^http(|s)(:|:)//}{/ext/}; |
|
} else { |
|
$url=~s{^http(|s)(:|:)//}{/adm/wrapper/ext/}; |
|
} |
if (!$supplementalflag && $residx && $symb) { |
if (!$supplementalflag && $residx && $symb) { |
if ((!$isfolder) && (!$ispage)) { |
if ((!$isfolder) && (!$ispage)) { |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
(undef,undef,$url)=&Apache::lonnet::decode_symb($symb); |
$url=&Apache::lonnet::clutter($url); |
if (($url =~ m{^ext/}) && ($container eq 'page')) { |
|
$url=&Apache::lonnet::clutter_with_no_wrapper($url); |
|
} else { |
|
$url=&Apache::lonnet::clutter($url); |
|
} |
if ($url=~/^\/*uploaded\//) { |
if ($url=~/^\/*uploaded\//) { |
$url=~/\.(\w+)$/; |
$url=~/\.(\w+)$/; |
my $embstyle=&Apache::loncommon::fileembstyle($1); |
my $embstyle=&Apache::loncommon::fileembstyle($1); |
Line 3892 END
|
Line 3912 END
|
} elsif ($url=~m{^(|/adm/wrapper)/ext/([^#]+)}) { |
} elsif ($url=~m{^(|/adm/wrapper)/ext/([^#]+)}) { |
my $wrapped = $1; |
my $wrapped = $1; |
my $exturl = $2; |
my $exturl = $2; |
if ($wrapped eq '') { |
if (($wrapped eq '') && ($container ne 'page')) { |
$url='/adm/wrapper'.$url; |
$url='/adm/wrapper'.$url; |
} |
} |
if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) { |
if (($ENV{'SERVER_PORT'} == 443) && ($exturl !~ /^https:/)) { |
Line 3916 END
|
Line 3936 END
|
my $escan = &escape('#'); |
my $escan = &escape('#'); |
$shownsymb =~ s/^([^\#]+)#([^\#]+)$/$1$escan$2/; |
$shownsymb =~ s/^([^\#]+)#([^\#]+)$/$1$escan$2/; |
} |
} |
|
if ($container eq 'page') { |
|
$url = &Apache::lonnet::clutter($url); |
|
} |
} |
} |
unless ($env{'request.role.adv'}) { |
unless ($env{'request.role.adv'}) { |
if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
Line 5229 sub handler {
|
Line 5252 sub handler {
|
undef($env{'form.folderpath'}); |
undef($env{'form.folderpath'}); |
} else { |
} else { |
$folderurl = "uploaded/$coursedom/$coursenum/$folder"; |
$folderurl = "uploaded/$coursedom/$coursenum/$folder"; |
if ((split(/\:/,$pathitems[-1]))[4]) { |
if ((split(/\:/,$pathitems[-1]))[5]) { |
$folderurl .= '.page'; |
$folderurl .= '.page'; |
} else { |
} else { |
$folderurl .= '.sequence'; |
$folderurl .= '.sequence'; |