Should fix bug in welcome message see #3898

skala
Yoselyn Castillo 13 years ago
parent 2d878c8c5d
commit 221276335b
  1. 2
      main/inc/lib/course.lib.php
  2. 22
      main/template/default/layout/welcome_to_course.tpl

@ -3781,7 +3781,7 @@ class CourseManager {
* @param int Access URL ID (optional)
* @return int Number of courses
*/
public static function count_courses($access_url_id=null) {
public static function count_courses($access_url_id = null) {
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql = "SELECT count(id) FROM $table_course c";

@ -1,12 +1,18 @@
{{ "HelloXAsYouCanSeeYourCourseListIsEmpty"|get_lang | format(_u.complete_name) }}
{% if "allow_students_to_browse_courses"|get_setting == 'true' %}
{{ "GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX"|get_lang|format(course_catalog_link, course_list_link) }}
<a class="btn btn-primary btn-large" href="{{ course_catalog_url }}">
{{ "CourseCatalog"|get_lang }}
</a>
{% else %}
{% if count_courses == 0 %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
{% else %}
{% if "allow_students_to_browse_courses"|get_setting == 'true' %}
{{ "GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX"|get_lang|format(course_catalog_link, course_list_link) }}
<a class="btn btn-primary btn-large" href="{{ course_catalog_url }}">
{{ "CourseCatalog"|get_lang }}
</a>
{% else %}
{{ "PleaseAllowUsALittleTimeToSubscribeYouToOneOfOurCourses"|get_lang }}
{% endif %}
{% endif %}
Loading…
Cancel
Save