--- loncom/interface/portfolio.pm 2007/06/11 21:27:23 1.183
+++ loncom/interface/portfolio.pm 2007/07/10 20:57:10 1.184.2.1
@@ -1,7 +1,7 @@
# The LearningOnline Network
# portfolio browser
#
-# $Id: portfolio.pm,v 1.183 2007/06/11 21:27:23 albertel Exp $
+# $Id: portfolio.pm,v 1.184.2.1 2007/07/10 20:57:10 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1733,7 +1733,8 @@ ENDSMP
fileList = fileList + document.forms.checkselect.currentpath.value + document.forms.checkselect[i].value + "," ;
}
}
- opener.document.forms.lonhomework.$env{'form.fieldname'}.value=fileList;
+ var hwfield = opener.document.getElementsByName('$env{'form.fieldname'}');
+ hwfield[0].value = fileList;
self.close();
}
@@ -1846,11 +1847,16 @@ sub upload_embedded {
my ($r,$url,$group)=@_;
for (my $i=0; $i<$env{'form.number_embedded_items'}; $i++) {
next if (!exists($env{'form.embedded_item_'.$i.'.filename'}));
-
+ my $orig_uploaded_filename =
+ $env{'form.embedded_item_'.$i.'.filename'};
+
$env{'form.embedded_orig_'.$i} =
&unescape($env{'form.embedded_orig_'.$i});
my ($path,$fname) =
($env{'form.embedded_orig_'.$i} =~ m{(.*/)([^/]*)});
+ # no path, whole string is fname
+ if (!$fname) { $fname = $env{'form.embedded_orig_'.$i} };
+
$path = $env{'form.currentpath'}.$path;
$fname = &Apache::lonnet::clean_filename($fname);
@@ -1873,7 +1879,7 @@ sub upload_embedded {
$port_path.$path);
if ($result !~ m|^/uploaded/|) {
$r->print(''.'An error occurred ('.$result.
- ') while trying to upload '.&display_file($path,$fname).'
');
+ ') while trying to upload '.$orig_uploaded_filename.' for embedded element '.$env{'form.embedded_orig_'.$i}.'
');
next;
} else {
$r->print("
Uploaded ".