Merge pull request #762 from AngelFQC/BT10060

Allow course/session catalog published - refs BT#10060 #TMI
1.10.x
Angel Fernando Quiroz Campos 10 years ago
commit ec557583fa
  1. 6
      main/auth/courses.php
  2. 8
      main/auth/courses_controller.php
  3. 5
      main/install/configuration.dist.php
  4. 21
      main/template/default/auth/catalog_layout.php
  5. 41
      main/template/default/auth/session_catalog.tpl

@ -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;

@ -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();
}

@ -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');
//$_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';

@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring course/session catalog
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
* @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();

@ -90,49 +90,48 @@
</h3>
<ul class="list-unstyled">
{% if show_tutor %}
<li class="author-session">
<i class="fa fa-user"></i> {{ session.coach_name }}
</li>
<li class="author-session">
<i class="fa fa-user"></i> {{ session.coach_name }}
</li>
{% endif %}
<li class="date-session">
<i class="fa fa-calendar-o"></i> {{ session.date }}
</li>
{% if session.tags %}
<li class="tags-session">
<i class="fa fa-tags"></i> {{ session.tags|join(', ')}}
</li>
<li class="tags-session">
<i class="fa fa-tags"></i> {{ session.tags|join(', ')}}
</li>
{% endif %}
</ul>
<div class="requirements">
{% if session.requirements %}
<p><i class="fa fa-book"></i> {{ 'RequiredSessions'|get_lang }} :
{% for requirement in session.requirements %}
{{ requirement.name }}
{% endfor %}
</p>
<p><i class="fa fa-book"></i> {{ 'RequiredSessions'|get_lang }} :
{% for requirement in session.requirements %}
{{ requirement.name }}
{% endfor %}
</p>
{% endif %}
{% if session.dependencies %}
<p> <i class="fa fa-book"></i> {{ 'DependentSessions'|get_lang }} :
{% for dependency in session.dependencies %}
{{ dependency.name }}
{% endfor %}
</p>
<p> <i class="fa fa-book"></i> {{ 'DependentSessions'|get_lang }} :
{% for dependency in session.dependencies %}
{{ dependency.name }}
{% endfor %}
</p>
{% endif %}
</div>
<div class="options">
<p class="buttom-subscribed">
{% if session.is_subscribed %}
{{ already_subscribed_label }}
{{ already_subscribed_label }}
{% elseif _u.logged == 0 %}
{{ '' }}
{% else %}
{{ session.subscribe_button }}
{{ session.subscribe_button }}
{% endif %}
</p>
</div>
</div>
</div>
</div>
{% else %}

Loading…
Cancel
Save