1. when extracting reference file from "param" tag, only extract value of <param...
authorCindy Li <cli@ocad.ca>
Tue, 13 Jul 2010 14:49:48 +0000 (14:49 -0000)
committerCindy Li <cli@ocad.ca>
Tue, 13 Jul 2010 14:49:48 +0000 (14:49 -0000)
2. fix in ims/ims_import.php

docs/home/ims/ims_import.php
docs/home/imscc/ims_export.php

index 4ca8995..db53488 100644 (file)
@@ -232,7 +232,10 @@ function checkResources($import_path){
                if(isset($fileinfo['file']) && is_array($fileinfo['file']) && !empty($fileinfo['file'])){
                        foreach($fileinfo['file'] as $fn){
                                if (!in_array(realpath($import_path.$fn), $filearray)){
-                                       $filearray[] = realpath($import_path. $fn);
+                                       //if url, skip
+                                       if (preg_match('/^http[s]?\:/', $fn) == 0){
+                                               $filearray[] = realpath($import_path. $fn);
+                                       }                                       
                                }
                        }
                }
index 36da368..2e37d43 100644 (file)
@@ -166,10 +166,9 @@ class MyHandler {
                                }
                        }
                } else if (isset($elements[$name]) && ($attrs[$elements[$name]] != '')) {
-                       /* we know exactly which attribute contains the reference to the file. */
-                       //hack, if param[name]=autoplay or autostart, ignore
-                       if (!($name=='param' && ($attrs['name']=='autoplay' || $attrs['name']=='autoStart'))){
-                           //skip glossary.html, tweak to accomodate atutor imscp; also skip repeated entries.
+                       //hack, if param[name]=src or none <param> tag, extract. Skip all other <param> attributes.  
+                       if ($name!='param' || $attrs['name']=='src'){
+                               //skip glossary.html, tweak to accomodate atutor imscp; also skip repeated entries.
                            if (strpos($attrs[$elements[$name]], 'glossary.html')===false 
                                    && !in_array($attrs[$elements[$name]], $my_files)){
                                $my_files[] = $attrs[$elements[$name]];