--- loncom/interface/londocs.pm 2005/06/13 20:23:53 1.189 +++ loncom/interface/londocs.pm 2005/06/17 16:40:28 1.190 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.189 2005/06/13 20:23:53 albertel Exp $ +# $Id: londocs.pm,v 1.190 2005/06/17 16:40:28 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1178,7 +1178,7 @@ sub process_file_upload { my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase) = @_; # upload a file, if present my $parseaction; - if ($env{'form.parserflag'}) { + if ($env{'form.parserflag'}) { $parseaction = 'parse'; } my $phase_status; @@ -1212,7 +1212,9 @@ sub process_file_upload { # probably the only place in the system where this should be "1" my $newidx=&Apache::lonratedt::getresidx(); $destination .= $newidx; - my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination,$parseaction,$allfiles,$codebase); + my $url=&Apache::lonnet::userfileupload('uploaddoc',1,$destination, + $parseaction,$allfiles, + $codebase); my $ext='false'; if ($url=~/^http\:\/\//) { $ext='true'; } $url=~s/\:/\:/g; @@ -1227,15 +1229,15 @@ sub process_file_upload { $Apache::lonratedt::resources[$newidx]= $comment.':'.$url.':'.$ext.':normal:res'; - $Apache::lonratedt::order[$#Apache::lonratedt::order+1]= - $newidx; - ($errtext,$fatal)=&storemap($coursenum,$coursedom,$folder.'.'.$container); + $Apache::lonratedt::order[$#Apache::lonratedt::order+1]= $newidx; + ($errtext,$fatal)=&storemap($coursenum,$coursedom, + $folder.'.'.$container); if ($fatal) { $$upload_output .= '
'.$errtext.'
'; return 'failed'; } else { if ($parseaction eq 'parse') { - my $total_embedded = keys %{$allfiles}; + my $total_embedded = keys(%{$allfiles}); if ($total_embedded > 0) { my $num = 0; $$upload_output .= 'This file contains embedded multimedia objects, which need to be uploaded to LON-CAPA.'.$embed_file.
- '
- ';
+ '
+ ';
my $attrib;
if (@{$$allfiles{$embed_file}} > 1) {
$attrib = join(':',@{$$allfiles{$embed_file}});
@@ -2242,7 +2244,9 @@ ENDNEWSCRIPT
if ($allowed) {
if (($env{'form.uploaddoc.filename'}) && ($env{'form.cmd'}=~/^upload_(\w+)/)) {
# Process file upload - phase one - upload and parse primary file.
- $upload_result = &process_file_upload(\$upload_output,$coursenum,$coursedom,\%allfiles,\%codebase);
+ $upload_result = &process_file_upload(\$upload_output,$coursenum,
+ $coursedom,\%allfiles,
+ \%codebase);
if ($upload_result eq 'phasetwo') {
$r->print($upload_output);
}
@@ -2445,8 +2449,9 @@ $uploadtag
|