Changion position of the notificaction counter

skala
Julio Montoya 13 years ago
parent 6f42717656
commit dacc75de8c
  1. 15
      main/inc/lib/banner.lib.php
  2. 32
      main/inc/lib/template.lib.php
  3. 7
      main/template/default/layout/menu.tpl

@ -60,8 +60,10 @@ function get_tabs() {
$navigation['session_my_progress']['url'] = api_get_path(WEB_CODE_PATH).'auth/my_progress.php';
$navigation['session_my_progress']['title'] = get_lang('MyProgress');
}
// Social
// Social
/*
if (api_get_setting('allow_social_tool')=='true') {
$navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php';
@ -79,7 +81,14 @@ function get_tabs() {
$navigation['social']['title'] = get_lang('SocialNetwork'). $total_invitations;
}
*/
// Social
if (api_get_setting('allow_social_tool')=='true') {
$navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php';
$navigation['social']['title'] = get_lang('SocialNetwork');
}
// Dashboard
if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) {
$navigation['dashboard']['url'] = api_get_path(WEB_CODE_PATH).'dashboard/index.php';

@ -593,11 +593,14 @@ class Template {
//Profile link
if (api_get_setting('allow_social_tool') == 'true') {
$profile_link = '<a href="'.api_get_path(WEB_CODE_PATH).'social/home.php">'.get_lang('Profile').'</a>';
$profile_url = api_get_path(WEB_CODE_PATH).'social/home.php';
$profile_link = Display::url(get_lang('Profile'), $profile_url);
} else {
$profile_link = '<a href="'.api_get_path(WEB_CODE_PATH).'auth/profile.php">'.get_lang('Profile').'</a>';
$profile_url = api_get_path(WEB_CODE_PATH).'auth/profile.php';
$profile_link = Display::url(get_lang('Profile'), $profile_url);
}
$this->assign('profile_link', $profile_link);
$this->assign('profile_url', $profile_url);
//Message link
$message_link = null;
@ -610,10 +613,35 @@ class Template {
$portal_name = empty($institution) ? api_get_setting('siteName') : $institution;
$this->assign('portal_name', $portal_name);
//Menu
$menu = return_menu();
$this->assign('menu', $menu);
//Setting notifications
$count_unread_message = 0;
if (api_get_setting('allow_message_tool')=='true') {
// get count unread message and total invitations
$count_unread_message = MessageManager::get_number_of_messages(true);
}
$total_invitations = 0;
if (api_get_setting('allow_social_tool')=='true') {
$number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id(api_get_user_id());
$group_pending_invitations = GroupPortalManager::get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_PENDING_INVITATION,false);
$group_pending_invitations = 0;
if (!empty($group_pending_invitations )) {
$group_pending_invitations = count($group_pending_invitations);
}
$total_invitations = intval($number_of_new_messages_of_friend) + $group_pending_invitations + intval($count_unread_message);
}
$total_invitations = (!empty($total_invitations) ? Display::badge($total_invitations) : null);
$this->assign('user_notifications', $total_invitations);
//Breadcrumb
$breadcrumb = return_breadcrumb($interbreadcrumb, $language_file, $nameTools);
$this->assign('breadcrumb', $breadcrumb);

@ -16,6 +16,13 @@
{% if _u.logged == 1 %}
<ul class="nav pull-right">
{% if user_notifications is not null %}
<li>
<a href="{{ profile_url }}">{{ user_notifications }}</a>
</li>
{% endif %}
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
<img src="{{ _u.avatar_small }}"/>

Loading…
Cancel
Save