Minor - adding badges when receiving new emails, invitations

skala
Julio Montoya 13 years ago
parent dcf92ede10
commit 1a974bc933
  1. 2
      main/inc/lib/banner.lib.php
  2. 18
      main/inc/lib/template.lib.php
  3. 5
      main/inc/lib/userportal.lib.php

@ -79,7 +79,7 @@ function get_tabs() {
$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)?' ('.$total_invitations.')':'');
$total_invitations = (!empty($total_invitations)?' <span class="badge badge-warning">'.$total_invitations.'</span>':'');
$navigation['social']['title'] = get_lang('SocialNetwork'). $total_invitations;
}

@ -52,10 +52,9 @@ class Template extends Smarty {
//Setting user variables
$this->set_user_parameters();
//Setting course id
$course_id = api_get_course_int_id();
$this->course_id = $course_id;
//Setting course variables
$this->set_course_parameters();
//header and footer are showed by default
$this->set_footer($show_footer);
@ -212,8 +211,16 @@ class Template extends Smarty {
function get_template($name) {
return $this->style.'/'.$name;
}
}
/* Set course parameters */
private function set_course_parameters() {
//Setting course id
$course_id = api_get_course_int_id();
$this->course_id = $course_id;
}
/* Set user parameters */
private function set_user_parameters() {
$user_info = array();
$user_info['logged'] = 0;
@ -234,6 +241,7 @@ class Template extends Smarty {
$this->assign('_u', $user_info);
}
/* Set system parameters */
private function set_system_parameters() {
global $_configuration;

@ -786,6 +786,7 @@ class IndexManager {
function return_profile_block() {
$html = '';
$user_id = api_get_user_id();
if (empty($user_id)) {
return;
}
@ -825,7 +826,7 @@ class IndexManager {
$total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations;
$cant_msg = '';
if ($number_of_new_messages > 0) {
$cant_msg = ' ('.$number_of_new_messages.')';
$cant_msg = ' <span class="badge badge-warning">'.$number_of_new_messages.'</span>';
}
$link = '';
@ -839,7 +840,7 @@ class IndexManager {
if ($total_invitations == 0) {
$total_invitations = '';
} else {
$total_invitations = ' ('.$total_invitations.')';
$total_invitations = ' <span class="badge badge-warning">'.$total_invitations.'</span>';
}
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.get_lang('PendingInvitations').' '.$total_invitations.' </a></li>';
}

Loading…
Cancel
Save