|
|
@ -360,7 +360,7 @@ class CourseSelectForm |
|
|
|
|
|
|
|
|
|
|
|
//Create the resource DOCUMENT objects |
|
|
|
//Create the resource DOCUMENT objects |
|
|
|
//Loading the results from the checkboxes of ethe javascript |
|
|
|
//Loading the results from the checkboxes of ethe javascript |
|
|
|
$resource = $_POST['resource'][RESOURCE_DOCUMENT]; |
|
|
|
$resource = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null; |
|
|
|
|
|
|
|
|
|
|
|
$course_info = api_get_course_info($course_code); |
|
|
|
$course_info = api_get_course_info($course_code); |
|
|
|
$table_doc = Database::get_course_table(TABLE_DOCUMENT); |
|
|
|
$table_doc = Database::get_course_table(TABLE_DOCUMENT); |
|
|
@ -471,9 +471,9 @@ class CourseSelectForm |
|
|
|
// Mark folders to import which are not selected by the user to import, |
|
|
|
// Mark folders to import which are not selected by the user to import, |
|
|
|
// but in which a document was selected. |
|
|
|
// but in which a document was selected. |
|
|
|
$documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null; |
|
|
|
$documents = isset($_POST['resource'][RESOURCE_DOCUMENT]) ? $_POST['resource'][RESOURCE_DOCUMENT] : null; |
|
|
|
if (is_array($resources)) |
|
|
|
if (!empty($resources) && is_array($resources)) |
|
|
|
foreach($resources as $id => $obj) { |
|
|
|
foreach($resources as $id => $obj) { |
|
|
|
if ($obj->file_type == 'folder' && ! isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) && is_array($documents)) { |
|
|
|
if (isset($obj->file_type) && $obj->file_type == 'folder' && !isset($_POST['resource'][RESOURCE_DOCUMENT][$id]) && is_array($documents)) { |
|
|
|
foreach($documents as $id_to_check => $post_value) { |
|
|
|
foreach($documents as $id_to_check => $post_value) { |
|
|
|
$obj_to_check = $resources[$id_to_check]; |
|
|
|
$obj_to_check = $resources[$id_to_check]; |
|
|
|
$shared_path_part = substr($obj_to_check->path,0,strlen($obj->path)); |
|
|
|
$shared_path_part = substr($obj_to_check->path,0,strlen($obj->path)); |
|
|
@ -485,8 +485,8 @@ class CourseSelectForm |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
default : |
|
|
|
default : |
|
|
|
if (is_array($resources)) { |
|
|
|
if (!empty($resources) && is_array($resources)) { |
|
|
|
foreach ($resources as $id => $obj) { |
|
|
|
foreach($resources as $id => $obj) { |
|
|
|
$resource_is_used_elsewhere = $course->is_linked_resource($obj); |
|
|
|
$resource_is_used_elsewhere = $course->is_linked_resource($obj); |
|
|
|
//var_dump($obj, $resource_is_used_elsewhere); |
|
|
|
//var_dump($obj, $resource_is_used_elsewhere); |
|
|
|
// check if document is in a quiz (audio/video) |
|
|
|
// check if document is in a quiz (audio/video) |
|
|
|