--- loncom/publisher/lonupload.pm 2003/11/08 11:04:52 1.22 +++ loncom/publisher/lonupload.pm 2003/11/08 11:11:01 1.23 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.22 2003/11/08 11:04:52 albertel Exp $ +# $Id: lonupload.pm,v 1.23 2003/11/08 11:11:01 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -94,32 +94,34 @@ sub phaseone { &Debug($r, "Filename for upload: $fn"); if (($fn) && ($fn!~/\/$/)) { - $r->print('
'. - ''. - ''. - ''. - &mt('Store uploaded file as ')."/priv/$uname/". - '
'. - '
'); + $r->print('
'. + ''. + ''. + ''.&mt('Store uploaded file as '). + "/priv/$uname/". + '
'. + '
'); # Check for bad extension and warn user if ($fn=~/\.(\w+)$/ && (&Apache::loncommon::fileembstyle($1) eq 'hdn')) { - $r->print(''.&mt('The extension on this file,'). + $r->print(''.&mt('The extension on this file,'). ' "'.$1.'"'.&mt(', is reserved internally by LON-CAPA.'). - '
'.&mt('Please change the extension.').'
'); + '
'.&mt('Please change the extension.').'
'); } elsif($fn=~/\.(\w+)$/ && !defined(&Apache::loncommon::fileembstyle($1))) { - $r->print(''.&mt('The extension on this file,'). + $r->print(''.&mt('The extension on this file,'). ' "'.$1.'"'.&mt(', is not recognized by LON-CAPA.'). - '
'.&mt('Please change the extension.'). + '
'.&mt('Please change the extension.'). '
'); } } else { - $r->print(''.&mt('Illegal filename.').''); + $r->print(''.&mt('Illegal filename.').''); } } else { - $r->print(''.&mt('No upload file specified.').''); + $r->print(''.&mt('No upload file specified.').''); } } @@ -141,13 +143,13 @@ sub phasetwo { my $datatoken=$ENV{'form.datatoken'}; if (($fn) && ($datatoken)) { if ((-e $target) && ($ENV{'form.override'} ne 'Yes')) { - $r->print('
'. + $r->print(''. &mt('File').' '.$fn.' '. &mt('exists. Overwrite?').' '. - ''. - ''. - ''. - '
'); + ''. + ''. + ''. + ''); } else { my $source=$r->dir_config('lonDaemons').'/tmp/'.$datatoken.'.tmp'; # Check for bad extension and disallow upload @@ -155,7 +157,7 @@ sub phasetwo { (&Apache::loncommon::fileembstyle($1) eq 'hdn')) { $r->print(&mt('File').' '.$fn.' '. &mt('could not be copied.').'
'. - ''. + ''. &mt('The extension on this file is reserved internally by LON-CAPA.'). ''); $r->print('

'. @@ -164,35 +166,35 @@ sub phasetwo { !defined(&Apache::loncommon::fileembstyle($1))) { $r->print(&mt('File').' '.$fn.' '. &mt('could not be copied.').'
'. - ''. + ''. &mt('The extension on this file is not recognized by LON-CAPA.'). ''); - $r->print('

'. + $r->print('
'. &mt('Back to Directory').''); } elsif (-d $target) { $r->print('File '.$fn.' could not be copied.
'. - ''. + ''. &mt('The target is an existing directory.'). - ''); - $r->print('

'. + '
'); + $r->print('
'. &mt('Back to Directory').''); } elsif (copy($source,$target)) { chmod(0660, $target); # Set permissions to rw-rw---. $r->print(&mt('File copied.')); - $r->print('

'. + $r->print('
'. &mt('View file').''); - $r->print('

'. - &mt('Back to Directory').''); + $r->print(''. + &mt('Back to Directory').'
'); } else { $r->print('Failed to copy: '.$!); - $r->print('

'. + $r->print('
'. &mt('Back to Directory').''); } } } else { - $r->print(''. + $r->print(''. &mt('Please use browser "Back" button and pick a filename'). - '

'); + '
>'); } } else { $r->print(''.