--- loncom/interface/loncommon.pm 2012/04/05 13:32:15 1.1065 +++ loncom/interface/loncommon.pm 2012/04/11 15:21:43 1.1069 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1065 2012/04/05 13:32:15 raeburn Exp $ +# $Id: loncommon.pm,v 1.1069 2012/04/11 15:21:43 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5014,7 +5014,7 @@ sub bodytag { sub dc_courseid_toggle { my ($dc_info) = @_; return ' '. - ''. + ''. &mt('(More ...)').''. '
'.$lt{'this'}; my $fileloc = &Apache::lonnet::filelocation(undef,$archiveurl); - my (%toplevel,@paths); + my ($is_camtasia,$topdir,%toplevel,@paths); my $info = &list_archive_contents($fileloc,\@paths); if (@paths) { foreach my $path (@paths) { $path =~ s{^/}{}; + if ($path =~ m{^([^/]+)/$}) { + $topdir = $1; + } if ($path =~ m{^([^/]+)/}) { $toplevel{$1} = $path; } else { @@ -9952,12 +9958,53 @@ sub decompress_form { } } } - if ($info eq '') { - $output .= ' '.$lt{'youm'}.'
'."\n"; + if ($mimetype =~ m{^application/(x\-)?(compressed|zip)}) { + my @camtasia = ("$topdir/","$topdir/index.html", + "$topdir/media/", + "$topdir/media/$topdir.mp4", + "$topdir/media/FirstFrame.png", + "$topdir/media/player.swf", + "$topdir/media/swfobject.js", + "$topdir/media/expressInstall.swf"); + my @diffs = &compare_arrays(\@paths,\@camtasia); + if (@diffs == 0) { + $is_camtasia = 1; + } + } + my $output; + if ($is_camtasia) { + $output = <<"ENDCAM"; + +$lt{'camt'}
+ENDCAM } else { - $output .= ' '.$lt{'itsc'}.''."\n". - ''.$info.'
'.$lt{'this'}; + if ($info eq '') { + $output .= ' '.$lt{'youm'}.'
'."\n"; + } else { + $output .= ' '.$lt{'itsc'}.''."\n". + ''.$info.'