Fixing PHP warnings

skala
Julio Montoya 12 years ago
parent 3f4bdbd710
commit 94453c57c6
  1. 4
      main/inc/lib/course.lib.php
  2. 4
      main/template/default/auth/courses_categories.php

@ -3721,12 +3721,12 @@ class CourseManager {
$access_link = self::get_access_link_by_user(api_get_user_id(), $course_info, $my_course_code_list);
//Course visibility
if (in_array('register', $access_link)) {
if ($access_link && in_array('register', $access_link)) {
$stok = Security::get_token();
$my_course['extra_info']['register_button'] = Display::url(get_lang('Subscribe'), api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php?action=subscribe&sec_token='.$stok, array('class' => 'btn btn-primary'));
}
if (in_array('enter', $access_link)) {
if ($access_link && in_array('enter', $access_link)) {
$my_course['extra_info']['go_to_course_button'] = Display::url(get_lang('GoToCourse'), api_get_path(WEB_COURSE_PATH).$course_info['path'].'/index.php', array('class' => 'btn btn-primary'));
}

@ -174,12 +174,12 @@ $stok = Security::get_token();
$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 (in_array('enter', $access_type)) {
if ($access_type && in_array('enter', $access_type)) {
echo ' <a class="btn btn-primary" href="'. api_get_course_url($course['code']).'">'.get_lang('GoToCourse').'</a>';
}
// Register button
if (in_array('register', $access_type)) {
if ($access_type && in_array('register', $access_type)) {
echo ' <a class="btn btn-primary" href="'. api_get_self().'?action=subscribe_course&amp;sec_token='.$stok.'&amp;subscribe_course='.$course['code'].'&amp;search_term='.$search_term.'&amp;category_code='.$code.'">'.get_lang('Subscribe').'</a>';
}

Loading…
Cancel
Save