http://www.atutor.ca/atutor/mantis/view.php?id=4383
authorharris wong <hwong@ocad.ca>
Mon, 5 Jul 2010 19:18:10 +0000 (19:18 -0000)
committerharris wong <hwong@ocad.ca>
Mon, 5 Jul 2010 19:18:10 +0000 (19:18 -0000)
docs/mods/_core/imscc/include/ims_template.inc.php
docs/mods/_core/imscp/ims_import.php

index e4c86c8..940fe52 100644 (file)
@@ -347,7 +347,11 @@ function print_organizations($parent_id,
                                        if (!empty($test_zipped_files) && in_array($file_path, $test_zipped_files)){
                                                $content_files .= str_replace('{FILE}', $file, $ims_template_xml['file']);
                                        } else {
-                                               $content_files .= str_replace('{FILE}', $content['content_path'] . $file, $ims_template_xml['file']);
+                                               if (preg_match('/^http[s]?\:/', $file) == 1){
+                                                       $content_files .= str_replace('{FILE}', $file, $ims_template_xml['xml']);
+                                               } else {
+                                                       $content_files .= str_replace('{FILE}', $content['content_path'] . $file, $ims_template_xml['file']);
+                                               }
                                        }
                                }
                                /* check if this file is one of the test xml file, if so, we need to add the dependency
@@ -359,6 +363,11 @@ function print_organizations($parent_id,
                                }
                        }
 
+                       /******************************
+                        * http://www.atutor.ca/atutor/mantis/view.php?id=4383 
+                    */
+                       $my_files = array();
+
                        /******************************/
                        //add it to the resources section if it hasn't been added.  
                        //Weblinks have been added.
@@ -368,7 +377,6 @@ function print_organizations($parent_id,
                                                                                        array($content['content_id'], $content['content_path'], $content_files, $forums_dependency),
                                                                                        $ims_template_xml['resource']); 
                        }
-                       
 
                        for ($i=0; $i<$depth; $i++) {
                                $link .= $space;
@@ -442,7 +450,7 @@ function print_organizations($parent_id,
                        $string .= '</li>';
                }
 
-       }
+       } 
 }
 
 
index b976a95..245d525 100644 (file)
@@ -129,7 +129,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);
+                                       }                                       
                                }
                        }
                }