From d7ff3110b4febcf7613f09b0baa7f4c4cce461f5 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Mon, 15 Feb 2010 13:33:31 -0500 Subject: [PATCH] Adding \"audio\" field when copying a LP from other course --- .../classes/CourseBuilder.class.php | 38 +++++++++---------- .../classes/CourseRestorer.class.php | 12 +++--- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/main/coursecopy/classes/CourseBuilder.class.php b/main/coursecopy/classes/CourseBuilder.class.php index 24447921ca..f581ce6922 100755 --- a/main/coursecopy/classes/CourseBuilder.class.php +++ b/main/coursecopy/classes/CourseBuilder.class.php @@ -568,34 +568,34 @@ class CourseBuilder $db_items = Database::query($sql_items); while ($obj_item = Database::fetch_object($db_items)) { - $item['id'] = $obj_item->id; - $item['item_type'] = $obj_item->item_type; - $item['ref'] = $obj_item->ref; - $item['title'] = $obj_item->title; - $item['description'] = $obj_item->description; - $item['path'] = $obj_item->path; - $item['min_score'] = $obj_item->min_score; - $item['max_score'] = $obj_item->max_score; - $item['mastery_score'] = $obj_item->mastery_score; + $item['id'] = $obj_item->id; + $item['item_type'] = $obj_item->item_type; + $item['ref'] = $obj_item->ref; + $item['title'] = $obj_item->title; + $item['description'] = $obj_item->description; + $item['path'] = $obj_item->path; + $item['min_score'] = $obj_item->min_score; + $item['max_score'] = $obj_item->max_score; + $item['mastery_score'] = $obj_item->mastery_score; $item['parent_item_id'] = $obj_item->parent_item_id; $item['previous_item_id'] = $obj_item->previous_item_id; - $item['next_item_id'] = $obj_item->next_item_id; - $item['display_order'] = $obj_item->display_order; - $item['prerequisite'] = $obj_item->prerequisite; - $item['parameters'] = $obj_item->parameters; - $item['launch_data'] = $obj_item->launch_data; + $item['next_item_id'] = $obj_item->next_item_id; + $item['display_order'] = $obj_item->display_order; + $item['prerequisite'] = $obj_item->prerequisite; + $item['parameters'] = $obj_item->parameters; + $item['launch_data'] = $obj_item->launch_data; + //adding audio data + $item['audio'] = $obj_item->audio; + $items[] = $item; } $sql_tool = "SELECT id FROM ".$table_tool." WHERE (link LIKE '%lp_controller.php%lp_id=".$obj->id."%' and image='scormbuilder.gif') AND visibility='1'"; $db_tool = Database::query($sql_tool); - if(Database::num_rows($db_tool)) - { + if(Database::num_rows($db_tool)) { $visibility='1'; - } - else - { + } else { $visibility='0'; } diff --git a/main/coursecopy/classes/CourseRestorer.class.php b/main/coursecopy/classes/CourseRestorer.class.php index 656cecb5d3..e2faccf6d8 100755 --- a/main/coursecopy/classes/CourseRestorer.class.php +++ b/main/coursecopy/classes/CourseRestorer.class.php @@ -372,9 +372,8 @@ class CourseRestorer break; } // end switch - } // end if file exists - else - { + } else { // end if file exists + //make sure the source file actually exists //echo $this->course->backup_path.'/'.$document->path; if(is_file($this->course->backup_path.'/'.$document->path) && is_readable($this->course->backup_path.'/'.$document->path) && is_dir(dirname($path.$document->path)) && is_writeable(dirname($path.$document->path))) @@ -1175,8 +1174,8 @@ class CourseRestorer function restore_learnpaths($session_id = 0) { if ($this->course->has_resources(RESOURCE_LEARNPATH)) { - $table_main = Database :: get_course_table(TABLE_LP_MAIN, $this->course->destination_db); - $table_item = Database :: get_course_table(TABLE_LP_ITEM, $this->course->destination_db); + $table_main = Database::get_course_table(TABLE_LP_MAIN, $this->course->destination_db); + $table_item = Database::get_course_table(TABLE_LP_ITEM, $this->course->destination_db); $table_tool = Database::get_course_table(TABLE_TOOL_LIST, $this->course->destination_db); $resources = $this->course->resources; @@ -1201,7 +1200,7 @@ class CourseRestorer "prevent_reinit = '".Database::escape_string($lp->prevent_reinit)."', " . "force_commit = '".Database::escape_string($lp->force_commit)."', " . "content_maker = '".Database::escape_string($lp->content_maker)."', " . - "display_order = '".Database::escape_string($lp->display_order)."', " . + "display_order = '".Database::escape_string($lp->display_order)."', " . "js_lib= '".Database::escape_string($lp->js_lib)."', " . "content_license= '".Database::escape_string($lp->content_license)."', " . "debug= '".Database::escape_string($lp->debug)."' $condition_session "; @@ -1270,6 +1269,7 @@ class CourseRestorer "display_order = '".Database::escape_string($item['display_order'])."', " . "prerequisite = '".Database::escape_string($item['prerequisite'])."', " . "parameters='".Database::escape_string($item['parameters'])."', " . + "audio='".Database::escape_string($item['audio'])."', " . "launch_data = '".Database::escape_string($item['launch_dataprereq_type'])."'"; Database::query($sql);