/**
 *
 * Function folder loop
 * This function loops through a folder tree collating files
 * @param string $path - path to move through
 * @version 1.0
 * @author Patrick Lockley
 */
function export_folder_loop($path, $recursive = true, $ext = NULL, $dest = NULL)
{
    global $folder_id_array, $folder_array, $file_array, $zipfile, $dir_path;
    $d = opendir($path);
    array_push($folder_id_array, $d);
    while ($f = readdir($d)) {
        if (is_dir($path . $f)) {
            if ($f != "." && $f != ".." && $recursive) {
                export_folder_loop($path . $f . "/");
            }
        } else {
            if ($f != "data.xml") {
                if ($ext == NULL || strrpos($f, $ext) == strlen($f) - strlen($ext)) {
                    $srcfile = $path . $f;
                    if ($dest != NULL) {
                        $destfile = $dest . $f;
                    } else {
                        $destfile = "";
                    }
                    //echo $string . "<br />";
                    array_push($file_array, array($srcfile, $destfile));
                }
            }
        }
    }
    $x = array_pop($folder_id_array);
    closedir($d);
}
Example #2
0
}
/*
 * mapstraction
 */
if ($xml->modelUsed("mapstraction")) {
    export_folder_loop($xerte_toolkits_site->root_file_path . "mapstraction/");
    copy_extra_files();
}
/*
 * mediaViewer
 */
if ($xml->mediaIsUsed()) {
    export_folder_loop($xerte_toolkits_site->root_file_path . "mediaViewer/");
    copy_extra_files();
}
export_folder_loop($dir_path);
/*
 * Get the name of the learning object
 */
$lo_name = $xml->getName();
/*
 * Create scorm manifests or a basic HTML page
 */
if ($scorm == "true") {
    $useflash = $export_flash && !$export_html5;
    if (isset($_GET['data'])) {
        if ($_GET['data'] == true) {
            $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "templatesyndication where template_id = " . mysql_real_escape_string($_GET['template_id']);
            $query_response_metadata = mysql_query($query);
            $metadata = mysql_fetch_array($query_response_metadata);
            $query = "select * from " . $xerte_toolkits_site->database_table_prefix . "templaterights, " . $xerte_toolkits_site->database_table_prefix . "logindetails  where template_id = " . mysql_real_escape_string($_GET['template_id']) . " and login_id = user_id";