--- loncom/publisher/loncfile.pm 2007/04/26 21:17:16 1.83
+++ loncom/publisher/loncfile.pm 2009/03/26 16:50:12 1.94
@@ -9,7 +9,7 @@
# and displays a page showing the results of the action.
#
#
-# $Id: loncfile.pm,v 1.83 2007/04/26 21:17:16 albertel Exp $
+# $Id: loncfile.pm,v 1.94 2009/03/26 16:50:12 bisitz Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -109,6 +109,17 @@ sub Debug {
}
}
+sub done {
+ my ($url)=@_;
+ my $done=&mt("Done");
+ return(< '.&mt('Warning: target file exists, and has been published!').' '.&mt('Warning: a published file of this names exists.').' '.&mt("Warning: a published $published_type of this name exists.").' '.&mt("Error: a published $published_type of this name exists.").' ".&mt('You have requested to create file in directory [_1] which doesn\'t exist. The requested directory path has been removed from the requested file name.','"'.$newpath.'"')." '
+ .&mt("You have requested to create file in directory [_1] which doesn't exist. The requested directory path has been removed from the requested file name."
+ ,'"'.&display($newpath).'"')
+ .' ".&mt('Invalid characters in requested name have been removed.')." '.$action.' '.&display($fn).
- '
'
+ .&mt('[_1](name).(number).(extension)[_2] not allowed.','','')
+ .'
'
+ .&mt('Removing the [_1].number.[_2] from requested filename.','','')
+ .'');
+ $dest =~ s/\.(\d+)(\.\w+)$/$2/;
+ }
if ($foundbad) {
$request->print("'.&mt('Done').'
');
+ $request->print(&done(&url($fn)));
}
=pod
@@ -508,7 +546,7 @@ sub Rename1 {
$request->print('
to '.&display($newfilename).'?
'.&mt('No new filename specified.').'
'); @@ -674,9 +712,9 @@ causes the newdir operation to transitio sub NewDir1 { my ($request, $username, $domain, $fn, $newfilename, $mode) = @_; - my ($type, $result)=&exists($username,$domain,$newfilename); + my ($type, $result)=&exists($username,$domain,$newfilename,'directory'); $request->print($result); - if ($result) { + if ($type eq 'error') { $request->print(''); } else { if ($mode eq 'testbank') { @@ -852,6 +890,7 @@ sub phaseone { $env{'form.action'} eq 'newsequencefile' || $env{'form.action'} eq 'newrightsfile' || $env{'form.action'} eq 'newstyfile' || + $env{'form.action'} eq 'newtaskfile' || $env{'form.action'} eq 'newlibraryfile' || $env{'form.action'} eq 'Select Action') { my $empty=&mt('Type Name Here'); @@ -1107,8 +1146,8 @@ sub NewDir2 { sub decompress2 { my ($r, $user, $dir, $file) = @_; - &Apache::lonnet::appenv('cgi.file' => $file); - &Apache::lonnet::appenv('cgi.dir' => $dir); + &Apache::lonnet::appenv({'cgi.file' => $file}); + &Apache::lonnet::appenv({'cgi.dir' => $dir}); my $result=&Apache::lonnet::ssi_body('/cgi-bin/decompress.pl'); $r->print($result); &Apache::lonnet::delenv('cgi.file'); @@ -1235,7 +1274,7 @@ sub phasetwo { $r->print('' + .&mt('Co-Author [_1]:[_2]',$uname,$udom) + .'
' + ); } @@ -1351,6 +1391,7 @@ function writeDone() { $env{'form.action'} eq 'newsequencefile' || $env{'form.action'} eq 'newrightsfile' || $env{'form.action'} eq 'newstyfile' || + $env{'form.action'} eq 'newtaskfile' || $env{'form.action'} eq 'newlibraryfile' || $env{'form.action'} eq 'Select Action' ) { $r->print('