if (!empty($this->course->type) && $this->course->type=='partial')
if (!empty($this->course->type) && $this->course->type=='partial')
$sql = 'SELECT * FROM '.$table_doc.' d, '.$table_prop.' p WHERE tool = \''.TOOL_DOCUMENT.'\' AND p.ref = d.id AND p.visibility != 2 AND path NOT LIKE \'/images/gallery%\' ORDER BY path';
$sql = 'SELECT * FROM '.$table_doc.' d, '.$table_prop.' p WHERE tool = \''.TOOL_DOCUMENT.'\' AND p.ref = d.id AND p.visibility != 2 AND path NOT LIKE \'/images/gallery%\' ORDER BY path';
//Documents are avoided due the huge moun of memory that serialize function eats (when there are directories with hundred of files)
if ($avoid_serialize) {
//Documents are avoided due the huge amount of memory that the serialize php function "eats" (when there are directories with hundred/thousand of files)
// Searching the documents resource that have been set to null because $avoid_serialize is true in the display_form() function
if ($from=='copy_course') {
if (is_array($resource)) {
$resource = array_keys($resource);
$resource = array_keys($resource);
foreach ($resource as $resource_item) {
foreach ($resource as $resource_item) {
$sql = 'SELECT * FROM '.$table_doc.' d, '.$table_prop.' p WHERE tool = \''.TOOL_DOCUMENT.'\' AND p.ref = d.id AND p.visibility != 2 AND id = '.$resource_item.' ORDER BY path';
$sql = 'SELECT * FROM '.$table_doc.' d, '.$table_prop.' p WHERE tool = \''.TOOL_DOCUMENT.'\' AND p.ref = d.id AND p.visibility != 2 AND id = '.$resource_item.' ORDER BY path';
@ -231,7 +222,6 @@ class CourseSelectForm
while ($obj = Database::fetch_object($db_result)) {
while ($obj = Database::fetch_object($db_result)) {
$doc = new Document($obj->id, $obj->path, $obj->comment, $obj->title, $obj->filetype, $obj->size);
$doc = new Document($obj->id, $obj->path, $obj->comment, $obj->title, $obj->filetype, $obj->size);
$course->add_resource($doc);
$course->add_resource($doc);
// adding item property
// adding item property
$sql = "SELECT * FROM $table_prop WHERE TOOL = '".RESOURCE_DOCUMENT."' AND ref='".$resource_item."'";
$sql = "SELECT * FROM $table_prop WHERE TOOL = '".RESOURCE_DOCUMENT."' AND ref='".$resource_item."'";
$sql = 'SELECT * FROM '.$table_c.' c, '.$table_cu.' cu WHERE cu.course_code = c.code';
$sql = 'SELECT * FROM '.$table_c.' c, '.$table_cu.' cu WHERE cu.course_code = c.code';
if( ! api_is_platform_admin())
if (!api_is_platform_admin()) {
{
$sql .= ' AND cu.status=1 ';
$sql .= ' AND cu.status=1 ';
}
}
$sql .= ' AND target_course_code IS NULL AND cu.user_id = '.$user_info['user_id'].' AND c.code != '."'".$course_info['sysCode']."'".' ORDER BY title ASC';
$sql .= ' AND target_course_code IS NULL AND cu.user_id = '.$user_info['user_id'].' AND c.code != '."'".$course_info['sysCode']."'".' ORDER BY title ASC';
//'<aclass="bottom-link"href="../course_home/course_home.php?'.api_get_cidreq().'">>> '.get_lang('CourseHomepage').'</a>',false); // This is not the preferable way to go to the course homepage.
//'<aclass="bottom-link"href="../course_home/course_home.php?'.api_get_cidreq().'">>> '.get_lang('CourseHomepage').'</a>',false); // This is not the preferable way to go to the course homepage.