|
|
|
|
@ -10,21 +10,21 @@ $stok = Security::get_token(); |
|
|
|
|
?> |
|
|
|
|
<script type="text/javascript"> |
|
|
|
|
$(document).ready( function() { |
|
|
|
|
$('.star-rating li a').live('click', function(event) { |
|
|
|
|
var id = $(this).parents('ul').attr('id'); |
|
|
|
|
$('#vote_label2_' + id).html("<?php echo get_lang('Loading'); ?>");
|
|
|
|
|
$('.star-rating li a').live('click', function(event) { |
|
|
|
|
var id = $(this).parents('ul').attr('id'); |
|
|
|
|
$('#vote_label2_' + id).html("<?php echo get_lang('Loading'); ?>");
|
|
|
|
|
$.ajax({ |
|
|
|
|
url: $(this).attr('data-link'), |
|
|
|
|
success: function(data) { |
|
|
|
|
$("#rating_wrapper_"+id).html(data); |
|
|
|
|
if(data == 'added') { |
|
|
|
|
if(data == 'added') { |
|
|
|
|
//$('#vote_label2_' + id).html("{'Saved'|get_lang}"); |
|
|
|
|
} |
|
|
|
|
if(data == 'updated') { |
|
|
|
|
//$('#vote_label2_' + id).html("{'Saved'|get_lang}"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
@ -32,26 +32,26 @@ $stok = Security::get_token(); |
|
|
|
|
<?php if (intval($_GET['hidden_links']) != 1) { ?> |
|
|
|
|
|
|
|
|
|
<div class="actions"> |
|
|
|
|
<form class="form-search" method="post" action="<?php echo api_get_self(); ?>?action=subscribe&hidden_links=0">
|
|
|
|
|
<form class="form-search" method="post" action="<?php echo api_get_self(); ?>?action=subscribe&hidden_links=0">
|
|
|
|
|
<input type="hidden" name="sec_token" value="<?php echo $stok; ?>">
|
|
|
|
|
<input type="hidden" name="search_course" value="1" /> |
|
|
|
|
<input type="text" name="search_term" value="<?php echo (empty($_POST['search_term']) ? '' : api_htmlentities(Security::remove_XSS($_POST['search_term']))); ?>" />
|
|
|
|
|
<button class="search" type="submit"><?php echo get_lang('SearchCourse'); ?></button>
|
|
|
|
|
</form> |
|
|
|
|
</form> |
|
|
|
|
</div> |
|
|
|
|
<?php
|
|
|
|
|
<?php |
|
|
|
|
$hidden_links = 0; |
|
|
|
|
} else { |
|
|
|
|
$hidden_links = 1; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$hidden_links = 1; |
|
|
|
|
} |
|
|
|
|
?> |
|
|
|
|
<div class="row"> |
|
|
|
|
<div class="span3"> |
|
|
|
|
<div class="well"> |
|
|
|
|
<?php
|
|
|
|
|
if (!empty($browse_course_categories)) { |
|
|
|
|
<?php |
|
|
|
|
if (!empty($browse_course_categories)) { |
|
|
|
|
echo '<a class="btn" href="'.api_get_self().'?action=display_random_courses">'.get_lang('RandomPick').'</a><br /><br />'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// level 1 |
|
|
|
|
foreach ($browse_course_categories[0] as $category) { |
|
|
|
|
$category_name = $category['name']; |
|
|
|
|
@ -64,11 +64,11 @@ $stok = Security::get_token(); |
|
|
|
|
if (!empty($count_courses_lv1)) { |
|
|
|
|
$category_link = '<a href="'. api_get_self().'?action=display_courses&category_code='.$category_code.'&hidden_links='.$hidden_links.'">'.$category_name.'</a> ('.$count_courses_lv1.')'; |
|
|
|
|
} else { |
|
|
|
|
$category_link = ''.$category_name.' ('.$count_courses_lv1.')'; |
|
|
|
|
$category_link = ''.$category_name.' ('.$count_courses_lv1.')'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '<div>'.$category_link.'</div>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// level 2 |
|
|
|
|
if (!empty($browse_course_categories[$category_code])) { |
|
|
|
|
foreach ($browse_course_categories[$category_code] as $subcategory1) { |
|
|
|
|
@ -82,7 +82,7 @@ $stok = Security::get_token(); |
|
|
|
|
} |
|
|
|
|
echo '<div style="margin-left:20px;">'.$subcategory1_link.'</div>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// level 3 |
|
|
|
|
if (!empty($browse_course_categories[$subcategory1_code])) { |
|
|
|
|
foreach ($browse_course_categories[$subcategory1_code] as $subcategory2) { |
|
|
|
|
@ -99,25 +99,25 @@ $stok = Security::get_token(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
?> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="span9"> |
|
|
|
|
<?php
|
|
|
|
|
if (!empty($message)) { Display::display_confirmation_message($message, false); } |
|
|
|
|
if (!empty($error)) { Display::display_error_message($error, false); } |
|
|
|
|
<?php |
|
|
|
|
if (!empty($message)) { Display::display_confirmation_message($message, false); } |
|
|
|
|
if (!empty($error)) { Display::display_error_message($error, false); } |
|
|
|
|
|
|
|
|
|
if (!empty($search_term)) { |
|
|
|
|
echo "<p><strong>".get_lang('SearchResultsFor')." ".Security::remove_XSS($_POST['search_term'])."</strong><br />"; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=add_course_vote'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($browse_courses_in_category)) { |
|
|
|
|
|
|
|
|
|
foreach ($browse_courses_in_category as $course) { |
|
|
|
|
foreach ($browse_courses_in_category as $course) { |
|
|
|
|
// if course is closed, don't show it. |
|
|
|
|
if ($course['visibility'] == COURSE_VISIBILITY_CLOSED) { |
|
|
|
|
continue; |
|
|
|
|
@ -125,57 +125,59 @@ $stok = Security::get_token(); |
|
|
|
|
// course isn't closed |
|
|
|
|
$title = cut($course['title'], 70); |
|
|
|
|
$tutor_name = $course['tutor']; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$creation_date = substr($course['creation_date'],0,10); |
|
|
|
|
$count_connections = $course['count_connections']; |
|
|
|
|
|
|
|
|
|
$course_path = api_get_path(SYS_COURSE_PATH).$course['directory']; // course path |
|
|
|
|
|
|
|
|
|
if (file_exists($course_path.'/course-pic85x85.png')) { |
|
|
|
|
if (file_exists($course_path.'/course-pic85x85.png')) { |
|
|
|
|
$course_medium_image = api_get_path(WEB_COURSE_PATH).$course['directory'].'/course-pic85x85.png'; // redimensioned image 85x85 |
|
|
|
|
} else { |
|
|
|
|
$course_medium_image = api_get_path(WEB_IMG_PATH).'without_picture.png'; // without picture |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$rating = Display::return_rating_system('star_'.$course['real_id'], $ajax_url.'&course_id='.$course['real_id'], $course['point_info']); |
|
|
|
|
|
|
|
|
|
echo '<div class="well_border"><div class="row">'; |
|
|
|
|
|
|
|
|
|
echo '<div class="well_border"><div class="row">'; |
|
|
|
|
echo '<div class="span2">'; |
|
|
|
|
echo '<div class="thumbnail">'; |
|
|
|
|
echo '<div class="thumbnail">'; |
|
|
|
|
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
|
|
|
|
echo '<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]">'; |
|
|
|
|
echo '<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]">'; |
|
|
|
|
echo '<img src="'.$course_medium_image.'" />'; |
|
|
|
|
echo '</a>'; |
|
|
|
|
} else { |
|
|
|
|
echo '<img src="'.$course_medium_image.'" />'; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
echo '</div>';//thumb |
|
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
|
|
echo '<div class="span4">'; |
|
|
|
|
echo '<div class="categories-course-description"><h3>'.cut($title, 60).'</h3>'.$rating.'</div>'; |
|
|
|
|
|
|
|
|
|
$teachers = CourseManager::get_teacher_list_from_course_code_to_string($course['code']); |
|
|
|
|
$teachers = '<h5>'.$teachers.'</h5>'; |
|
|
|
|
echo '<div class="categories-course-description"><h3>'.cut($title, 60).'</h3>'.$teachers.$rating.'</div>'; |
|
|
|
|
|
|
|
|
|
echo '<p>'; |
|
|
|
|
// we display the icon to subscribe or the text already subscribed |
|
|
|
|
echo '<div class="btn-toolbar">'; |
|
|
|
|
|
|
|
|
|
echo '<div class="btn-toolbar">'; |
|
|
|
|
|
|
|
|
|
if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { |
|
|
|
|
echo '<a class="ajax btn" href="'.api_get_path(WEB_CODE_PATH).'inc/ajax/course_home.ajax.php?a=show_course_information&code='.$course['code'].'" title="'.$icon_title.'" class="thickbox">'.get_lang('Description').'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Go To Course button |
|
|
|
|
if (!api_is_anonymous() |
|
|
|
|
if (!api_is_anonymous() |
|
|
|
|
&& ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM)) { |
|
|
|
|
echo ' <a class="btn btn-primary" href="'. api_get_course_url($course['code']).'">'.get_lang('GoToCourse').'</a>'; |
|
|
|
|
} |
|
|
|
|
// Subscribe button |
|
|
|
|
if (!api_is_anonymous() |
|
|
|
|
&& ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM) |
|
|
|
|
&& $course['subscribe'] == SUBSCRIBE_ALLOWED |
|
|
|
|
if (!api_is_anonymous() |
|
|
|
|
&& ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || $course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM) |
|
|
|
|
&& $course['subscribe'] == SUBSCRIBE_ALLOWED |
|
|
|
|
&& (!in_array($course['code'], $user_coursecodes) || empty($user_coursecodes))) { |
|
|
|
|
echo ' <a class="btn btn-primary" href="'. api_get_self().'?action=subscribe_course&sec_token='.$stok.'&subscribe_course='.$course['code'].'&search_term='.$search_term.'&category_code='.$code.'">'.get_lang('Subscribe').'</a>'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// If user is already subscribed to the course |
|
|
|
|
if (!api_is_anonymous() && in_array($course['code'], $user_coursecodes)) { |
|
|
|
|
echo '<br />'; |
|
|
|
|
@ -183,11 +185,11 @@ $stok = Security::get_token(); |
|
|
|
|
echo Display::label(get_lang("AlreadyRegisteredToCourse"), "info"); |
|
|
|
|
} |
|
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo '</p>'; |
|
|
|
|
echo '</div>'; |
|
|
|
|
echo '</div>'; |
|
|
|
|
|
|
|
|
|
echo '<div class="span2">'; |
|
|
|
|
echo '<div class="span2">'; |
|
|
|
|
echo '<div class="course-block-popularity"><span>'.get_lang('ConnectionsLastMonth').'</span><div class="course-block-popularity-score">'.$count_connections.'</div></div>'; |
|
|
|
|
echo '</div>'; |
|
|
|
|
echo '</div></div>'; |
|
|
|
|
@ -195,6 +197,6 @@ $stok = Security::get_token(); |
|
|
|
|
} else { |
|
|
|
|
echo Display::display_warning_message(get_lang('ThereAreNoCoursesInThisCategory')); |
|
|
|
|
} |
|
|
|
|
?> |
|
|
|
|
?> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|