--- loncom/interface/londocs.pm 2012/04/05 15:22:39 1.480 +++ loncom/interface/londocs.pm 2012/04/16 19:31:57 1.482 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.480 2012/04/05 15:22:39 raeburn Exp $ +# $Id: londocs.pm,v 1.482 2012/04/16 19:31:57 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2432,10 +2432,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(); - $r->print(&Apache::loncommon::modify_html_refs('coursedoc',$destination, - $docuname,$docudom,undef, - $dir_root). - &return_to_editor()); + my $result = + &Apache::loncommon::modify_html_refs('coursedoc',$destination, + $docuname,$docudom,undef, + $dir_root); + $r->print($result.&return_to_editor()); } elsif ($env{'form.phase'} eq 'decompress_uploaded') { $uploadphase = 'decompress_phase_one'; $r->print(&decompression_phase_one(). @@ -3047,7 +3048,13 @@ sub decompression_phase_one { $error = &mt('Archive file "[_1]" not in the expected location.',$env{'form.archiveurl'}); } else { my $file = $1; - $output = &Apache::loncommon::process_decompression($docudom,$docuname,$file,$destination,$dir_root,$hiddenelem); + $output = + &Apache::loncommon::process_decompression($docudom,$docuname,$file, + $destination,$dir_root, + $hiddenelem); + if ($env{'form.autoextract_camtasia'}) { + $output .= &remove_archive($docudom,$docuname,$container); + } } if ($error) { $output .= '

'.&mt('Not extracted.').'
'. @@ -3062,12 +3069,12 @@ sub decompression_phase_one { sub decompression_phase_two { my ($destination,$dir_root,$londocroot,$docudom,$docuname,$container,$hiddenelem)= &decompression_info(); - my ($output,$url); + my $output; if ($env{'form.archivedelete'}) { - ($output,$url) = &remove_archive($docudom,$docuname,$container); + $output = &remove_archive($docudom,$docuname,$container); } $output .= - &Apache::loncommon::process_extracted_files('coursedocs',$docudom,$docuname,$url, + &Apache::loncommon::process_extracted_files('coursedocs',$docudom,$docuname, $destination,$dir_root,$hiddenelem); return $output; } @@ -3075,7 +3082,7 @@ sub decompression_phase_two { sub remove_archive { my ($docudom,$docuname,$container) = @_; my $map = $env{'form.folder'}.'.'.$container; - my ($output,$delwarning,$delresult,$url,$outcome); + my ($output,$delwarning,$delresult,$url); my ($errtext,$fatal) = &mapread($docuname,$docudom,$map); if ($fatal) { if ($container eq 'page') { @@ -3100,9 +3107,8 @@ sub remove_archive { $delwarning = &mt('An error occurred updating the contents of the current folder.'); } } else { - $outcome = 'ok'; + $delresult = &mt('Archive file removed.'); } - $delresult = &mt('Archive file removed.'); } } $env{'form.cmd'} = $currcmd; @@ -3117,7 +3123,7 @@ sub remove_archive { $delresult. '

'; } - return ($output,$url,$outcome); + return $output; } sub generate_admin_options { @@ -3166,7 +3172,7 @@ sub generate_edit_table { $activetab = $env{'form.active'}; } my $backicon = $iconpath.'clickhere.gif'; - my $backtext = &mt('Back to Overview'); + my $backtext = &mt('To Overview'); $form = '
'. '