'.'An errror occured ('.$result.
+ $r->print(''.'An error occurred ('.$result.
') while trying to upload '.&display_file().'
');
$r->print(&done('Back',$url));
} else {
@@ -1829,8 +1832,12 @@ sub upload {
STATE
- $r->print("Completed upload of the file. This file contained references to other files. You can upload these now:
");
- $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,{'error_on_invalid_names' => 1}));
+ $r->print("".&mt("Reference Warning")."
");
+ $r->print("".&mt("Completed upload of the file. This file contained references to other files. You must upload the referenced files or else the uploaded file may not work properly.")."
");
+ $r->print("".&mt("Please select the locations from which the referenced files are to be uploaded.")."
");
+ $r->print(&Apache::londocs::ask_for_embedded_content('/adm/portfolio',$state,\%allfiles,\%codebase,
+ {'error_on_invalid_names' => 1,
+ 'ignore_remote_references' => 1,}));
$r->print('Or '.&done('Return to directory listing',$url).'
');
} else {
$r->print(&done(undef,$url));
@@ -1842,11 +1849,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);
@@ -1868,8 +1880,8 @@ sub upload_embedded {
&Apache::lonnet::userfileupload('embedded_item_'.$i,'',
$port_path.$path);
if ($result !~ m|^/uploaded/|) {
- $r->print(''.'An errror occured ('.$result.
- ') while trying to upload '.&display_file($path,$fname).'
');
+ $r->print(''.'An error occurred ('.$result.
+ ') while trying to upload '.$orig_uploaded_filename.' for embedded element '.$env{'form.embedded_orig_'.$i}.'
');
next;
} else {
$r->print(" Uploaded ".
@@ -1919,7 +1931,7 @@ sub lock_info {
}
}
}
- $r->print(&done('Back',$url));
+ $r->print(&done(&mt('Back'),$url));
return 'ok';
}
@@ -1943,20 +1955,20 @@ sub createdir {
}
}
if ($found_file){
- $r->print(''.'Unable to create a directory named '.$newdir.
- ' a file or directory by that name already exists.
');
+ $r->print(''.&mt('Unable to create a directory named').' '.$newdir.
+ '. '.&mt('A file or directory by that name already exists.').'
');
} else {
my ($uname,$udom) = &get_name_dom();
my $port_path = &get_port_path();
my $result=&Apache::lonnet::mkdiruserfile($uname,$udom,
$port_path.$env{'form.currentpath'}.$newdir);
if ($result ne 'ok') {
- $r->print(''.'An errror occured ('.$result.
+ $r->print(''.'An error occurred ('.$result.
') while trying to create a new directory '.&display_file().'
');
}
}
if ($newdir ne $env{'form.newdir'}) {
- $r->print("The new directory name was changed from:
".$env{'form.newdir'}." to $newdir ");
+ $r->print(&mt("The new directory name was changed from:")."
".$env{'form.newdir'}." ".&mt('to')." $newdir ");
}
$r->print(&done(undef,$url));
}
@@ -2151,16 +2163,16 @@ sub handler {
$env{'request.course.id'}.'/'.$group))) {
$portfolio_root = &get_portfolio_root();
} else {
- $r->print('You do not have the privileges required to access the shared files space for this group.');
+ $r->print(&mt('You do not have the privileges required to access the shared files space for this group.'));
$earlyout = 1;
}
} else {
- $r->print('Not a valid group for this course');
+ $r->print(&mt('Not a valid group for this course'));
$earlyout = 1;
}
$title = &mt('Group files').' for '.$group;
} else {
- $r->print('Invalid group');
+ $r->print(&mt('Invalid group'));
$earlyout = 1;
}
if ($earlyout) { return OK; }
@@ -2216,16 +2228,14 @@ sub handler {
return OK;
}
if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){
- $r->print(''.
- 'No file was selected to upload.'.
- 'To upload a file, click Browse...'.
- ', select a file, then click Upload.'.
- '');
+ $r->print('');
+ $r->print(&mt('No file was selected to upload. '));
+ $r->print(&mt('To upload a file, click Browse... select a file, then click Upload.'));
+ $r->print('');
}
if ($env{'form.meta'}) {
&open_form($r,$url);
-# $r->print(&edit_meta_data($r, $env{'form.currentpath'}.$env{'form.selectfile'}));
- $r->print('Edit the meta data
');
+ $r->print(&mt('Edit the meta data').'
');
&close_form($r,$url);
}
if ($env{'form.store'}) {