function return_notification_menu() { $_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 = who_is_online_count(api_get_setting('time_limit_whosonline')); $number_online_in_course = 0; if (!empty($_course['id'])) { $number_online_in_course = 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="' . api_get_path(WEB_PATH) . 'whoisonline.php" 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="' . api_get_path(WEB_PATH) . 'whoisonline.php?cidReq=' . $_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>'; } } //if (api_get_setting('showonline', 'session') == 'true') { // Display the who's online for the session if (isset($user_id) && api_get_session_id() != 0) { $html .= '<li><a href="' . api_get_path(WEB_PATH) . 'whoisonlinesession.php?id_coach=' . $user_id . '&referer=' . urlencode($_SERVER['REQUEST_URI']) . '" target="_top">' . 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; }
function return_notification_menu() { $_course = api_get_course_info(); $course_id = 0; if (!empty($_course)) { $course_id = $_course['code']; } $user_id = api_get_user_id(); $html = ''; if (api_get_setting('showonline', 'world') == 'true' && !$user_id || api_get_setting('showonline', 'users') == 'true' && $user_id || api_get_setting('showonline', 'course') == 'true' && $user_id && $course_id) { $number = UserManager::whoIsOnlineCount(api_get_setting('display.time_limit_whosonline')); $number_online_in_course = 0; if (!empty($_course['id'])) { $number_online_in_course = who_is_online_in_this_course_count($user_id, api_get_setting('display.time_limit_whosonline'), $_course['id']); } // Display the who's online of the platform if ($number) { if (api_get_setting('showonline', 'world') == 'true' && !$user_id || api_get_setting('showonline', 'users') == 'true' && $user_id) { $html .= '<li><a href="' . api_get_path(WEB_PATH) . 'whoisonline.php" target="_self" 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) && api_get_setting('showonline', 'course') == 'true' && isset($_course['sysCode'])) { $html .= '<li><a href="' . api_get_path(WEB_PATH) . 'whoisonline.php?cidReq=' . $_course['sysCode'] . '" target="_self">' . Display::return_icon('course.png', get_lang('UsersOnline') . ' ' . get_lang('InThisCourse'), array(), ICON_SIZE_TINY) . ' ' . $number_online_in_course . ' </a></li>'; } } //if (api_get_setting('showonline', 'session') == 'true') { // Display the who's online for the session if (isset($user_id) && api_get_session_id() != 0) { $html .= '<li><a href="' . api_get_path(WEB_PATH) . 'whoisonlinesession.php?id_coach=' . $user_id . '&referer=' . urlencode($_SERVER['REQUEST_URI']) . '" target="_self">' . Display::return_icon('session.png', get_lang('UsersConnectedToMySessions'), array(), ICON_SIZE_TINY) . ' </a></li>'; } //} } return $html; }