';
// we display the icon to subscribe or the text already subscribed
echo '
';
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
echo ''.get_lang('Description').'';
}
// Get access type for course button ("enter" or/and "register")
$access_type = CourseManager::get_access_link_by_user(api_get_user_id(), $course);
// Go To Course button (only if admin, if course public or if student already subscribed)
if ($access_type && in_array('enter', $access_type)) {
echo ' '.get_lang('GoToCourse').'';
}
// Register button
if ($access_type && in_array('register', $access_type)) {
echo ' '.get_lang('Subscribe').'';
}
// If user is already subscribed to the course
if (!api_is_anonymous() && in_array($course['code'], $user_coursecodes)) {
if ($course['unsubscribe'] == UNSUBSCRIBE_ALLOWED) {
echo ' '.get_lang('Unsubscribe').'';
}
echo ' ';
echo ' ';
echo Display::label(get_lang("AlreadyRegisteredToCourse"), "info");
}
echo '