version 1.63, 2013/07/02 19:04:49
|
version 1.66, 2013/12/04 17:29:44
|
Line 201 sub phaseone {
|
Line 201 sub phaseone {
|
return; |
return; |
} |
} |
$filesize = int($filesize/1000); #expressed in kb |
$filesize = int($filesize/1000); #expressed in kb |
my $disk_quota = &Apache::loncommon::get_user_quota($uname,$udom,'author'); #expressed in Mb |
my $output = &Apache::loncommon::excess_filesize_warning($uname,$udom,'author', |
$disk_quota = int($disk_quota * 1000); |
$env{'form.upfile.filename'},$filesize,'upload'); |
my $londocroot = $Apache::lonnet::perlvar{'lonDocRoot'}; |
if ($output) { |
my $current_disk_usage = &Apache::lonnet::diskusage($udom,$uname,"$londocroot/priv/$udom/$uname"); |
$r->print($output.&earlyout($fn,$uname,$udom)); |
if (($current_disk_usage + $filesize) > $disk_quota){ |
|
$r->print('<span class="LC_warning">'. |
|
&mt('Unable to upload [_1]. (size = [_2] kilobytes). Disk quota will be exceeded.','<span class="LC_filename">'.$env{'form.upfile.filename'}.'</span>',$filesize).'</span>'. |
|
'<br />'.&mt('Disk quota is [_1] kilobytes. Your current disk usage is [_2] kilobytes.',$disk_quota,$current_disk_usage). |
|
'</p>'. |
|
&earlyout($fn,$uname,$udom)); |
|
return; |
return; |
} |
} |
|
|
# Split part that I can change from the part that I cannot change |
# Split part that I can change from the part that I cannot change |
my ($fn1,$fn2)=($fn=~/^(\/priv\/[^\/]+\/[^\/]+\/)(.*)$/); |
my ($fn1,$fn2)=($fn=~/^(\/priv\/[^\/]+\/[^\/]+\/)(.*)$/); |
# Display additional options for upload |
# Display additional options for upload |
Line 399 sub check_extension {
|
Line 393 sub check_extension {
|
if ($pathchg) { |
if ($pathchg) { |
if ($mode eq 'testbank') { |
if ($mode eq 'testbank') { |
$returnflag = 'embedded'; |
$returnflag = 'embedded'; |
$result .= '<p>'.&mt('Or [_1]continue[_2] the testbank import without modifying the references(s).','<a href="javascript:document.testbankForm.submit();">','</a>').'</p>'; |
$result .= '<p>'.&mt('Or [_1]continue[_2] the testbank import without modifying the reference(s).','<a href="javascript:document.testbankForm.submit();">','</a>').'</p>'; |
} |
} |
} |
} |
} |
} |