--- loncom/publisher/loncfile.pm 2004/02/17 22:06:10 1.51
+++ loncom/publisher/loncfile.pm 2004/03/02 16:48:27 1.52
@@ -9,7 +9,7 @@
# and displays a page showing the results of the action.
#
#
-# $Id: loncfile.pm,v 1.51 2004/02/17 22:06:10 raeburn Exp $
+# $Id: loncfile.pm,v 1.52 2004/03/02 16:48:27 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -406,13 +406,15 @@ new filename relative to the current dir
=cut
sub Rename1 {
- my ($request, $user, $domain, $fn, $newfilename) = @_;
+ my ($request, $user, $domain, $fn, $newfilename, $style) = @_;
if(-e $fn) {
if($newfilename) {
# is dest a dir
- if (-d $newfilename) {
- if ($fn =~ m|/([^/]*)$|) { $newfilename .= '/'.$1; }
+ if ($style eq 'move') {
+ if (-d $newfilename) {
+ if ($fn =~ m|/([^/]*)$|) { $newfilename .= '/'.$1; }
+ }
}
if ($newfilename =~ m|/[^\.]+$|) {
#no extension add on original extension
@@ -441,9 +443,15 @@ sub Rename1 {
'
'.&mt('Cancel').'');
return;
}
+ my $action;
+ if ($style eq 'rename') {
+ $action=&mt('Rename');
+ } else {
+ $action=&mt('Move');
+ }
$request->print('
'.&mt('Rename').' '.&display($fn). + '" />
'.$action.' '.&display($fn).
'
to '.&display($newfilename).'?