|
@@ -3522,6 +3522,7 @@ class CourseManager
|
|
|
$result = Database::query($sql);
|
|
|
$html = null;
|
|
|
$courseCount = 0;
|
|
|
+ $items = [];
|
|
|
while ($row = Database::fetch_array($result)) {
|
|
|
// We simply display the title of the category.
|
|
|
$params = array(
|
|
@@ -3538,10 +3539,14 @@ class CourseManager
|
|
|
$load_dirs
|
|
|
);
|
|
|
|
|
|
- $html .= self::course_item_parent(
|
|
|
+ $item = self::course_item_parent(
|
|
|
self::course_item_html($params, true),
|
|
|
$courseInCategory['html']
|
|
|
);
|
|
|
+
|
|
|
+ $html .= $item;
|
|
|
+
|
|
|
+ $items[] = $item;
|
|
|
$courseCount += $courseInCategory['course_count'];
|
|
|
}
|
|
|
|
|
@@ -3549,10 +3554,16 @@ class CourseManager
|
|
|
$courseInCategory = self::displayCoursesInCategory(0, $load_dirs);
|
|
|
|
|
|
$html .= $courseInCategory['html'];
|
|
|
+
|
|
|
+ if (!empty($courseInCategory['items'])) {
|
|
|
+ $items = array_merge($items, $courseInCategory['items']);
|
|
|
+ }
|
|
|
+
|
|
|
$courseCount += $courseInCategory['course_count'];
|
|
|
|
|
|
return [
|
|
|
'html' => $html,
|
|
|
+ 'items' => $items,
|
|
|
'course_count' => $courseCount
|
|
|
];
|
|
|
}
|
|
@@ -3611,6 +3622,7 @@ class CourseManager
|
|
|
|
|
|
$result = Database::query($sql);
|
|
|
$html = '';
|
|
|
+ $items = [];
|
|
|
|
|
|
$course_list = array();
|
|
|
$showCustomIcon = api_get_setting('course_images_in_courses_list');
|
|
@@ -3729,11 +3741,14 @@ class CourseManager
|
|
|
if (empty($user_category_id)) {
|
|
|
$isSubContent = false;
|
|
|
}
|
|
|
- $html .= self::course_item_html($params, $isSubContent);
|
|
|
+ $item = self::course_item_html($params, $isSubContent);
|
|
|
+ $html .= $item;
|
|
|
+ $items[] = $item;
|
|
|
}
|
|
|
|
|
|
return [
|
|
|
'html' => $html,
|
|
|
+ 'items' => $items,
|
|
|
'course_count' => $courseCount
|
|
|
];
|
|
|
}
|