version 1.629, 2017/05/10 20:32:27
|
version 1.630, 2017/05/10 23:34:15
|
Line 603 sub recurse_html {
|
Line 603 sub recurse_html {
|
} else { |
} else { |
$relfile = $dependency; |
$relfile = $dependency; |
$depurl = $currurlpath; |
$depurl = $currurlpath; |
$depurl =~ s{[^/]+$}{}; |
$depurl =~ s{[^/]+$}{}; |
$depurl .= $dependency; |
$depurl .= $dependency; |
($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); |
($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); |
} |
} |
next if ($relfile eq ''); |
next if ($relfile eq ''); |
my $newname = $replacehash->{$container}; |
my $newname = $replacehash->{$container}; |
Line 697 sub group_import {
|
Line 697 sub group_import {
|
} elsif ($residx) { |
} elsif ($residx) { |
$toolhash{'target'} = $toolsettings{'target'}; |
$toolhash{'target'} = $toolsettings{'target'}; |
if ($toolhash{'target'} eq 'window') { |
if ($toolhash{'target'} eq 'window') { |
foreach my $item ('width','height') { |
foreach my $item ('width','height') { |
$toolhash{$item} = $toolsettings{$item}; |
$toolhash{$item} = $toolsettings{$item}; |
} |
} |
} |
} |
Line 812 $initialtext
|
Line 812 $initialtext
|
</html> |
</html> |
END |
END |
$env{'form.output'}=$newhtml; |
$env{'form.output'}=$newhtml; |
my $result = |
my $result = |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom, |
&Apache::lonnet::finishuserfileupload($coursenum,$coursedom, |
'output', |
'output', |
"$filepath/$residx/$fname.html"); |
"$filepath/$residx/$fname.html"); |
Line 971 sub docs_change_log {
|
Line 971 sub docs_change_log {
|
if ($supplementalflag) { |
if ($supplementalflag) { |
$tid = 2; |
$tid = 2; |
} |
} |
my ($breadcrumbtrail) = |
my ($breadcrumbtrail) = |
&Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1); |
&Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1); |
$r->print($breadcrumbtrail. |
$r->print($breadcrumbtrail. |
&generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto, |
&generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto, |
Line 1170 sub update_paste_buffer {
|
Line 1170 sub update_paste_buffer {
|
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; |
$pasteurls{$cid.'_'.$url.'_'.$mapidx} = 1; |
Line 1865 sub do_paste_from_buffer {
|
Line 1865 sub do_paste_from_buffer {
|
} |
} |
} |
} |
unless (($env{'form.docs.markedcopy_options_'.$suffix} eq 'move') && (!$fromothercrs)) { |
unless (($env{'form.docs.markedcopy_options_'.$suffix} eq 'move') && (!$fromothercrs)) { |
my (%lockerr,$msg); |
my (%lockerr,$msg); |
my ($newurl,$result,$errtext) = |
my ($newurl,$result,$errtext) = |
&dbcopy(\%info,$coursedom,$coursenum,\%lockerr); |
&dbcopy(\%info,$coursedom,$coursenum,\%lockerr); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
Line 1924 sub do_paste_from_buffer {
|
Line 1924 sub do_paste_from_buffer {
|
if ($newdocsdir eq '') { |
if ($newdocsdir eq '') { |
$newdocsdir = 'default'; |
$newdocsdir = 'default'; |
} |
} |
if (($prefixchg{$suffix}) || |
if (($prefixchg{$suffix}) || |
($srcdom{$suffix} ne $coursedom) || |
($srcdom{$suffix} ne $coursedom) || |
($srcnum{$suffix} ne $coursenum) || |
($srcnum{$suffix} ne $coursenum) || |
($env{'form.docs.markedcopy_options_'.$suffix} ne 'move')) { |
($env{'form.docs.markedcopy_options_'.$suffix} ne 'move')) { |
my $newpath = "$newprefix/$newdocsdir/$newidx/$rem"; |
my $newpath = "$newprefix/$newdocsdir/$newidx/$rem"; |
Line 2911 sub update_parameter {
|
Line 2911 sub update_parameter {
|
'randomorder' => {}, |
'randomorder' => {}, |
); |
); |
foreach my $which (keys(%allchecked)) { |
foreach my $which (keys(%allchecked)) { |
$env{'form.all'.$which} =~ s/,$//; |
$env{'form.all'.$which} =~ s/,$//; |
if ($which eq 'randompick') { |
if ($which eq 'randompick') { |
foreach my $item (split(/,/,$env{'form.all'.$which})) { |
foreach my $item (split(/,/,$env{'form.all'.$which})) { |
my ($res,$value) = split(/:/,$item); |
my ($res,$value) = split(/:/,$item); |
Line 3441 sub editor {
|
Line 3441 sub editor {
|
if (@allidx > 0) { |
if (@allidx > 0) { |
my $path; |
my $path; |
if ($env{'form.folderpath'}) { |
if ($env{'form.folderpath'}) { |
$path = |
$path = |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
&HTML::Entities::encode($env{'form.folderpath'},'<>&"'); |
} |
} |
if (@allidx > 1) { |
if (@allidx > 1) { |
$to_show .= |
$to_show .= |
&Apache::loncommon::continue_data_table_row(). |
&Apache::loncommon::continue_data_table_row(). |
'<td colspan="2"> </td>'. |
'<td colspan="2"> </td>'. |
'<td>'. |
'<td>'. |
Line 3693 sub process_file_upload {
|
Line 3693 sub process_file_upload {
|
my $uploadphase = 'upload_embedded'; |
my $uploadphase = 'upload_embedded'; |
my $primaryurl = &HTML::Entities::encode($url,'<>&"'); |
my $primaryurl = &HTML::Entities::encode($url,'<>&"'); |
my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); |
my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); |
my ($embedded,$num) = |
my ($embedded,$num) = |
&Apache::loncommon::ask_for_embedded_content( |
&Apache::loncommon::ask_for_embedded_content( |
'/adm/coursedocs',$state,$allfiles,$codebase,{'docs_url' => $url}); |
'/adm/coursedocs',$state,$allfiles,$codebase,{'docs_url' => $url}); |
if ($embedded) { |
if ($embedded) { |
Line 4182 END
|
Line 4182 END
|
} |
} |
} |
} |
} |
} |
|
|
# Append randompick number, hidden, and encrypted with ":" to foldername, |
# Append randompick number, hidden, and encrypted with ":" to foldername, |
# so it gets transferred between levels |
# so it gets transferred between levels |
$folderpath.=$containerarg.'&'.$foldername. |
$folderpath.=$containerarg.'&'.$foldername. |
Line 4243 $form_end;
|
Line 4243 $form_end;
|
} |
} |
my ($tdalign,$tdwidth); |
my ($tdalign,$tdwidth); |
if ($allowed) { |
if ($allowed) { |
my $fileloc = |
my $fileloc = |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
&Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); |
if ($isexternal) { |
if ($isexternal) { |
($editlink,$extresform) = |
($editlink,$extresform) = |
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem, |
&Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem, |
undef,undef,undef,undef,undef,undef, |
undef,undef,undef,undef,undef,undef, |
undef,$disabled); |
undef,$disabled); |
Line 4263 $form_end;
|
Line 4263 $form_end;
|
if ($supplementalflag) { |
if ($supplementalflag) { |
$suppanchor = $anchor; |
$suppanchor = $anchor; |
} |
} |
my $jscall = |
my $jscall = |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
&Apache::lonhtmlcommon::jump_to_editres($cfile,$home, |
$switchserver, |
$switchserver, |
$forceedit, |
$forceedit, |
Line 4475 sub new_timebased_suffix {
|
Line 4475 sub new_timebased_suffix {
|
} |
} |
} |
} |
if ($freedlock ne 'ok') { |
if ($freedlock ne 'ok') { |
$locknotfreed = |
$locknotfreed = |
'<div class="LC_error">'. |
'<div class="LC_error">'. |
&mt('There was a problem removing a lockfile.').' '; |
&mt('There was a problem removing a lockfile.').' '; |
if ($type eq 'paste') { |
if ($type eq 'paste') { |
Line 5551 sub handler {
|
Line 5551 sub handler {
|
my ($destination,$dir_root) = &embedded_destination(); |
my ($destination,$dir_root) = &embedded_destination(); |
my $url_root = '/uploaded/'.$docudom.'/'.$docuname; |
my $url_root = '/uploaded/'.$docudom.'/'.$docuname; |
my $actionurl = '/adm/coursedocs'; |
my $actionurl = '/adm/coursedocs'; |
my ($result,$flag) = |
my ($result,$flag) = |
&Apache::loncommon::upload_embedded('coursedoc',$destination, |
&Apache::loncommon::upload_embedded('coursedoc',$destination, |
$docuname,$docudom,$dir_root,$url_root,undef,undef,undef,$state, |
$docuname,$docudom,$dir_root,$url_root,undef,undef,undef,$state, |
$actionurl); |
$actionurl); |
Line 5562 sub handler {
|
Line 5562 sub handler {
|
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $docudom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $docudom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my ($destination,$dir_root) = &embedded_destination(); |
my ($destination,$dir_root) = &embedded_destination(); |
my $result = |
my $result = |
&Apache::loncommon::modify_html_refs('coursedoc',$destination, |
&Apache::loncommon::modify_html_refs('coursedoc',$destination, |
$docuname,$docudom,undef, |
$docuname,$docudom,undef, |
$dir_root); |
$dir_root); |
$r->print($result.&return_to_editor()); |
$r->print($result.&return_to_editor()); |
} elsif ($env{'form.phase'} eq 'decompress_uploaded') { |
} elsif ($env{'form.phase'} eq 'decompress_uploaded') { |
$uploadphase = 'decompress_phase_one'; |
$uploadphase = 'decompress_phase_one'; |
$r->print(&decompression_phase_one(). |
$r->print(&decompression_phase_one(). |
Line 5592 sub handler {
|
Line 5592 sub handler {
|
'impo' => 'Import', |
'impo' => 'Import', |
'lnks' => 'Import from Stored Links', |
'lnks' => 'Import from Stored Links', |
'impm' => 'Import from Assembled Map', |
'impm' => 'Import from Assembled Map', |
'imcr' => 'Import from Course Resources', |
'imcr' => 'Import from Course Resources', |
'extr' => 'External Resource', |
'extr' => 'External Resource', |
'extt' => 'External Tool', |
'extt' => 'External Tool', |
'selm' => 'Select Map', |
'selm' => 'Select Map', |
Line 5603 sub handler {
|
Line 5603 sub handler {
|
'navc' => 'Table of Contents', |
'navc' => 'Table of Contents', |
'sipa' => 'Simple Course Page', |
'sipa' => 'Simple Course Page', |
'sipr' => 'Simple Problem', |
'sipr' => 'Simple Problem', |
'webp' => 'Blank Web Page (editable)', |
'webp' => 'Blank Web Page (editable)', |
'stpr' => 'Standard Problem', |
'stpr' => 'Standard Problem', |
'news' => 'New sub-directory', |
'news' => 'New sub-directory', |
'crpr' => 'Create Problem', |
'crpr' => 'Create Problem', |
Line 6361 unless ($container eq 'page') {
|
Line 6361 unless ($container eq 'page') {
|
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<form action="/adm/coursedocs" method="post" name="supuploaddocument" enctype="multipart/form-data"> |
<fieldset id="uploadsuppdocform" style="display: none;"> |
<fieldset id="uploadsuppdocform" style="display: none;"> |
<legend>$lt{'upfi'}</legend> |
<legend>$lt{'upfi'}</legend> |
<input type="hidden" name="active" value="ee" /> |
<input type="hidden" name="active" value="ee" /> |
$fileupload |
$fileupload |
<br /> |
<br /> |
<br /> |
<br /> |
Line 6488 my %suporderhash = (
|
Line 6488 my %suporderhash = (
|
} |
} |
&Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); |
&Apache::lonnet::get_numsuppfiles($coursenum,$coursedom,1); |
undef($suppchanges); |
undef($suppchanges); |
} |
} |
} |
} |
} |
} |
} elsif ($supplementalflag) { |
} elsif ($supplementalflag) { |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
my $error = &editor($r,$coursenum,$coursedom,$folder,$allowed,'',$crstype, |
Line 6520 my %suporderhash = (
|
Line 6520 my %suporderhash = (
|
&entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'</table>'); |
&entryline(0,&mt("Click to download or use your browser's Save Link function"),$showdoc).'</table>'); |
} |
} |
} |
} |
unless ($noendpage) { |
unless ($noendpage) { |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
return OK; |
return OK; |
Line 6592 sub decompression_phase_one {
|
Line 6592 sub decompression_phase_one {
|
$error = &mt('Archive file "[_1]" not in the expected location.',$env{'form.archiveurl'}); |
$error = &mt('Archive file "[_1]" not in the expected location.',$env{'form.archiveurl'}); |
} else { |
} else { |
my $file = $1; |
my $file = $1; |
$output = |
$output = |
&Apache::loncommon::process_decompression($docudom,$docuname,$file, |
&Apache::loncommon::process_decompression($docudom,$docuname,$file, |
$destination,$dir_root, |
$destination,$dir_root, |
$hiddenelem); |
$hiddenelem); |