version 1.684, 2022/10/22 17:24:54
|
version 1.685, 2022/10/27 20:30:11
|
Line 183 sub default_folderpath {
|
Line 183 sub default_folderpath {
|
} |
} |
} |
} |
|
|
sub validate_folderpath { |
sub validate_supppath { |
my ($supplementalflag) = @_; |
my ($coursenum,$coursedom) = @_; |
if ($env{'form.folderpath'} ne '') { |
my $backto; |
my @items = split(/\&/,$env{'form.folderpath'}); |
|
my $badpath; |
|
for (my $i=0; $i<@items; $i++) { |
|
my $odd = $i%2; |
|
if (($odd) && (!$supplementalflag) && ($items[$i] !~ /^[^:]*:(|\d+):(|1):(|1):(|1):(|1)$/)) { |
|
$badpath = 1; |
|
} elsif ((!$odd) && ($items[$i] !~ /^(default|supplemental)(|_\d+)$/)) { |
|
$badpath = 1; |
|
} |
|
last if ($badpath); |
|
} |
|
if ($badpath) { |
|
delete($env{'form.folderpath'}); |
|
} |
|
} |
|
return; |
|
} |
|
|
|
sub validate_suppath { |
|
if ($env{'form.supppath'} ne '') { |
if ($env{'form.supppath'} ne '') { |
my @items = split(/\&/,$env{'form.supppath'}); |
my @items = split(/\&/,$env{'form.supppath'}); |
my $badpath; |
my ($badpath,$got_supp,$supppath,%supphidden,%suppids); |
for (my $i=0; $i<@items; $i++) { |
for (my $i=0; $i<@items; $i++) { |
my $odd = $i%2; |
my $odd = $i%2; |
if ((!$odd) && ($items[$i] !~ /^supplemental(|_\d+)$/)) { |
if ((!$odd) && ($items[$i] !~ /^supplemental(|_\d+)$/)) { |
$badpath = 1; |
$badpath = 1; |
|
last; |
|
} elsif ($odd) { |
|
my $suffix; |
|
my $idx = $i-1; |
|
if ($items[$i] =~ /^([^:]*)::(|1):::$/) { |
|
$backto .= '&'.$1; |
|
} elsif ($items[$idx] eq 'supplemental') { |
|
$backto .= '&'.$items[$i]; |
|
} else { |
|
$backto .= '&'.$items[$i]; |
|
my $is_hidden; |
|
unless ($got_supp) { |
|
my ($supplemental) = &Apache::lonnet::get_supplemental($coursenum,$coursedom); |
|
if (ref($supplemental) eq 'HASH') { |
|
if (ref($supplemental->{'hidden'}) eq 'HASH') { |
|
%supphidden = %{$supplemental->{'hidden'}}; |
|
} |
|
if (ref($supplemental->{'ids'}) eq 'HASH') { |
|
%suppids = %{$supplemental->{'ids'}}; |
|
} |
|
} |
|
$got_supp = 1; |
|
} |
|
if (ref($suppids{"/uploaded/$coursedom/$coursenum/$items[$idx].sequence"}) eq 'ARRAY') { |
|
my $mapid = $suppids{"/uploaded/$coursedom/$coursenum/$items[$idx].sequence"}->[0]; |
|
if ($supphidden{$mapid}) { |
|
$is_hidden = 1; |
|
} |
|
} |
|
$suffix = '::'.$is_hidden.':::'; |
|
} |
|
$supppath .= '&'.$items[$i].$suffix; |
|
} else { |
|
$supppath .= '&'.$items[$i]; |
|
$backto .= '&'.$items[$i]; |
} |
} |
last if ($badpath); |
|
} |
} |
if ($badpath) { |
if ($badpath) { |
delete($env{'form.supppath'}); |
delete($env{'form.supppath'}); |
|
} else { |
|
$supppath =~ s/^\&//; |
|
$backto =~ s/^\&//; |
|
$env{'form.supppath'} = $supppath; |
} |
} |
} |
} |
return; |
return $backto; |
} |
} |
|
|
sub dumpcourse { |
sub dumpcourse { |
Line 3277 sub editor {
|
Line 3296 sub editor {
|
return $errtext if ($fatal); |
return $errtext if ($fatal); |
} |
} |
|
|
my (%supphidden,%suppids,$suppmapid); |
|
|
|
if ($#LONCAPA::map::order<1) { |
if ($#LONCAPA::map::order<1) { |
my $idx=&LONCAPA::map::getresidx(); |
my $idx=&LONCAPA::map::getresidx(); |
if ($idx<=0) { $idx=1; } |
if ($idx<=0) { $idx=1; } |
$LONCAPA::map::order[0]=$idx; |
$LONCAPA::map::order[0]=$idx; |
$LONCAPA::map::resources[$idx]=''; |
$LONCAPA::map::resources[$idx]=''; |
} elsif ($supplementalflag && !$allowed) { |
|
my ($supplemental) = &Apache::lonnet::get_supplemental($coursenum,$coursedom); |
|
if (ref($supplemental) eq 'HASH') { |
|
if (ref($supplemental->{'hidden'}) eq 'HASH') { |
|
%supphidden = %{$supplemental->{'hidden'}}; |
|
} |
|
if (ref($supplemental->{'ids'}) eq 'HASH') { |
|
%suppids = %{$supplemental->{'ids'}}; |
|
} |
|
} |
|
if ($folder eq 'supplemental') { |
|
$suppmapid = 0; |
|
} elsif ($folder =~ /^supplemental_(\d+)$/) { |
|
$suppmapid = $1; |
|
} |
|
} |
} |
|
|
# ------------------------------------------------------------ Process commands |
# ------------------------------------------------------------ Process commands |
Line 3559 sub editor {
|
Line 3561 sub editor {
|
$r->print('</div>'); |
$r->print('</div>'); |
} |
} |
|
|
|
if ((!$allowed) && ($folder =~ /^supplemental_\d+$/)) { |
|
my ($supplemental) = &Apache::lonnet::get_supplemental($coursenum,$coursedom); |
|
if (ref($supplemental) eq 'HASH') { |
|
if ((ref($supplemental->{'hidden'}) eq 'HASH') && |
|
(ref($supplemental->{'ids'}) eq 'HASH')) { |
|
if (ref($supplemental->{'ids'}->{"/uploaded/$coursedom/$coursenum/$folder.$container"}) eq 'ARRAY') { |
|
my $mapnum = $supplemental->{'ids'}->{"/uploaded/$coursedom/$coursenum/$folder.$container"}->[0]; |
|
if ($supplemental->{'hidden'}->{$mapnum}) { |
|
$ishidden = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
|
my ($to_show,$output,@allidx,@allmapidx,%filters,%lists,%curr_groups); |
my ($to_show,$output,@allidx,@allmapidx,%filters,%lists,%curr_groups); |
%filters = ( |
%filters = ( |
canremove => [], |
canremove => [], |
Line 3583 sub editor {
|
Line 3600 sub editor {
|
} |
} |
|
|
if (($supplementalflag) && (!$allowed) && (!$env{'request.role.adv'})) { |
if (($supplementalflag) && (!$allowed) && (!$env{'request.role.adv'})) { |
next if ($supphidden{$suppmapid.':'.$res}); |
if (($ishidden) || ((&LONCAPA::map::getparameter($res,'parameter_hiddenresource'))[0]=~/^yes$/i)) { |
|
$idx++; |
|
next; |
|
} |
} |
} |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$output .= &entryline($idx,$name,$url,$folder,$allowed,$res, |
$coursenum,$coursedom,$crstype, |
$coursenum,$coursedom,$crstype, |
$pathitem,$supplementalflag,$container, |
$pathitem,$supplementalflag,$container, |
\%filters,\%curr_groups,$ltitoolsref,$canedit, |
\%filters,\%curr_groups,$ltitoolsref,$canedit, |
$isencrypted,$navmapref,$hostname, |
$isencrypted,$ishidden,$navmapref,$hostname); |
\%supphidden,\%suppids,$suppmapid); |
|
$idx++; |
$idx++; |
$shown++; |
$shown++; |
} |
} |
Line 3972 sub is_supplemental_title {
|
Line 3991 sub is_supplemental_title {
|
sub entryline { |
sub entryline { |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom, |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups, |
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups, |
$ltitoolsref,$canedit,$isencrypted,$navmapref,$hostname, |
$ltitoolsref,$canedit,$isencrypted,$ishidden,$navmapref,$hostname)=@_; |
$supphidden,$suppids,$suppmapid)=@_; |
|
my ($foldertitle,$renametitle,$oldtitle); |
my ($foldertitle,$renametitle,$oldtitle); |
if (&is_supplemental_title($title)) { |
if (&is_supplemental_title($title)) { |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title); |
Line 4205 END
|
Line 4223 END
|
my $ispage; |
my $ispage; |
my $containerarg; |
my $containerarg; |
my $folderurl; |
my $folderurl; |
|
my $plainurl; |
if ($uploaded) { |
if ($uploaded) { |
if (($extension eq 'sequence') || ($extension eq 'page')) { |
if (($extension eq 'sequence') || ($extension eq 'page')) { |
$url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; |
$url=~/\Q$coursenum\E\/([\/\w]+)\.\Q$extension\E$/; |
Line 4223 END
|
Line 4242 END
|
$url='/adm/supplemental?'; |
$url='/adm/supplemental?'; |
} |
} |
} else { |
} else { |
&Apache::lonnet::allowuploaded('/adm/coursedoc',$url); |
$plainurl = $url; |
} |
} |
} |
} |
|
|
Line 4350 END
|
Line 4369 END
|
$nomodal = 1; |
$nomodal = 1; |
} |
} |
} |
} |
|
unless ($allowed && $env{'request.role.adv'}) { |
|
if ($ishidden || (&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
|
$hiddenres = 1; |
|
} |
|
} |
} |
} |
my ($rand_pick_text,$rand_order_text,$hiddenfolder); |
my ($rand_pick_text,$rand_order_text,$hiddenfolder); |
my $filterFunc = sub { my $res = shift; return (!$res->randomout() && !$res->is_map()) }; |
my $filterFunc = sub { my $res = shift; return (!$res->randomout() && !$res->is_map()) }; |
Line 4360 END
|
Line 4384 END
|
if (!$allowed && $supplementalflag) { |
if (!$allowed && $supplementalflag) { |
$folderpath.=$containerarg.'&'.$foldername; |
$folderpath.=$containerarg.'&'.$foldername; |
$url.='folderpath='.&escape($folderpath); |
$url.='folderpath='.&escape($folderpath); |
if (ref($supphidden) eq 'HASH') { |
if ($ishidden || (&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
if ($supphidden->{$suppmapid.':'.$residx}) { |
$hiddenfolder = 1; |
$hiddenfolder = 1; |
|
} |
|
} |
} |
} else { |
} else { |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
my $rpicknum = (&LONCAPA::map::getparameter($orderidx, |
Line 4458 $form_end;
|
Line 4480 $form_end;
|
if ($anchor ne '') { |
if ($anchor ne '') { |
$url .= '&anchor='.&HTML::Entities::encode($anchor,'"<>&'); |
$url .= '&anchor='.&HTML::Entities::encode($anchor,'"<>&'); |
} |
} |
if (ref($supphidden) eq 'HASH') { |
|
if ($supphidden->{$suppmapid.':'.$residx}) { |
|
$hiddenres = 1; |
|
} |
|
} |
|
} |
} |
my ($tdalign,$tdwidth); |
my ($tdalign,$tdwidth); |
if ($allowed) { |
if ($allowed) { |
Line 4521 $form_end;
|
Line 4538 $form_end;
|
} |
} |
} |
} |
$line.='</td><td>'; |
$line.='</td><td>'; |
my $link; |
my ($link,$nolink); |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
if ($allowed && !$env{'request.role.adv'} && !$isfolder && !$ispage) { |
|
if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
|
$nolink = 1; |
|
} |
|
} |
|
if ($nolink) { |
|
$line .= '<img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
|
} else { |
|
$line.='<a href="'.$url.'"><img src="'.$icon.'" alt="" class="LC_icon" /></a>'; |
|
} |
} elsif ($url) { |
} elsif ($url) { |
if ($anchor ne '') { |
if ($anchor ne '') { |
if ($supplementalflag) { |
if ($supplementalflag) { |
Line 4538 $form_end;
|
Line 4564 $form_end;
|
$link = $url; |
$link = $url; |
} |
} |
$link = &js_escape($link.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'.$anchor); |
$link = &js_escape($link.(($url=~/\?/)?'&':'?').'inhibitmenu=yes'.$anchor); |
if ($nomodal) { |
if ($allowed && !$env{'request.role.adv'} && !$isfolder && !$ispage && !$uploaded) { |
|
if ((&LONCAPA::map::getparameter($orderidx,'parameter_hiddenresource'))[0]=~/^yes$/i) { |
|
$nolink = 1; |
|
} |
|
} |
|
if ($nolink) { |
|
$line.='<img src="'.$icon.'" alt="" class="LC_icon" />'; |
|
} elsif ($nomodal) { |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
'<img src="'.$icon.'" alt="" class="LC_icon" border="0" /></a>'; |
'<img src="'.$icon.'" alt="" class="LC_icon" border="0" /></a>'; |
} else { |
} else { |
Line 4550 $form_end;
|
Line 4583 $form_end;
|
} |
} |
$line.='</span></td><td'.$tdwidth.'>'; |
$line.='</span></td><td'.$tdwidth.'>'; |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
if (($url=~m{/adm/(coursedocs|supplemental)}) || (!$allowed && $url)) { |
$line.='<a href="'.$url.'">'.$title.'</a>'; |
if ($nolink) { |
|
$line.=$title; |
|
} else { |
|
$line.='<a href="'.$url.'">'.$title.'</a>'; |
|
} |
if (!$allowed && $supplementalflag && $canedit && $isfolder) { |
if (!$allowed && $supplementalflag && $canedit && $isfolder) { |
my $editicon = &Apache::loncommon::lonhttpdurl('/res/adm/pages').'/editmap.png'; |
my $editicon = &Apache::loncommon::lonhttpdurl('/res/adm/pages').'/editmap.png'; |
my $editurl = $url; |
my $editurl = $url; |
Line 4563 $form_end;
|
Line 4600 $form_end;
|
$line.= ' <span class="LC_warning">('.&mt('hidden').')</span> '; |
$line.= ' <span class="LC_warning">('.&mt('hidden').')</span> '; |
} |
} |
} elsif ($url) { |
} elsif ($url) { |
if ($nomodal) { |
if ($nolink) { |
|
$line.=$title; |
|
} elsif ($nomodal) { |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
$line.='<a href="#" onclick="javascript:window.open('."'$link','syllabuspreview','height=400,width=500,scrollbars=1,resizable=1,menubar=0,location=1')".'; return false;" />'. |
$title.'</a>'; |
$title.'</a>'; |
} else { |
} else { |
Line 4582 $form_end;
|
Line 4621 $form_end;
|
$line .= '</td>'; |
$line .= '</td>'; |
$rand_pick_text = ' ' if ($rand_pick_text eq ''); |
$rand_pick_text = ' ' if ($rand_pick_text eq ''); |
$rand_order_text = ' ' if ($rand_order_text eq ''); |
$rand_order_text = ' ' if ($rand_order_text eq ''); |
|
if ($uploaded && $url && !$isfolder && !$ispage) { |
|
if (($plainurl ne '') && ($env{'request.role.adv'} || $allowed || !$hiddenres)) { |
|
&Apache::lonnet::allowuploaded('/adm/coursedoc',$plainurl); |
|
} |
|
} |
if ($allowed) { |
if ($allowed) { |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'hd' => 'Hidden', |
'hd' => 'Hidden', |
Line 5644 sub handler {
|
Line 5688 sub handler {
|
if ($env{'form.tools'}) { $toolsflag=1; } |
if ($env{'form.tools'}) { $toolsflag=1; } |
|
|
if ($env{'form.folderpath'} ne '') { |
if ($env{'form.folderpath'} ne '') { |
&validate_folderpath($supplementalflag); |
&Apache::loncommon::validate_folderpath($supplementalflag,$allowed,$coursenum,$coursedom); |
} |
} |
|
|
|
my $backto_supppath; |
if ($env{'form.supppath'} ne '') { |
if ($env{'form.supppath'} ne '') { |
&validate_suppath(); |
if ($supplementalflag && $allowed) { |
|
$backto_supppath = &validate_supppath($coursenum,$coursedom); |
|
} |
} |
} |
|
|
my $script=''; |
my $script=''; |
Line 5669 sub handler {
|
Line 5716 sub handler {
|
&Apache::loncommon::symb_to_docspath($env{'form.symb'},\$navmap); |
&Apache::loncommon::symb_to_docspath($env{'form.symb'},\$navmap); |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => |
$env{'form.command'}.'_'.$env{'form.symb'}}); |
$env{'form.command'}.'_'.$env{'form.symb'}}); |
} elsif ($env{'form.supppath'} ne '') { |
} elsif (($env{'form.supppath'} ne '') && $supplementalflag && $allowed) { |
$env{'form.folderpath'}=$env{'form.supppath'}; |
$env{'form.folderpath'}=$env{'form.supppath'}; |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => |
&Apache::lonnet::appenv({'docs.exit.'.$env{'request.course.id'} => |
$env{'form.command'}.'_'.$env{'form.supppath'}}); |
$env{'form.command'}.'_'.$backto_supppath}); |
} |
} |
} elsif ($env{'form.command'} eq 'editdocs') { |
} elsif ($env{'form.command'} eq 'editdocs') { |
$env{'form.folderpath'} = &default_folderpath($coursenum,$coursedom,\$navmap); |
$env{'form.folderpath'} = &default_folderpath($coursenum,$coursedom,\$navmap); |
Line 5708 sub handler {
|
Line 5755 sub handler {
|
undef($env{'form.folderpath'}); |
undef($env{'form.folderpath'}); |
} |
} |
if ($env{'form.folderpath'} ne '') { |
if ($env{'form.folderpath'} ne '') { |
&validate_folderpath($supplementalflag); |
&Apache::loncommon::validate_folderpath($supplementalflag,$allowed,$coursenum,$coursedom); |
} |
} |
} |
} |
|
|
Line 5724 sub handler {
|
Line 5771 sub handler {
|
.'&'. |
.'&'. |
$env{'form.folderpath'}; |
$env{'form.folderpath'}; |
} |
} |
# If allowed and user's role is not advanced check folderpath is not hidden |
# If allowed and user's role is not advanced check folderpath is not hidden |
if (($allowed) && (!$env{'request.role.adv'}) && |
my $hidden_and_empty; |
($env{'form.folderpath'} ne '') && (!$supplementalflag)) { |
if (($allowed) && (!$env{'request.role.adv'}) && ($env{'form.folderpath'} ne '')) { |
my $folderurl; |
my ($folderurl,$foldername,$hiddenfolder); |
my @pathitems = split(/\&/,$env{'form.folderpath'}); |
my @pathitems = split(/\&/,$env{'form.folderpath'}); |
my $folder = $pathitems[-2]; |
my $folder = $pathitems[-2]; |
if ($folder eq '') { |
if ($folder eq '') { |
Line 5739 sub handler {
|
Line 5786 sub handler {
|
} else { |
} else { |
$folderurl .= '.sequence'; |
$folderurl .= '.sequence'; |
} |
} |
unless (ref($navmap)) { |
if ($supplementalflag) { |
$navmap = Apache::lonnavmaps::navmap->new(); |
($foldername,$hiddenfolder) = ($pathitems[-1] =~ /^([^:]*)::(|1):::$/); |
} |
$foldername = &HTML::Entities::decode(&unescape($foldername)); |
if (ref($navmap)) { |
my ($supplemental) = &Apache::lonnet::get_supplemental($coursenum,$coursedom); |
if (lc($navmap->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes') { |
if (ref($supplemental) eq 'HASH') { |
my @resources = $navmap->retrieveResources($folderurl,$filterFunc,1,1); |
my ($suppmap,$suppmapnum); |
unless (@resources) { |
if ($folder eq 'supplemental') { |
undef($env{'form.folderpath'}); |
$suppmap = 'default'; |
|
$suppmapnum = 0; |
|
} elsif ($folder =~ /^supplemental_(\d+)$/) { |
|
$suppmap = $1; |
|
$suppmapnum = $suppmap; |
|
} |
|
if ($hiddenfolder) { |
|
my $hascontent; |
|
foreach my $key (reverse(sort(keys(%{$supplemental->{'ids'}})))) { |
|
if ($key =~ m{^\Q/uploaded/$coursedom/$coursenum/supplemental/$suppmap/\E}) { |
|
$hascontent = 1; |
|
} elsif (ref($supplemental->{'ids'}->{$key}) eq 'ARRAY') { |
|
foreach my $id (@{$supplemental->{'ids'}->{$key}}) { |
|
if ($id =~ /^$suppmapnum\:/) { |
|
$hascontent = 1; |
|
last; |
|
} |
|
} |
|
} |
|
last if ($hascontent); |
|
} |
|
unless ($hascontent) { |
|
if ($foldername ne '') { |
|
$hidden_and_empty = $foldername; |
|
} else { |
|
$hidden_and_empty = $folder; |
|
} |
|
} |
|
} |
|
} |
|
} else { |
|
unless (ref($navmap)) { |
|
$navmap = Apache::lonnavmaps::navmap->new(); |
|
} |
|
($foldername,$hiddenfolder) = ($pathitems[-1] =~ /^([^:]*):|\d+:|1:(|1):|1:|1$/); |
|
$foldername = &HTML::Entities::decode(&unescape($foldername)); |
|
if (ref($navmap)) { |
|
if ($hiddenfolder || |
|
(lc($navmap->get_mapparam(undef,$folderurl,"0.hiddenresource")) eq 'yes')) { |
|
my @resources = $navmap->retrieveResources($folderurl,$filterFunc,1,1); |
|
unless (@resources) { |
|
if ($foldername ne '') { |
|
$hidden_and_empty = $foldername; |
|
} else { |
|
$hidden_and_empty = $folder; |
|
} |
|
} |
} |
} |
} |
} |
} |
} |
|
if ($hidden_and_empty ne '') { |
|
splice(@pathitems,-2); |
|
if (@pathitems) { |
|
$env{'form.folderpath'} = join('&',@pathitems); |
|
} else { |
|
undef($env{'form.folderpath'}); |
|
} |
|
} |
} |
} |
} |
} |
|
|
|
|
# If after all of this, we still don't have any paths, make them |
# If after all of this, we still don't have any paths, make them |
unless ($env{'form.folderpath'}) { |
unless ($env{'form.folderpath'}) { |
if ($supplementalflag) { |
if ($supplementalflag) { |
Line 5847 sub handler {
|
Line 5947 sub handler {
|
&inject_data_js(). |
&inject_data_js(). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
&Apache::lonhtmlcommon::resize_scrollbox_js('docs',$tabidstr,$tid). |
&Apache::lonextresedit::extedit_javascript(\%ltitools); |
&Apache::lonextresedit::extedit_javascript(\%ltitools); |
|
my $onload = "javascript:resize_scrollbox('contentscroll','1','1');"; |
|
if ($hidden_and_empty ne '') { |
|
my $alert = &mt("Additional privileges required to edit empty and hidden folder: '[_1]'", |
|
$hidden_and_empty); |
|
$onload .= "javascript:alert('".&js_escape($alert)."');"; |
|
} |
$addentries = { |
$addentries = { |
onload => "javascript:resize_scrollbox('contentscroll','1','1');", |
onload => $onload, |
}; |
}; |
} |
} |
$script .= &paste_popup_js(); |
$script .= &paste_popup_js(); |
Line 6771 unless ($container eq 'page') {
|
Line 6877 unless ($container eq 'page') {
|
unless ($supplementalflag) { |
unless ($supplementalflag) { |
$folder='supplemental'; |
$folder='supplemental'; |
} |
} |
if ($folder =~ /^supplemental$/ && |
if (($folder eq 'supplemental') && |
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
(($env{'form.folderpath'} =~ /^default\&/) || ($env{'form.folderpath'} eq ''))) { |
$env{'form.folderpath'} = &supplemental_base(); |
$env{'form.folderpath'} = &supplemental_base(); |
} elsif ($allowed) { |
} elsif ($allowed) { |