[LON-CAPA-cvs] cvs: loncom(version_2_8_X) /publisher lonupload.pm
raeburn
raeburn@source.lon-capa.org
Fri, 12 Dec 2008 02:42:49 -0000
raeburn Fri Dec 12 02:42:49 2008 EDT
Modified files: (Branch: version_2_8_X)
/loncom/publisher lonupload.pm
Log:
- Backport 1.41, 1.42.
Index: loncom/publisher/lonupload.pm
diff -u loncom/publisher/lonupload.pm:1.38 loncom/publisher/lonupload.pm:1.38.2.1
--- loncom/publisher/lonupload.pm:1.38 Fri Jul 18 03:27:48 2008
+++ loncom/publisher/lonupload.pm Fri Dec 12 02:42:49 2008
@@ -2,7 +2,7 @@
# The LearningOnline Network with CAPA
# Handler to upload files into construction space
#
-# $Id: lonupload.pm,v 1.38 2008/07/18 03:27:48 raeburn Exp $
+# $Id: lonupload.pm,v 1.38.2.1 2008/12/12 02:42:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -98,10 +98,11 @@
'<input type="hidden" name="datatoken" value="'.
&upfile_store.'" />'.
'<input type="hidden" name="uploaduname" value="'.$uname.
- '" />'.&mt('Save uploaded file as ').
- "<span class='LC_filename'>/priv/$uname/</span>".
+ '" />'.&mt('Save uploaded file as [_1]',
+ '<span class="LC_filename">/priv/'.$uname.'/</span>'.
'<input type="text" size="50" name="filename" value="'.$fn.
- '" /><br />'.
+ '" />').
+ '<br />'.
'<br />'.&mt('Choose file type:').'
<select name="filetype">
<option value="standard" selected>'.&mt('Regular file').'
@@ -115,15 +116,16 @@
# Check for bad extension and warn user
if ($fn=~/\.(\w+)$/ &&
(&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
- $r->print('<span class="LC_error">'.&mt('The extension on this file,').
- ' "'.$1.'"'.&mt(', is reserved internally by LON-CAPA.').
- ' <br />'.&mt('Please change the extension.').'</span>');
+ $r->print('<p class="LC_error">'
+ .&mt('The extension on this file, [_1], is reserved internally by LON-CAPA.','"'.$1.'"' ).
+ .' <br />'.&mt('Please change the extension.')
+ .'</p>');
} elsif($fn=~/\.(\w+)$/ &&
!defined(&Apache::loncommon::fileembstyle($1))) {
- $r->print('<span class="LC_error">'.&mt('The extension on this file,').
- ' "'.$1.'"'.&mt(', is not recognized by LON-CAPA.').
- ' <br />'.&mt('Please change the extension.').
- '</span>');
+ $r->print('<p class="LC_error">'
+ .&mt('The extension on this file, [_1], is not recognized by LON-CAPA.','"'.$1.'"')
+ .' <br />'.&mt('Please change the extension.')
+ .'</p>');
}
} else {
$r->print('<span class="LC_error">'.&mt('Illegal filename.').'</span>');
@@ -203,22 +205,22 @@
(&Apache::loncommon::fileembstyle($1) eq 'hdn')) {
$result .= &mt('File [_1] could not be copied.',
'<span class="LC_filename">'.$fn.'</span> ').
- '<br /><span class="LC_error">'.
+ '<p class="LC_error">'.
&mt('The extension on this file is reserved internally by LON-CAPA.').
- '</span>';
+ '</p>';
} elsif ($fn=~/\.(\w+)$/ &&
!defined(&Apache::loncommon::fileembstyle($1))) {
$result .= &mt('File [_1] could not be copied.',
'<span class="LC_filename">'.$fn.'</span> ').
- '<br /><span class="LC_error">'.
+ '<p class="LC_error">'.
&mt('The extension on this file is not recognized by LON-CAPA.').
- '</span>';
+ '</p>';
} elsif (-d $target) {
$result .= &mt('File [_1] could not be copied.',
'<span class="LC_filename">'.$fn.'</span>').
- '<br /><span class="LC_error">'.
+ '<p class="LC_error">'.
&mt('The target is an existing directory.').
- '</span>';
+ '</p>';
} elsif (copy($source,$target)) {
chmod(0660, $target); # Set permissions to rw-rw---.
if ($mode eq 'testbank' || $mode eq 'imsimport') {