version 1.1178, 2014/02/23 20:52:58
|
version 1.1180, 2014/03/09 15:49:48
|
Line 8970 sub excess_filesize_warning {
|
Line 8970 sub excess_filesize_warning {
|
} |
} |
$disk_quota = int($disk_quota * 1000); |
$disk_quota = int($disk_quota * 1000); |
if (($current_disk_usage + $filesize) > $disk_quota) { |
if (($current_disk_usage + $filesize) > $disk_quota) { |
return '<p><span class="LC_warning">'. |
return '<p class="LC_warning">'. |
&mt("Unable to $action [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.", |
&mt("Unable to $action [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.", |
'<span class="LC_filename">'.$filename.'</span>',$filesize).'</span>'. |
'<span class="LC_filename">'.$filename.'</span>',$filesize).'</p>'. |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
'<p>'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
$disk_quota,$current_disk_usage). |
$disk_quota,$current_disk_usage). |
'</p>'; |
'</p>'; |
} |
} |
Line 10920 sub check_for_upload {
|
Line 10920 sub check_for_upload {
|
if ($currsize < $filesize) { |
if ($currsize < $filesize) { |
my $extra = $filesize - $currsize; |
my $extra = $filesize - $currsize; |
if (($current_disk_usage + $extra) > $disk_quota) { |
if (($current_disk_usage + $extra) > $disk_quota) { |
my $msg = '<span class="LC_error">'. |
my $msg = '<p class="LC_warning">'. |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded if existing (smaller) file with same name (size = [_3] kilobytes) is replaced.', |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded if existing (smaller) file with same name (size = [_3] kilobytes) is replaced.', |
'<span class="LC_filename">'.$fname.'</span>',$filesize,$currsize).'</span>'. |
'<span class="LC_filename">'.$fname.'</span>',$filesize,$currsize).'</p>'. |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
'<p>'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.', |
$disk_quota,$current_disk_usage); |
$disk_quota,$current_disk_usage).'</p>'; |
return ('will_exceed_quota',$msg); |
return ('will_exceed_quota',$msg); |
} |
} |
} |
} |
Line 10933 sub check_for_upload {
|
Line 10933 sub check_for_upload {
|
} |
} |
} |
} |
if (($current_disk_usage + $filesize) > $disk_quota){ |
if (($current_disk_usage + $filesize) > $disk_quota){ |
my $msg = '<span class="LC_error">'. |
my $msg = '<p class="LC_warning">'. |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$fname.'</span>',$filesize).'</span>'. |
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$fname.'</span>',$filesize).'</p>'. |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage); |
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage); |
return ('will_exceed_quota',$msg); |
return ('will_exceed_quota',$msg); |
} elsif ($found_file) { |
} elsif ($found_file) { |
if ($locked_file) { |
if ($locked_file) { |
my $msg = '<span class="LC_error">'; |
my $msg = '<p class="LC_warning">'; |
$msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>'); |
$msg .= &mt('Unable to upload [_1]. A locked file by that name was found in [_2].','<span class="LC_filename">'.$fname.'</span>','<span class="LC_filename">'.$port_path.$env{'form.currentpath'}.'</span>'); |
$msg .= '</span><br />'; |
$msg .= '</p>'; |
$msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>'); |
$msg .= &mt('You will be able to rename or delete existing [_1] after a grade has been assigned.','<span class="LC_filename">'.$fname.'</span>'); |
return ('file_locked',$msg); |
return ('file_locked',$msg); |
} else { |
} else { |
my $msg = '<span class="LC_error">'; |
my $msg = '<p class="LC_error">'; |
$msg .= &mt(' A file by that name: [_1] was found in [_2].','<span class="LC_filename">'.$fname.'</span>',$port_path.$env{'form.currentpath'}); |
$msg .= &mt(' A file by that name: [_1] was found in [_2].','<span class="LC_filename">'.$fname.'</span>',$port_path.$env{'form.currentpath'}); |
$msg .= '</span>'; |
$msg .= '</p>'; |
return ('existingfile',$msg); |
return ('existingfile',$msg); |
} |
} |
} |
} |
Line 11272 sub decompress_uploaded_file {
|
Line 11272 sub decompress_uploaded_file {
|
sub process_decompression { |
sub process_decompression { |
my ($docudom,$docuname,$file,$destination,$dir_root,$hiddenelem) = @_; |
my ($docudom,$docuname,$file,$destination,$dir_root,$hiddenelem) = @_; |
my ($dir,$error,$warning,$output); |
my ($dir,$error,$warning,$output); |
if ($file !~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/) { |
if ($file !~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/i) { |
$error = &mt('Filename not a supported archive file type.'). |
$error = &mt('Filename not a supported archive file type.'). |
'<br />'.&mt('Filename should end with one of: [_1].', |
'<br />'.&mt('Filename should end with one of: [_1].', |
'.zip, .tar, .bz2, .gz, .tar.gz, .tar.bz2, .tgz'); |
'.zip, .tar, .bz2, .gz, .tar.gz, .tar.bz2, .tgz'); |