- Beeznest
* @package chamilo.auth
*/
if (isset($_REQUEST['action']) && Security::remove_XSS($_REQUEST['action']) !== 'subscribe') {
$stok = Security::get_token();
} else {
$stok = $_SESSION['sec_token'];
}
$showCourses = CoursesAndSessionsCatalog::showCourses();
$showSessions = CoursesAndSessionsCatalog::showSessions();
$pageCurrent = isset($pageCurrent) ? $pageCurrent :
isset($_GET['pageCurrent']) ? intval($_GET['pageCurrent']) :
1;
$pageLength = isset($pageLength) ? $pageLength :
isset($_GET['pageLength']) ? intval($_GET['pageLength']) :
10;
$pageTotal = intval(ceil(intval($countCoursesInCategory) / $pageLength));
$cataloguePagination = $pageTotal > 1 ?
CourseCategory::getCatalogPagination($pageCurrent, $pageLength, $pageTotal) :
'';
$search_term = isset($search_term) ? $search_term :null;
if ($showSessions && isset($_POST['date'])) {
$date = $_POST['date'];
} else {
$date = date('Y-m-d');
}
$userInfo = api_get_user_info();
$code = isset($code) ? $code : null;
?>
".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."";
}
$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);
if ($course_hidden) {
continue;
}
$user_registerd_in_course = CourseManager::is_user_subscribed_in_course($user_id, $course['code']);
$user_registerd_in_course_as_teacher = CourseManager::is_course_teacher($user_id, $course['code']);
$user_registerd_in_course_as_student = ($user_registerd_in_course && !$user_registerd_in_course_as_teacher);
$course_public = ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD);
$course_open = ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM);
$course_private = ($course['visibility'] == COURSE_VISIBILITY_REGISTERED);
$course_closed = ($course['visibility'] == COURSE_VISIBILITY_CLOSED);
$course_subscribe_allowed = ($course['subscribe'] == 1);
$course_unsubscribe_allowed = ($course['unsubscribe'] == 1);
$count_connections = $course['count_connections'];
$creation_date = substr($course['creation_date'],0,10);
$icon_title = null;
$html = null;
// display the course bloc
$html .= '
';
// display thumbnail
$html .= return_thumbnail($course, $icon_title);
// display course title and button bloc
$html .= '
';
$html .= return_title($course);
// display button line
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
';
echo $html;
}
} else {
if (!isset($_REQUEST['subscribe_user_with_password']) &&
!isset($_REQUEST['subscribe_course'])
) {
Display::display_warning_message(get_lang('ThereAreNoCoursesInThisCategory'));
}
}
}
?>
';
if (api_get_setting('course.show_courses_descriptions_in_catalog') == 'true') {
$html .= ''. $rating . '
';
return $html;
}
/**
* Display the description button of a course in the course catalog
* @param $course
* @param $icon_title
*/
function return_description_button($course, $icon_title)
{
$title = $course['title'];
$html = '';
if (api_get_setting('course.show_courses_descriptions_in_catalog') == 'true') {
$html = '