diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 3fb74624ae..21ef7d7846 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -3644,13 +3644,13 @@ class CourseManager ); //$courseCount += $courseInCategory['course_count']; $courseCount ++; - $listItems['course_in_category'][$courseCount] = $params; + $listItems['in_category'][$courseCount] = $params; } // Step 2: We display the course without a user category. $courseInCategory = self::returnCoursesNotCategory(0, $load_dirs); - $listItems['course_not_category'] = $courseInCategory; + $listItems['not_category'] = $courseInCategory; //$courseCount += $courseInCategory['course_count']; @@ -3881,6 +3881,8 @@ class CourseManager if ($showCustomIcon === 'true' && $iconName != 'course.png') { $thumbnails = $course_info['course_image']; $image = $course_info['course_image_large']; + }else{ + $image = Display::return_icon('session_default.png', null, null, null,null, true); } $params = array(); diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index da8430810b..062d7ac41a 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -1040,7 +1040,7 @@ class IndexManager } } - $courses_html = ''; + $listCourse = ''; $special_courses = ''; $sessionCount = 0; $courseCount = 0; @@ -1059,8 +1059,12 @@ class IndexManager $this->load_directories_preview ); - $courses_html .= $courses['html']; + $this->tpl->assign('courses', $courses); + $listCourse = $this->tpl->fetch( + $this->tpl->get_template('/user_portal/main_courses.tpl')); + $courseCount = $specialCourses['course_count'] + $courses['course_count']; + } $sessions_with_category = ''; @@ -1362,7 +1366,7 @@ class IndexManager } return [ - 'html' => $sessions_with_category.$sessions_with_no_category.$courses_html.$special_courses, + 'html' => $sessions_with_category.$sessions_with_no_category.$listCourse.$special_courses, 'session_count' => $sessionCount, 'course_count' => $courseCount ]; diff --git a/main/template/default/user_portal/main_courses.tpl b/main/template/default/user_portal/main_courses.tpl index aa3d5f1023..9d3185ed33 100644 --- a/main/template/default/user_portal/main_courses.tpl +++ b/main/template/default/user_portal/main_courses.tpl @@ -1 +1,28 @@ -{# empty Twig template #} + +{% for course in courses %} +
+ {% for item in course %} +
+
+
+ +
+

{{ item.title }}

+
+
    + {% for teacher in item.teachers %} +
  • {{ teacher.email }}
  • + {% endfor %} +
+
+
+
+ {% endfor %} +
+{% endfor %} + + +
+    {{ courses | var_dump }}
+
+