[LON-CAPA-cvs] cvs: loncom /xml scripttag.pm

raeburn raeburn at source.lon-capa.org
Mon Sep 30 20:52:58 EDT 2013


raeburn		Tue Oct  1 00:52:58 2013 EDT

  Modified files:              
    /loncom/xml	scripttag.pm 
  Log:
  - Support for Camtasia 8.1 file uploaded directly to a course. 
  
  
Index: loncom/xml/scripttag.pm
diff -u loncom/xml/scripttag.pm:1.168 loncom/xml/scripttag.pm:1.169
--- loncom/xml/scripttag.pm:1.168	Mon Sep 30 13:44:16 2013
+++ loncom/xml/scripttag.pm	Tue Oct  1 00:52:58 2013
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # <script> definiton
 #
-# $Id: scripttag.pm,v 1.168 2013/09/30 13:44:16 raeburn Exp $
+# $Id: scripttag.pm,v 1.169 2013/10/01 00:52:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -149,11 +149,41 @@
                               if ($item =~ m{^(FlashPlayerSwf|MediaSrc|XMPSrc|ConfigurationSrc|PosterImageSrc)\((['"])(?:(?!\2).)+\2\)}is) {
                                   my $srctype = $1;
                                   my $quote = $2;
-                                  
                                   my ($fname) = ($item =~ m{^\Q$srctype($quote\E([^$quote]+)\Q$quote)\E}); 
-                                  my $cleanhref = &Apache::londefdef::clean_docs_httpref($fname,$url,$cdom,$cnum);
+                                  my $cleanhref =
+                                      &Apache::londefdef::clean_docs_httpref($fname,$url,$cdom,$cnum);
                                   if ($cleanhref) {
                                       &Apache::lonxml::extlink($cleanhref);
+                                      if ($srctype eq 'ConfigurationSrc') {
+                                          if ($cleanhref =~ m{^(.+/)configuration_express\.xml$}) {
+#
+# Camtasia 8.1: express_show/spritesheet.png needed, and included in zip archive.
+# Not referenced directly in <main>.html or <main>_player.html files,
+# so call lonxml::extlink() here to include httpref for the uploaded file.
+# (where <main> is name user gave to file/archive).
+#
+
+                                              my $spritesheet = $1.'express_show/spritesheet.png';
+                                              if (&Apache::lonnet::repcopy_userfile($spritesheet) eq 'ok') {
+                                                  &Apache::lonxml::extlink($spritesheet);
+                                              }
+                                          }
+                                      } elsif ($srctype eq 'PosterImageSrc') {
+                                          if ($fname =~ m{^(.+)_First_Frame\.png$}) {
+                                              my $prefix = $1;
+                                              my ($path) = ($cleanhref =~ m{^(.+/)\Q$fname\E});
+#
+# Camtasia 8.1: <main>_Thumbnails.png needed, and included in zip archive.
+# Not referenced directly in <main>.html or <main>_player.html files,
+# so call lonxml::extlink() here to include httpref for the uploaded file
+# (where <main> is name user gave to file/archive).
+#
+                                              my $thumbnail = $path.$prefix.'_Thumbnails.png';
+                                              if (&Apache::lonnet::repcopy_userfile($thumbnail) eq 'ok') {
+                                                  &Apache::lonxml::extlink($thumbnail);
+                                              }
+                                          }
+                                      }
                                   }
                               }
                           }




More information about the LON-CAPA-cvs mailing list