diff --git a/main/inc/lib/template.lib.php b/main/inc/lib/template.lib.php index 55cd297760..f365b2abec 100644 --- a/main/inc/lib/template.lib.php +++ b/main/inc/lib/template.lib.php @@ -660,28 +660,32 @@ class Template $notification = $this->returnNotificationMenu(); $this->assign('notification_menu', $notification); - // Preparing values for the menu - // Profile link. - $this->assign('is_profile_editable', api_is_profile_readable()); + $visibility = api_is_allowed_to_create_course() ? \SystemAnnouncementManager::VISIBLE_TEACHER : \SystemAnnouncementManager::VISIBLE_STUDENT; + $announcements = \SystemAnnouncementManager::getAnnouncements($visibility, null, 'resumed', false, 50); + $this->assign('news_counter', count($announcements)); + $this->assign('news_list', $announcements); + $profile_link = null; if (api_get_setting('allow_social_tool') == 'true') { - $profile_link = ''.get_lang('Profile').''; + $profile_link = api_get_path(WEB_CODE_PATH).'social/home.php'; } else { if (api_is_profile_readable()) { - $profile_link = ''.get_lang('Profile').''; + $profile_link = api_get_path(WEB_CODE_PATH).'auth/profile.php'; } } $this->assign('profile_link', $profile_link); + $this->assign('settings_link', api_get_path(WEB_CODE_PATH).'auth/profile.php'); + // Message link. - $message_link = null; + $messageUrl = null; if (api_get_setting('allow_message_tool') == 'true') { - $message_link = ''.get_lang('Inbox').''; + $messageUrl = api_get_path(WEB_CODE_PATH).'messages/inbox.php'; } - $this->assign('message_link', $message_link); + $this->assign('message_link', $messageUrl); $institution = api_get_setting('Institution'); $portal_name = empty($institution) ? api_get_setting('siteName') : $institution; @@ -877,10 +881,7 @@ class Template $home_top = @(string)file_get_contents($homep.$menutabs.'_'.$lang.$ext); } elseif (is_file($homep.$menutabs.$lang.$ext) && is_readable($homep.$menutabs.$lang.$ext)) { $home_top = @(string)file_get_contents($homep.$menutabs.$lang.$ext); - } else { - //$errorMsg = get_lang('HomePageFilesNotReadable'); } - $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top))); $open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top); @@ -894,7 +895,6 @@ class Template $navigation[SECTION_CAMPUS] = null; } } else { - //$lis .= Display::tag('li', $open); $lis .= $open; } } @@ -1219,11 +1219,11 @@ class Template $possible_tabs = $this->getTabs(); // Campus Homepage - if (api_get_setting('show_tabs', 'campus_homepage') == 'true') { + /*if (api_get_setting('show_tabs', 'campus_homepage') == 'true') { $navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS]; } else { $menu_navigation[SECTION_CAMPUS] = $possible_tabs[SECTION_CAMPUS]; - } + }*/ if (api_get_user_id() && !api_is_anonymous()) { // My Courses @@ -1450,7 +1450,6 @@ class Template foreach ($navigation as $index => $navigation_info) { if (!empty($navigation_info['title'])) { - if ($navigation_info['url'] == '#') { $final_navigation[$index] = $navigation_info['title']; } else { @@ -1474,9 +1473,6 @@ class Template foreach ($final_navigation as $bread) { $bread_check = trim(strip_tags($bread)); if (!empty($bread_check)) { - if ($final_navigation_count - 1 > $i) { - //$bread .= '/'; - } $lis .= Display::tag('li', $bread); $i++; } diff --git a/main/template/default/layout/breadcrumb.tpl b/main/template/default/layout/breadcrumb.tpl index 07c2d21ff7..15f9220b5a 100644 --- a/main/template/default/layout/breadcrumb.tpl +++ b/main/template/default/layout/breadcrumb.tpl @@ -1,33 +1,43 @@ - - -{% if breadcrumb %} - + + {% endif %} {% endif %} + diff --git a/main/template/default/layout/footer.tpl b/main/template/default/layout/footer.tpl index 573a1cb47e..83b9a1cf22 100644 --- a/main/template/default/layout/footer.tpl +++ b/main/template/default/layout/footer.tpl @@ -210,6 +210,12 @@ $(document).ready( function() { }); }); + $('.minify').click(function(e) { + $('body').toggleClass("minified"); + $(this).effect("highlight", {}, 500); + e.preventDefault(); + }); + /** Makes row highlighting possible */ // Chosen select. diff --git a/main/template/default/layout/layout_1_col.tpl b/main/template/default/layout/layout_1_col.tpl index 059971051c..d513668e1a 100644 --- a/main/template/default/layout/layout_1_col.tpl +++ b/main/template/default/layout/layout_1_col.tpl @@ -9,26 +9,26 @@ {{ plugin_content_top}} {% endif %} + {% if app.template.show_header == true %} -
+
{% endif %} - {% include app.template_style ~ "/layout/page_body.tpl" %} + {% include app.template_style ~ "/layout/page_body.tpl" %} - {% block content %} - {% if content is not null %} -
- {{ content }} -
- {% endif %} - {% endblock %} + {% block content %} + {% if content is not null %} +
+ {{ content }} +
+ {% endif %} + {% endblock %} {% if app.template.show_header == true %}  
{% endif %} - {# Plugin bottom #} {% if plugin_content_bottom %}
diff --git a/main/template/default/layout/layout_2_col.tpl b/main/template/default/layout/layout_2_col.tpl index 98b9d3bbc3..f4d856bb09 100644 --- a/main/template/default/layout/layout_2_col.tpl +++ b/main/template/default/layout/layout_2_col.tpl @@ -70,7 +70,7 @@ {% endif %} {% endblock %}
-
+
{% block right_column %} {# Plugin bottom #} diff --git a/main/template/default/layout/main_header.tpl b/main/template/default/layout/main_header.tpl index 7cee67522a..2523a4d451 100644 --- a/main/template/default/layout/main_header.tpl +++ b/main/template/default/layout/main_header.tpl @@ -9,6 +9,14 @@ +{% set classMain = '' %} +{% if show_toolbar == 1 %} + {% set classMain = 'with-toolbar' %} + {% set classMain = '' %} +{% endif %} + +{% set containerClass = 'container' %} + {% if app.template.show_header == true %} +
+
+
+
+ {# plugin_header left #} + {% if plugin_header_left is not null %} +
+ {{ plugin_header_left }} +
+ {% endif %} +
+ +
+ {# plugin_header center #} + {% if plugin_header_center is not null %} +
+ {{ plugin_header_center }} +
+ {% endif %} +
+ +
+ {# + + #} + {# plugin_header right #} + {% if plugin_header_right is not null %} +
+ {{ plugin_header_right }} +
+ {% endif %} +
+
+
+ + {% if plugin_header_main %} +
+
+
+ {{ plugin_header_main }} +
+
+
+ {% endif %} + + {# menu #} + {% include app.template_style ~ "/layout/menu.tpl" %} +
+
{# Bug and help notifications #} {% if 0 %} @@ -30,7 +89,11 @@ {% if ("show_link_bug_notification" | get_setting) == 'true' and _u.logged != 0 %}
  • - + {% set bugLink = ("bug_report_link" | get_setting) %} + {% if ("bug_report_link" | get_setting) is empty %} + {% set bugLink = 'http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs' %} + {% endif %} + {{
  • @@ -40,79 +103,49 @@ {# topbar #} {% include app.template_style ~ "/layout/topbar.tpl" %} - {% set classMain = '' %} - {% if show_toolbar == 1 %} - {% set classMain = 'with-toolbar' %} - {% endif %} {% block main_div_container %} -
    +
    {% endblock main_div_container %} - -
    -
    -
    - {# logo #} - - - {# plugin_header left #} - {% if plugin_header_left is not null %} -
    - {{ plugin_header_left }} +
    + {% if _u.logged == 1 %} +
    - -
    {# course navigation links/shortcuts need to be activated by the admin #} {% include app.template_style ~ "/layout/course_navigation.tpl" %} {% endif %} diff --git a/main/template/default/layout/menu.tpl b/main/template/default/layout/menu.tpl index 9a2923d202..22e6f850af 100644 --- a/main/template/default/layout/menu.tpl +++ b/main/template/default/layout/menu.tpl @@ -1,57 +1,135 @@ -{% if menu is not null %} -