--- loncom/interface/londocs.pm 2017/05/10 20:32:27 1.629 +++ loncom/interface/londocs.pm 2017/05/10 23:34:15 1.630 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.629 2017/05/10 20:32:27 raeburn Exp $ +# $Id: londocs.pm,v 1.630 2017/05/10 23:34:15 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -603,9 +603,9 @@ sub recurse_html { } else { $relfile = $dependency; $depurl = $currurlpath; - $depurl =~ s{[^/]+$}{}; + $depurl =~ s{[^/]+$}{}; $depurl .= $dependency; - ($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); + ($newcontainer) = ($depurl =~ m{^\Q$prefix\E(.+)$}); } next if ($relfile eq ''); my $newname = $replacehash->{$container}; @@ -697,7 +697,7 @@ sub group_import { } elsif ($residx) { $toolhash{'target'} = $toolsettings{'target'}; if ($toolhash{'target'} eq 'window') { - foreach my $item ('width','height') { + foreach my $item ('width','height') { $toolhash{$item} = $toolsettings{$item}; } } @@ -812,7 +812,7 @@ $initialtext END $env{'form.output'}=$newhtml; - my $result = + my $result = &Apache::lonnet::finishuserfileupload($coursenum,$coursedom, 'output', "$filepath/$residx/$fname.html"); @@ -971,7 +971,7 @@ sub docs_change_log { if ($supplementalflag) { $tid = 2; } - my ($breadcrumbtrail) = + my ($breadcrumbtrail) = &Apache::lonhtmlcommon::docs_breadcrumbs($allowed,$crstype,1); $r->print($breadcrumbtrail. &generate_edit_table($tid,\%orderhash,undef,$iconpath,$jumpto, @@ -1170,7 +1170,7 @@ sub update_paste_buffer { foreach my $suffix (@currpaste) { my $cid = $env{'docs.markedcopy_crs_'.$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$/) && ($url ne '')) { $pasteurls{$cid.'_'.$url.'_'.$mapidx} = 1; @@ -1865,7 +1865,7 @@ sub do_paste_from_buffer { } } unless (($env{'form.docs.markedcopy_options_'.$suffix} eq 'move') && (!$fromothercrs)) { - my (%lockerr,$msg); + my (%lockerr,$msg); my ($newurl,$result,$errtext) = &dbcopy(\%info,$coursedom,$coursenum,\%lockerr); if ($result eq 'ok') { @@ -1924,8 +1924,8 @@ sub do_paste_from_buffer { if ($newdocsdir eq '') { $newdocsdir = 'default'; } - if (($prefixchg{$suffix}) || - ($srcdom{$suffix} ne $coursedom) || + if (($prefixchg{$suffix}) || + ($srcdom{$suffix} ne $coursedom) || ($srcnum{$suffix} ne $coursenum) || ($env{'form.docs.markedcopy_options_'.$suffix} ne 'move')) { my $newpath = "$newprefix/$newdocsdir/$newidx/$rem"; @@ -2911,7 +2911,7 @@ sub update_parameter { 'randomorder' => {}, ); foreach my $which (keys(%allchecked)) { - $env{'form.all'.$which} =~ s/,$//; + $env{'form.all'.$which} =~ s/,$//; if ($which eq 'randompick') { foreach my $item (split(/,/,$env{'form.all'.$which})) { my ($res,$value) = split(/:/,$item); @@ -3441,11 +3441,11 @@ sub editor { if (@allidx > 0) { my $path; if ($env{'form.folderpath'}) { - $path = + $path = &HTML::Entities::encode($env{'form.folderpath'},'<>&"'); } if (@allidx > 1) { - $to_show .= + $to_show .= &Apache::loncommon::continue_data_table_row(). ' '. ''. @@ -3693,7 +3693,7 @@ sub process_file_upload { my $uploadphase = 'upload_embedded'; my $primaryurl = &HTML::Entities::encode($url,'<>&"'); my $state = &embedded_form_elems($uploadphase,$primaryurl,$newidx); - my ($embedded,$num) = + my ($embedded,$num) = &Apache::loncommon::ask_for_embedded_content( '/adm/coursedocs',$state,$allfiles,$codebase,{'docs_url' => $url}); if ($embedded) { @@ -4182,7 +4182,7 @@ END } } } - + # Append randompick number, hidden, and encrypted with ":" to foldername, # so it gets transferred between levels $folderpath.=$containerarg.'&'.$foldername. @@ -4243,10 +4243,10 @@ $form_end; } my ($tdalign,$tdwidth); if ($allowed) { - my $fileloc = + my $fileloc = &Apache::lonnet::declutter(&Apache::lonnet::filelocation('',$orig_url)); if ($isexternal) { - ($editlink,$extresform) = + ($editlink,$extresform) = &Apache::lonextresedit::extedit_form(0,$residx,$orig_url,$title,$pathitem, undef,undef,undef,undef,undef,undef, undef,$disabled); @@ -4263,7 +4263,7 @@ $form_end; if ($supplementalflag) { $suppanchor = $anchor; } - my $jscall = + my $jscall = &Apache::lonhtmlcommon::jump_to_editres($cfile,$home, $switchserver, $forceedit, @@ -4475,7 +4475,7 @@ sub new_timebased_suffix { } } if ($freedlock ne 'ok') { - $locknotfreed = + $locknotfreed = '
'. &mt('There was a problem removing a lockfile.').' '; if ($type eq 'paste') { @@ -5551,7 +5551,7 @@ sub handler { my ($destination,$dir_root) = &embedded_destination(); my $url_root = '/uploaded/'.$docudom.'/'.$docuname; my $actionurl = '/adm/coursedocs'; - my ($result,$flag) = + my ($result,$flag) = &Apache::loncommon::upload_embedded('coursedoc',$destination, $docuname,$docudom,$dir_root,$url_root,undef,undef,undef,$state, $actionurl); @@ -5562,11 +5562,11 @@ sub handler { my $docuname=$env{'course.'.$env{'request.course.id'}.'.num'}; my $docudom=$env{'course.'.$env{'request.course.id'}.'.domain'}; my ($destination,$dir_root) = &embedded_destination(); - my $result = + my $result = &Apache::loncommon::modify_html_refs('coursedoc',$destination, $docuname,$docudom,undef, $dir_root); - $r->print($result.&return_to_editor()); + $r->print($result.&return_to_editor()); } elsif ($env{'form.phase'} eq 'decompress_uploaded') { $uploadphase = 'decompress_phase_one'; $r->print(&decompression_phase_one(). @@ -5592,7 +5592,7 @@ sub handler { 'impo' => 'Import', 'lnks' => 'Import from Stored Links', 'impm' => 'Import from Assembled Map', - 'imcr' => 'Import from Course Resources', + 'imcr' => 'Import from Course Resources', 'extr' => 'External Resource', 'extt' => 'External Tool', 'selm' => 'Select Map', @@ -5603,7 +5603,7 @@ sub handler { 'navc' => 'Table of Contents', 'sipa' => 'Simple Course Page', 'sipr' => 'Simple Problem', - 'webp' => 'Blank Web Page (editable)', + 'webp' => 'Blank Web Page (editable)', 'stpr' => 'Standard Problem', 'news' => 'New sub-directory', 'crpr' => 'Create Problem', @@ -6361,7 +6361,7 @@ unless ($container eq 'page') {