diff --git a/main/auth/courses.php b/main/auth/courses.php index a62c393c62..706f5decdb 100755 --- a/main/auth/courses.php +++ b/main/auth/courses.php @@ -21,8 +21,10 @@ $limit = getLimitArray(); // Section for the tabs. $this_section = SECTION_COURSES; -// Access rights: anonymous users can't do anything useful here. -api_block_anonymous_users(); +if (api_get_configuration_value('course_catalog_published') !== 'true') { + // Access rights: anonymous users can't do anything useful here. + api_block_anonymous_users(); +} $user_can_view_page = false; diff --git a/main/auth/courses_controller.php b/main/auth/courses_controller.php index a705034758..026ec09e91 100755 --- a/main/auth/courses_controller.php +++ b/main/auth/courses_controller.php @@ -49,7 +49,7 @@ class CoursesController // render to the view $this->view->set_data($data); - $this->view->set_layout('layout'); + $this->view->set_layout('catalog_layout'); $this->view->set_template('courses_list'); $this->view->render(); } @@ -71,7 +71,7 @@ class CoursesController // render to the view $this->view->set_data($data); - $this->view->set_layout('layout'); + $this->view->set_layout('catalog_layout'); $this->view->set_template('categories_list'); $this->view->render(); } @@ -146,7 +146,7 @@ class CoursesController // render to the view $this->view->set_data($data); - $this->view->set_layout('layout'); + $this->view->set_layout('catalog_layout'); $this->view->set_template('courses_categories'); $this->view->render(); } @@ -190,7 +190,7 @@ class CoursesController // render to the view $this->view->set_data($data); - $this->view->set_layout('layout'); + $this->view->set_layout('catalog_layout'); $this->view->set_template('courses_categories'); $this->view->render(); } diff --git a/main/template/default/auth/catalog_layout.php b/main/template/default/auth/catalog_layout.php new file mode 100644 index 0000000000..62a22ebe9b --- /dev/null +++ b/main/template/default/auth/catalog_layout.php @@ -0,0 +1,21 @@ + + * @package chamilo.auth + */ + +if (api_get_configuration_value('course_catalog_published') !== 'true') { + // Acces rights: anonymous users can't do anything usefull here. + api_block_anonymous_users(); +} + +// Header +Display::display_header(''); + +// Display +echo $content; + +// Footer +Display::display_footer();