--- loncom/interface/londocs.pm 2014/01/12 22:34:51 1.576
+++ loncom/interface/londocs.pm 2014/04/02 22:19:56 1.581
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.576 2014/01/12 22:34:51 raeburn Exp $
+# $Id: londocs.pm,v 1.581 2014/04/02 22:19:56 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -46,6 +46,7 @@ use Apache::lonsimplepage();
use HTML::Entities;
use HTML::TokeParser;
use GDBM_File;
+use File::MMagic;
use Apache::lonlocal;
use Cwd;
use LONCAPA qw(:DEFAULT :match);
@@ -301,14 +302,14 @@ ENDJS
if ($contents{content}) {
$content .= '
-
Content
'.
+'.&mt('Content').'
'.
$contents{content}.'
';
}
if ($contents{webreferences}) {
$content .= '
-
Web References
'.
+'.&mt('Web References').'
'.
$contents{webreferences}.'
';
}
@@ -3174,7 +3175,7 @@ sub process_file_upload {
my $quotatype = 'unofficial';
if ($crstype eq 'Community') {
$quotatype = 'community';
- } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.instcode'}) {
+ } elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.coursecode'}) {
$quotatype = 'official';
} elsif ($env{'course.'.$coursedom.'_'.$coursenum.'.internal.textbook'}) {
$quotatype = 'textbook';
@@ -3182,7 +3183,8 @@ sub process_file_upload {
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');
+ $env{'form.uploaddoc.filename'},$filesize,
+ 'upload',$quotatype);
return if ($$upload_output);
}
my ($parseaction,$showupload,$nextphase,$mimetype);
@@ -3280,7 +3282,8 @@ sub process_file_upload {
$$upload_output .= &mt('No embedded items identified').'
';
}
$$upload_output = ''.$$upload_output.'
';
- } elsif (&Apache::loncommon::is_archive_file($mimetype)) {
+ } elsif ((&Apache::loncommon::is_archive_file($mimetype)) &&
+ ($env{'form.uploaddoc.filename'} =~ /\.(zip|tar|bz2|gz|tar.gz|tar.bz2|tgz)$/i)) {
$nextphase = 'decompress_uploaded';
my $position = scalar(@LONCAPA::map::order)-1;
my $noextract = &return_to_editor();
@@ -3342,7 +3345,7 @@ sub is_supplemental_title {
sub entryline {
my ($index,$title,$url,$folder,$allowed,$residx,$coursenum,$coursedom,
$crstype,$pathitem,$supplementalflag,$container,$filtersref,$currgroups)=@_;
- my ($foldertitle,$renametitle);
+ my ($foldertitle,$renametitle,$oldtitle);
if (&is_supplemental_title($title)) {
($title,$foldertitle,$renametitle) = &Apache::loncommon::parse_supplemental_title($title);
} else {
@@ -3355,8 +3358,9 @@ sub entryline {
$renametitle=~s/\\/\\\\/g;
$renametitle=~s/\"\;/\\\"/g;
- $renametitle=~s/\'/\\\'/g;
$renametitle=~s/ /%20/g;
+ $oldtitle = $renametitle;
+ $renametitle=~s/\'/\\\'/g;
my $line=&Apache::loncommon::start_data_table_row();
my ($form_start,$form_end,$form_common,$form_param);
# Edit commands
@@ -3506,7 +3510,7 @@ ENDREM
}
}
$renamelink=(<$lt{'rn'}
+$lt{'rn'}
ENDREN
$line.=(<
@@ -4849,7 +4853,11 @@ sub handler {
'title' => 'Title',
'comment' => 'Comment',
'parse' => 'Upload embedded images/multimedia files if HTML file',
- );
+ 'bb5' => 'Blackboard 5',
+ 'bb6' => 'Blackboard 6',
+ 'angel5' => 'ANGEL 5.5',
+ 'webctce4' => 'WebCT 4 Campus Edition',
+ );
# -----------------------------------------------------------------------------
my $fileupload=(<
@@ -4880,10 +4888,10 @@ CHBO
$lt{'cms'}: