Adding welcome to course block see #3898

skala
Julio Montoya 13 years ago
parent 8f79e78717
commit 9b35d61430
  1. 18
      main/inc/lib/userportal.lib.php
  2. 3
      main/lang/english/index.inc.php
  3. 1
      main/lang/english/trad4all.inc.php
  4. 7
      main/template/default/layout/layout_2_col.tpl
  5. 10
      main/template/default/layout/welcome_to_course.tpl
  6. 5
      user_portal.php

@ -1055,10 +1055,26 @@ class IndexManager {
} }
} }
} }
return $sessions_with_category.$sessions_with_no_category.$courses_html.$special_courses; return $sessions_with_category.$sessions_with_no_category.$courses_html.$special_courses;
} }
/**
* Shows a welcome message when the user doesn't have any content in the course list
*/
function return_welcome_to_course_block() {
$tpl = $this->tpl->get_template('layout/welcome_to_course.tpl');
$course_catalog_url = api_get_path(WEB_CODE_PATH).'auth/courses.php';
$course_list_url = api_get_path(WEB_PATH).'user_portal.php';
$this->tpl->assign('course_catalog_url', $course_catalog_url);
$this->tpl->assign('course_list_url', $course_list_url);
$this->tpl->assign('course_catalog_link', Display::url(get_lang('here'), $course_catalog_url));
$this->tpl->assign('course_list_link', Display::url(get_lang('here'), $course_list_url));
return $this->tpl->fetch($tpl);
}
function return_hot_courses() { function return_hot_courses() {
return CourseManager::return_hot_courses(); return CourseManager::return_hot_courses();
} }

@ -75,4 +75,7 @@ $YouDoNotHaveAnySessionInItsHistory = "You have no session in your sessions hist
$PortalHomepageDefaultIntroduction = "<h2>Congratulations! You have successfully installed your e-learning portal!</h2> <p>You can now complete the installation by following three easy steps:<br /> <ol> <li>Configure you portal by going to the administration section, and select the Portal -> <a href=\"main/admin/settings.php\">Configuration settings</a> entry.</li> <li>Add some life to your portal by creating users and/or training. You can do that by inviting new people to create their accounts or creating them yourself through the <a href=\"main/admin/\">administration</a>'s Users and Training sections.</li> <li>Edit this page through the <a href=\"main/admin/configure_homepage.php\">Edit portal homepage</a> entry in the administration section.</li> </ol> <p>You can always find more information about this software on our website: <a href=\"http://www.chamilo.org\">http://www.chamilo.org</a>.</p> <p>Have fun, and don't hesitate to join the community and give us feedback through <a href=\"http://www.chamilo.org/forum\">our forum</a>.</p>"; $PortalHomepageDefaultIntroduction = "<h2>Congratulations! You have successfully installed your e-learning portal!</h2> <p>You can now complete the installation by following three easy steps:<br /> <ol> <li>Configure you portal by going to the administration section, and select the Portal -> <a href=\"main/admin/settings.php\">Configuration settings</a> entry.</li> <li>Add some life to your portal by creating users and/or training. You can do that by inviting new people to create their accounts or creating them yourself through the <a href=\"main/admin/\">administration</a>'s Users and Training sections.</li> <li>Edit this page through the <a href=\"main/admin/configure_homepage.php\">Edit portal homepage</a> entry in the administration section.</li> </ol> <p>You can always find more information about this software on our website: <a href=\"http://www.chamilo.org\">http://www.chamilo.org</a>.</p> <p>Have fun, and don't hesitate to join the community and give us feedback through <a href=\"http://www.chamilo.org/forum\">our forum</a>.</p>";
$Username = "User name"; $Username = "User name";
$Profile = "Profile"; $Profile = "Profile";
$HelloXAsYouCanSeeYourCourseListIsEmpty = "<p>Hello <strong>%s</strong> and welcome,</p>
<p>As you can see, your courses list is still empty. That's because you are not registered to any course yet! </p>";
$GoAheadAndBrowseOurCourseCatalogXOnceRegisteredYouWillSeeTheCourseHereX = "<p>Go ahead and browse our course catalog %s to register to any course you like. Once registered, you will see the course appear right %s, instead of this message.</p>";
?> ?>

@ -1334,4 +1334,5 @@ $DataTableSearch = "Search";
$HideColumn = "Hide column"; $HideColumn = "Hide column";
$DisplayColumn = "Show column"; $DisplayColumn = "Show column";
$LegalAgreementAccepted = "Legal agreement accepted"; $LegalAgreementAccepted = "Legal agreement accepted";
$here = "here";
?> ?>

@ -28,6 +28,13 @@
{% include "default/layout/page_body.tpl" %} {% include "default/layout/page_body.tpl" %}
{# Welcome to course block #}
{% if welcome_to_course_block %}
<section id="welcome_to_course">
{{ welcome_to_course_block }}
</section>
{% endif %}
{% if content is not null %} {% if content is not null %}
<section id="main_content"> <section id="main_content">
{{ content }} {{ content }}

@ -0,0 +1,10 @@
{{ "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>
{% endif %}

@ -155,6 +155,11 @@ $user_id = api_get_user_id();
// Main courses and session list // Main courses and session list
$courses_and_sessions = $controller->return_courses_and_sessions($user_id); $courses_and_sessions = $controller->return_courses_and_sessions($user_id);
//Show the chamilo mascot
if (empty($courses_and_sessions)) {
$controller->tpl->assign('welcome_to_course_block', $controller->return_welcome_to_course_block());
}
$controller->tpl->assign('content', $courses_and_sessions); $controller->tpl->assign('content', $courses_and_sessions);
if (api_get_setting('allow_browser_sniffer') == 'true') { if (api_get_setting('allow_browser_sniffer') == 'true') {

Loading…
Cancel
Save