--- loncom/interface/londocs.pm 2013/05/21 19:05:05 1.549
+++ loncom/interface/londocs.pm 2013/07/09 00:17:22 1.552
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.549 2013/05/21 19:05:05 raeburn Exp $
+# $Id: londocs.pm,v 1.552 2013/07/09 00:17:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2704,7 +2704,7 @@ sub editor {
}
$to_show .= &Apache::loncommon::start_scrollbox('400px','380px','200px','contentscroll')
.'
'
- .&mt('Currently no documents.')
+ .&mt('Currently empty')
.'
'
.&Apache::loncommon::end_scrollbox();
}
@@ -2717,7 +2717,7 @@ sub editor {
.'';
} else {
$to_show = ''
- .&mt('Currently no documents.')
+ .&mt('Currently empty')
.'
'
}
}
@@ -2802,8 +2802,30 @@ sub multiple_check_form {
}
sub process_file_upload {
- my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd) = @_;
+ my ($upload_output,$coursenum,$coursedom,$allfiles,$codebase,$uploadcmd,$crstype) = @_;
# upload a file, if present
+ my $filesize = length($env{'form.uploaddoc'});
+ if (!$filesize) {
+ $$upload_output = ''.
+ &mt('Unable to upload [_1]. (size = [_2] bytes)',
+ ''.$env{'form.uploaddoc.filename'}.'',
+ $filesize).'
'.
+ &mt('Either the file you attempted to upload was empty, or your web browser was unable to read its contents.').'
'.
+ '
';
+ return;
+ }
+ my $quotatype = 'unofficial';
+ if ($crstype eq 'Community') {
+ $quotatype = 'community';
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) {
+ $quotatype = 'official';
+ }
+ if (&Apache::loncommon::get_user_quota($coursenum,$coursedom,'course',$quotatype)) {
+ $filesize = int($filesize/1000); #expressed in kb
+ $$upload_output = &Apache::loncommon::excess_filesize_warning($coursenum,$coursedom,'course',
+ $env{'form.uploaddoc.filename'},$filesize,'upload');
+ return if ($$upload_output);
+ }
my ($parseaction,$showupload,$nextphase,$mimetype);
if ($env{'form.parserflag'}) {
$parseaction = 'parse';
@@ -3123,11 +3145,9 @@ ENDREM
push(@{$filtersref->{'canremove'}},$orderidx);
}
}
- unless ($isexternal) {
- $renamelink=(<$lt{'rn'}
ENDREN
- }
$line.=(<
@@ -4360,7 +4380,7 @@ sub handler {
# Process file upload - phase one - upload and parse primary file.
undef($hadchanges);
$uploadphase = &process_file_upload(\$upload_output,$coursenum,$coursedom,
- \%allfiles,\%codebase,$context);
+ \%allfiles,\%codebase,$context,$crstype);
if ($hadchanges) {
&mark_hash_old();
}