Added a Link to Course catalog in main navbar if its public - Refs #8243

pull/2487/head
José Loguercio 10 years ago
parent 221d6766a4
commit bb647f4cb0
  1. 2
      main/auth/courses.php
  2. 1
      main/inc/lib/api.lib.php
  3. 9
      main/inc/lib/banner.lib.php

@ -21,7 +21,7 @@ $ctok = Security::get_existing_token();
$limit = CourseCategory::getLimitArray();
// Section for the tabs.
$this_section = SECTION_COURSES;
$this_section = SECTION_CATALOG;
if (api_get_setting('course_catalog_published') !== 'true') {
// Access rights: anonymous users can't do anything useful here.

@ -147,6 +147,7 @@ define('TOOL_COURSE_PROGRESS', 'course_progress');
// CONSTANTS defining Chamilo interface sections
define('SECTION_CAMPUS', 'mycampus');
define('SECTION_COURSES', 'mycourses');
define('SECTION_CATALOG', 'catalog');
define('SECTION_MYPROFILE', 'myprofile');
define('SECTION_MYAGENDA', 'myagenda');
define('SECTION_COURSE_ADMIN', 'course_admin');

@ -26,6 +26,11 @@ function get_tabs($courseId = null)
$navigation[SECTION_CAMPUS]['title'] = get_lang('CampusHomepage');
$navigation[SECTION_CAMPUS]['key'] = 'homepage';
$navigation[SECTION_CATALOG]['url'] = api_get_path(WEB_PATH).'main/auth/courses.php';
$navigation[SECTION_CATALOG]['title'] = get_lang('Courses');
$navigation[SECTION_CATALOG]['key'] = 'catalog';
// My Courses
if (api_is_allowed_to_create_course()) {
@ -287,6 +292,10 @@ function return_navigation_array()
$menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS];
}
if (api_get_setting('course_catalog_published') == 'true' && api_is_anonymous()) {
$navigation[SECTION_CATALOG] = $possible_tabs[SECTION_CATALOG];
}
if (api_get_user_id() && !api_is_anonymous()) {
// My Courses
if (api_get_setting('show_tabs', 'my_courses') == 'true') {

Loading…
Cancel
Save