Skip to content

Commit

Permalink
Added a Link to Course catalog in main navbar if its public - Refs #8243
Browse files Browse the repository at this point in the history
  • Loading branch information
jloguercio committed May 19, 2016
1 parent 221d676 commit bb647f4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion main/auth/courses.php
Expand Up @@ -21,7 +21,7 @@
$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.
Expand Down
1 change: 1 addition & 0 deletions main/inc/lib/api.lib.php
Expand Up @@ -147,6 +147,7 @@
// 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');
Expand Down
9 changes: 9 additions & 0 deletions main/inc/lib/banner.lib.php
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit bb647f4

Please sign in to comment.