/** * @return string */ public function returnNotificationMenu() { $_course = api_get_course_info(); $course_id = api_get_course_id(); $user_id = api_get_user_id(); $html = ''; if (api_get_setting('showonline', 'world') == 'true' and !$user_id or api_get_setting('showonline', 'users') == 'true' and $user_id or api_get_setting('showonline', 'course') == 'true' and $user_id and $course_id) { $number = Online::who_is_online_count(api_get_setting('time_limit_whosonline')); $number_online_in_course = 0; if (!empty($_course['id'])) { $number_online_in_course = Online::who_is_online_in_this_course_count($user_id, api_get_setting('time_limit_whosonline'), $_course['id']); } // Display the who's online of the platform if ($number) { if (api_get_setting('showonline', 'world') == 'true' and !$user_id or api_get_setting('showonline', 'users') == 'true' and $user_id) { $html .= '<li><a href="' . SocialManager::getUserOnlineLink() . '" target="_top" title="' . get_lang('UsersOnline') . '" >' . Display::return_icon('user.png', get_lang('UsersOnline'), array(), ICON_SIZE_TINY) . ' ' . $number . '</a></li>'; } } // Display the who's online for the course if ($number_online_in_course) { if (is_array($_course) and api_get_setting('showonline', 'course') == 'true' and isset($_course['sysCode'])) { $html .= '<li><a href="' . SocialManager::getUserOnlineLink($_course['sysCode']) . '" target="_top">' . Display::return_icon('course.png', get_lang('UsersOnline') . ' ' . get_lang('InThisCourse'), array(), ICON_SIZE_TINY) . ' ' . $number_online_in_course . ' </a></li>'; } } // Display the who's online for the session if (api_get_setting('showonline', 'session') == 'true') { if (isset($user_id) && api_get_session_id() != 0) { if (api_is_allowed_to_edit()) { $html .= '<li><a href="' . SocialManager::getUserOnlineLink(null, api_get_session_id()) . '&id_coach=' . $user_id . '" >' . Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array(), ICON_SIZE_TINY) . ' </a></li>'; } } } } if (api_get_setting('accessibility_font_resize') == 'true') { $html .= '<li class="resize_font">'; $html .= '<span class="decrease_font" title="' . get_lang('DecreaseFontSize') . '">A</span> <span class="reset_font" title="' . get_lang('ResetFontSize') . '">A</span> <span class="increase_font" title="' . get_lang('IncreaseFontSize') . '">A</span>'; $html .= '</li>'; } return $html; }