|
@@ -171,6 +171,7 @@ $code = isset($code) ? $code : null;
|
|
|
<?php } ?>
|
|
|
</div>
|
|
|
<?php } ?>
|
|
|
+<div class="grid-courses">
|
|
|
<div class="row">
|
|
|
<?php
|
|
|
if ($showCourses && $action != 'display_sessions') {
|
|
@@ -189,10 +190,11 @@ if ($showCourses && $action != 'display_sessions') {
|
|
|
if (!empty($search_term)) {
|
|
|
echo "<p><strong>".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."</strong><br />";
|
|
|
}
|
|
|
-
|
|
|
+ $listCategory = CourseManager::getListCategory();
|
|
|
+
|
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
|
|
|
$user_id = api_get_user_id();
|
|
|
-
|
|
|
+
|
|
|
if (!empty($browse_courses_in_category)) {
|
|
|
foreach ($browse_courses_in_category as $course) {
|
|
|
$course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN);
|
|
@@ -213,17 +215,17 @@ if ($showCourses && $action != 'display_sessions') {
|
|
|
$course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
|
|
|
$count_connections = $course['count_connections'];
|
|
|
$creation_date = substr($course['creation_date'],0,10);
|
|
|
-
|
|
|
+
|
|
|
$icon_title = null;
|
|
|
$html = null;
|
|
|
|
|
|
- $html .= '<div class="col-xs-6 col-sm-6 col-md-3"><div class="items-course">';
|
|
|
+ $html .= '<div class="col-xs-6 col-sm-6 col-md-3"><div class="items">';
|
|
|
|
|
|
|
|
|
- $html .= return_thumbnail($course, $icon_title);
|
|
|
+ $html .= return_thumbnail($course, $icon_title, $listCategory);
|
|
|
|
|
|
|
|
|
- $html .= '<div class="items-course-info">';
|
|
|
+ $html .= '<div class="description">';
|
|
|
$html .= return_title($course);
|
|
|
|
|
|
$html .= '<div class="toolbar">';
|
|
@@ -242,7 +244,7 @@ if ($showCourses && $action != 'display_sessions') {
|
|
|
}
|
|
|
} elseif ($user_registerd_in_course_as_teacher) {
|
|
|
|
|
|
- $html .= return_goto_button($course);
|
|
|
+
|
|
|
|
|
|
if ($course_unsubscribe_allowed) {
|
|
|
$html .= return_unregister_button($course, $stok, $search_term, $code);
|
|
@@ -253,7 +255,7 @@ if ($showCourses && $action != 'display_sessions') {
|
|
|
|
|
|
if (!$course_closed) {
|
|
|
if (!$course_private) {
|
|
|
- $html .= return_goto_button($course);
|
|
|
+
|
|
|
if ($course_subscribe_allowed) {
|
|
|
$html .= return_register_button($course, $stok, $code, $search_term);
|
|
|
}
|
|
@@ -279,6 +281,7 @@ if ($showCourses && $action != 'display_sessions') {
|
|
|
}
|
|
|
?>
|
|
|
</div>
|
|
|
+</div>
|
|
|
<?php
|
|
|
|
|
|
echo $cataloguePagination;
|
|
@@ -288,7 +291,7 @@ echo $cataloguePagination;
|
|
|
* @param $course
|
|
|
* @param $icon_title
|
|
|
*/
|
|
|
-function return_thumbnail($course, $icon_title)
|
|
|
+function return_thumbnail($course, $icon_title, $list = array())
|
|
|
{
|
|
|
$html = '';
|
|
|
$title = cut($course['title'], 70);
|
|
@@ -301,22 +304,44 @@ function return_thumbnail($course, $icon_title)
|
|
|
|
|
|
$course_medium_image = Display::returnIconPath('session_default.png');
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- $html .= '<div class="items-course-image">';
|
|
|
- if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
|
|
|
- $html .= '<a class="ajax" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="'.$icon_title.'" rel="gb_page_center[778]">';
|
|
|
- $html .= '<img class="img-responsive" src="'.$course_medium_image.'" alt="'.api_htmlentities($title).'" />';
|
|
|
- $html .= '</a>';
|
|
|
- } else {
|
|
|
+
|
|
|
+ $html .= '<div class="image">';
|
|
|
$html .= '<img class="img-responsive" src="'.$course_medium_image.'" alt="'.api_htmlentities($title).'"/>';
|
|
|
- }
|
|
|
+ foreach ($list as $cat) {
|
|
|
+ if($course['category'] == $cat['code']){
|
|
|
+ $html .= '<span class="category">'. $cat['name'].'</span>';
|
|
|
+ $html .= '<div class="cribbon"></div>';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $teachers = CourseManager::getTeacheCourseCode($course['code']);
|
|
|
+ $html .= '<div class="black_shadow">';
|
|
|
+ $html .= '<div class="author-card">';
|
|
|
+ $count = 0;
|
|
|
+ foreach ($teachers as $value) {
|
|
|
+ if($count<=3){
|
|
|
+ $name = $value['firstname'].' ' . $value['lastname'];
|
|
|
+ $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">';
|
|
|
+ $html .= '<img src="'.$value['avatar'].'"/>';
|
|
|
+ $html .= '</a>';
|
|
|
+ $html .= '<div class="teachers-details">';
|
|
|
+ $html .= '<h5>';
|
|
|
+ $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">';
|
|
|
+ $html .= $name;
|
|
|
+ $html .= '</a>';
|
|
|
+ $html .= '</h5>';
|
|
|
+ $html .= '</div>';
|
|
|
+ }
|
|
|
+ $count ++;
|
|
|
+ }
|
|
|
+ $html .= '</div>';
|
|
|
+ $html .= '</div>';
|
|
|
+
|
|
|
$html .= '</div>';
|
|
|
|
|
|
return $html;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
* Display the title of a course in course catalog
|
|
|
* @param $course
|
|
@@ -327,10 +352,8 @@ function return_title($course)
|
|
|
$linkCourse = api_get_course_url($course['code']);
|
|
|
$title = cut($course['title'], 70);
|
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
|
|
|
- $teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']);
|
|
|
$rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']);
|
|
|
$html .= '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
|
|
|
- $html .= '<div class="teachers">'.$teachers.'</div>';
|
|
|
$html .= '<div class="ranking">'. $rating . '</div>';
|
|
|
|
|
|
return $html;
|