|
|
|
@ -656,6 +656,7 @@ class CourseHome |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$isAllowToEdit = api_is_allowed_to_edit(null, true); |
|
|
|
|
$showInvisibleLpsForStudents = api_get_configuration_value('show_invisible_lp_in_course_home'); |
|
|
|
|
foreach ($tools as $temp_row) { |
|
|
|
|
$add = false; |
|
|
|
|
if ($check) { |
|
|
|
@ -666,7 +667,10 @@ class CourseHome |
|
|
|
|
$add = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ($allowEditionInSession && !empty($sessionId)) { |
|
|
|
|
if (false === $showInvisibleLpsForStudents && |
|
|
|
|
false === $isAllowToEdit && |
|
|
|
|
$allowEditionInSession && !empty($sessionId) |
|
|
|
|
) { |
|
|
|
|
// Checking if exist row in session |
|
|
|
|
$criteria = [ |
|
|
|
|
'cId' => $course_id, |
|
|
|
@ -675,12 +679,10 @@ class CourseHome |
|
|
|
|
]; |
|
|
|
|
/** @var CTool $toolObj */ |
|
|
|
|
$toolObj = Database::getManager()->getRepository('ChamiloCourseBundle:CTool')->findOneBy($criteria); |
|
|
|
|
if ($toolObj) { |
|
|
|
|
if ($isAllowToEdit == false && $toolObj->getVisibility() == false) { |
|
|
|
|
if ($toolObj && $toolObj->getVisibility() == false) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
switch ($temp_row['image']) { |
|
|
|
|
case 'scormbuilder.gif': |
|
|
|
@ -694,6 +696,9 @@ class CourseHome |
|
|
|
|
|
|
|
|
|
if ($isAllowToEdit) { |
|
|
|
|
$add = true; |
|
|
|
|
} else { |
|
|
|
|
if ($showInvisibleLpsForStudents) { |
|
|
|
|
$add = true; |
|
|
|
|
} else { |
|
|
|
|
$add = learnpath::is_lp_visible_for_student( |
|
|
|
|
$lpId, |
|
|
|
@ -707,6 +712,7 @@ class CourseHome |
|
|
|
|
$add = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if ($path) { |
|
|
|
|
$temp_row['custom_image'] = $path; |
|
|
|
|
} |
|
|
|
|