|
@@ -171,6 +171,7 @@ $code = isset($code) ? $code : null;
|
|
<?php } ?>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
<?php } ?>
|
|
|
|
+<div class="grid-courses">
|
|
<div class="row">
|
|
<div class="row">
|
|
<?php
|
|
<?php
|
|
if ($showCourses && $action != 'display_sessions') {
|
|
if ($showCourses && $action != 'display_sessions') {
|
|
@@ -189,10 +190,11 @@ if ($showCourses && $action != 'display_sessions') {
|
|
if (!empty($search_term)) {
|
|
if (!empty($search_term)) {
|
|
echo "<p><strong>".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."</strong><br />";
|
|
echo "<p><strong>".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."</strong><br />";
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ $listCategory = CourseManager::getCategoriesList();
|
|
|
|
+
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
|
|
$user_id = api_get_user_id();
|
|
$user_id = api_get_user_id();
|
|
-
|
|
|
|
|
|
+
|
|
if (!empty($browse_courses_in_category)) {
|
|
if (!empty($browse_courses_in_category)) {
|
|
foreach ($browse_courses_in_category as $course) {
|
|
foreach ($browse_courses_in_category as $course) {
|
|
$course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN);
|
|
$course_hidden = ($course['visibility'] == COURSE_VISIBILITY_HIDDEN);
|
|
@@ -213,17 +215,17 @@ if ($showCourses && $action != 'display_sessions') {
|
|
$course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
|
|
$course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
|
|
$count_connections = $course['count_connections'];
|
|
$count_connections = $course['count_connections'];
|
|
$creation_date = substr($course['creation_date'],0,10);
|
|
$creation_date = substr($course['creation_date'],0,10);
|
|
-
|
|
|
|
|
|
+
|
|
$icon_title = null;
|
|
$icon_title = null;
|
|
$html = null;
|
|
$html = null;
|
|
// display the course bloc
|
|
// display the course bloc
|
|
- $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">';
|
|
|
|
|
|
// display thumbnail
|
|
// display thumbnail
|
|
- $html .= return_thumbnail($course, $icon_title);
|
|
|
|
|
|
+ $html .= returnThumbnail($course, $listCategory[$course['category']]);
|
|
|
|
|
|
// display course title and button bloc
|
|
// display course title and button bloc
|
|
- $html .= '<div class="items-course-info">';
|
|
|
|
|
|
+ $html .= '<div class="description">';
|
|
$html .= return_title($course);
|
|
$html .= return_title($course);
|
|
// display button line
|
|
// display button line
|
|
$html .= '<div class="toolbar">';
|
|
$html .= '<div class="toolbar">';
|
|
@@ -242,7 +244,7 @@ if ($showCourses && $action != 'display_sessions') {
|
|
}
|
|
}
|
|
} elseif ($user_registerd_in_course_as_teacher) {
|
|
} elseif ($user_registerd_in_course_as_teacher) {
|
|
// if user registered as teacher
|
|
// if user registered as teacher
|
|
- $html .= return_goto_button($course);
|
|
|
|
|
|
+
|
|
|
|
|
|
if ($course_unsubscribe_allowed) {
|
|
if ($course_unsubscribe_allowed) {
|
|
$html .= return_unregister_button($course, $stok, $search_term, $code);
|
|
$html .= return_unregister_button($course, $stok, $search_term, $code);
|
|
@@ -253,7 +255,7 @@ if ($showCourses && $action != 'display_sessions') {
|
|
// if user not registered in the course
|
|
// if user not registered in the course
|
|
if (!$course_closed) {
|
|
if (!$course_closed) {
|
|
if (!$course_private) {
|
|
if (!$course_private) {
|
|
- $html .= return_goto_button($course);
|
|
|
|
|
|
+
|
|
if ($course_subscribe_allowed) {
|
|
if ($course_subscribe_allowed) {
|
|
$html .= return_register_button($course, $stok, $code, $search_term);
|
|
$html .= return_register_button($course, $stok, $code, $search_term);
|
|
}
|
|
}
|
|
@@ -279,16 +281,18 @@ if ($showCourses && $action != 'display_sessions') {
|
|
}
|
|
}
|
|
?>
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
+</div>
|
|
<?php
|
|
<?php
|
|
|
|
|
|
echo $cataloguePagination;
|
|
echo $cataloguePagination;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Display the course catalog image of a course
|
|
* Display the course catalog image of a course
|
|
- * @param $course
|
|
|
|
- * @param $icon_title
|
|
|
|
|
|
+ * @param array $course
|
|
|
|
+ * @param string $categoryTitle
|
|
|
|
+ * @return string HTML string
|
|
*/
|
|
*/
|
|
-function return_thumbnail($course, $icon_title)
|
|
|
|
|
|
+function returnThumbnail($course, $categoryTitle=null)
|
|
{
|
|
{
|
|
$html = '';
|
|
$html = '';
|
|
$title = cut($course['title'], 70);
|
|
$title = cut($course['title'], 70);
|
|
@@ -301,22 +305,35 @@ function return_thumbnail($course, $icon_title)
|
|
// without picture
|
|
// without picture
|
|
$course_medium_image = Display::returnIconPath('session_default.png');
|
|
$course_medium_image = Display::returnIconPath('session_default.png');
|
|
}
|
|
}
|
|
-
|
|
|
|
- // course image
|
|
|
|
-
|
|
|
|
- $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 .= '<img class="img-responsive" src="'.$course_medium_image.'" alt="'.api_htmlentities($title).'"/>';
|
|
|
|
|
|
+
|
|
|
|
+ $html .= '<div class="image">';
|
|
|
|
+ $html .= '<img class="img-responsive" src="'.$course_medium_image.'" alt="'.api_htmlentities($title).'"/>';
|
|
|
|
+ if (!empty($categoryTitle)) {
|
|
|
|
+ $html .= '<span class="category">'. $categoryTitle.'</span>';
|
|
|
|
+ $html .= '<div class="cribbon"></div>';
|
|
}
|
|
}
|
|
- $html .= '</div>';
|
|
|
|
|
|
+ $teachers = CourseManager::getTeachersFromCourseByCode($course['code']);
|
|
|
|
+ $html .= '<div class="black-shadow">';
|
|
|
|
+ $html .= '<div class="author-card">';
|
|
|
|
+ $count = 0;
|
|
|
|
+ foreach ($teachers as $value) {
|
|
|
|
+ if ($count>2) {
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ $name = $value['firstname'].' ' . $value['lastname'];
|
|
|
|
+ $html .= '<a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">
|
|
|
|
+ <img src="'.$value['avatar'].'"/></a>';
|
|
|
|
+ $html .= '<div class="teachers-details"><h5>
|
|
|
|
+ <a href="'.$value['url'].'" class="ajax" data-title="'.$name.'">'
|
|
|
|
+ . $name . '</a></h5></div>';
|
|
|
|
+ $count ++;
|
|
|
|
+ }
|
|
|
|
+ $html .= '</div></div></div>';
|
|
|
|
|
|
return $html;
|
|
return $html;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Display the title of a course in course catalog
|
|
* Display the title of a course in course catalog
|
|
* @param $course
|
|
* @param $course
|
|
@@ -327,10 +344,8 @@ function return_title($course)
|
|
$linkCourse = api_get_course_url($course['code']);
|
|
$linkCourse = api_get_course_url($course['code']);
|
|
$title = cut($course['title'], 70);
|
|
$title = cut($course['title'], 70);
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote';
|
|
$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']);
|
|
$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 .= '<h4 class="title"><a href="' . $linkCourse . '">' . cut($title, 60) . '</a></h4>';
|
|
- $html .= '<div class="teachers">'.$teachers.'</div>';
|
|
|
|
$html .= '<div class="ranking">'. $rating . '</div>';
|
|
$html .= '<div class="ranking">'. $rating . '</div>';
|
|
|
|
|
|
return $html;
|
|
return $html;
|