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/install/configuration.dist.php b/main/install/configuration.dist.php index 2cf06214e0..773bf7bcec 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -211,4 +211,7 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE; // Detail view of gradebook categories. //$_configuration['gradebook_detailed_admin_view'] = false; // E-mail accounts to send notifications to when executing cronjobs - works for main/cron/import_csv.php -//$_configuration['cron_notification_mails'] = array('email@example.com', 'email2@example.com'); \ No newline at end of file +//$_configuration['cron_notification_mails'] = array('email@example.com', 'email2@example.com'); + +// Allow anonymous users to see the courses/sessions catalogue +//$_configuration['course_catalog_published'] = 'false'; 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(); diff --git a/main/template/default/auth/session_catalog.tpl b/main/template/default/auth/session_catalog.tpl index e1127497c9..7fcfab92b2 100644 --- a/main/template/default/auth/session_catalog.tpl +++ b/main/template/default/auth/session_catalog.tpl @@ -90,49 +90,48 @@
{{ 'RequiredSessions'|get_lang }} : - {% for requirement in session.requirements %} - {{ requirement.name }} - {% endfor %} -
+{{ 'RequiredSessions'|get_lang }} : + {% for requirement in session.requirements %} + {{ requirement.name }} + {% endfor %} +
{% endif %} {% if session.dependencies %} -{{ 'DependentSessions'|get_lang }} : - {% for dependency in session.dependencies %} - {{ dependency.name }} - {% endfor %} -
+{{ 'DependentSessions'|get_lang }} : + {% for dependency in session.dependencies %} + {{ dependency.name }} + {% endfor %} +
{% endif %}