--- loncom/interface/londocs.pm 2013/12/31 15:03:56 1.484.2.47 +++ loncom/interface/londocs.pm 2014/03/18 02:37:52 1.484.2.51 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.484.2.47 2013/12/31 15:03:56 raeburn Exp $ +# $Id: londocs.pm,v 1.484.2.51 2014/03/18 02:37:52 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}.'
'; } @@ -1087,6 +1088,7 @@ sub update_paste_buffer { } &Apache::lonnet::appenv(\%addtoenv); delete($env{'form.markcopy'}); + return; } sub recurse_uploaded_maps { @@ -1242,8 +1244,8 @@ sub print_paste_buffer { ''. (' 'x2); } - $form_end = = ''. - ''; + $form_end = ''. + ''; } else { $pasteitems = &mt('Clipboard is empty'); } @@ -3173,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'; @@ -3181,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); @@ -3279,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(); @@ -3354,6 +3358,7 @@ sub entryline { $renametitle=~s/\\/\\\\/g; $renametitle=~s/\"\;/\\\"/g; + $renametitle=~s/\'\;/\\\'/g; $renametitle=~s/ /%20/g; my $line=&Apache::loncommon::start_data_table_row(); my ($form_start,$form_end,$form_common,$form_param); @@ -4846,7 +4851,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=(< @@ -4877,10 +4886,10 @@ CHBO $lt{'cms'}: