|
|
|
@ -734,146 +734,6 @@ class IndexManager |
|
|
|
|
return $html; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return array |
|
|
|
|
*/ |
|
|
|
|
public function return_profile_block() |
|
|
|
|
{ |
|
|
|
|
$userInfo = api_get_user_info(); |
|
|
|
|
$userId = api_get_user_id(); |
|
|
|
|
if (empty($userId)) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$items = []; |
|
|
|
|
$userGroup = new UserGroupModel(); |
|
|
|
|
// @todo Add a platform setting to add the user image. |
|
|
|
|
if ('true' === api_get_setting('allow_message_tool')) { |
|
|
|
|
// New messages. |
|
|
|
|
//$number_of_new_messages = MessageManager::getCountNewMessages(); |
|
|
|
|
// New contact invitations. |
|
|
|
|
$number_of_new_messages_of_friend = SocialManager::get_message_number_invitation_by_user_id( |
|
|
|
|
$userId |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// New group invitations sent by a moderator. |
|
|
|
|
$group_pending_invitations = $userGroup->get_groups_by_user( |
|
|
|
|
$userId, |
|
|
|
|
GROUP_USER_PERMISSION_PENDING_INVITATION, |
|
|
|
|
false |
|
|
|
|
); |
|
|
|
|
$group_pending_invitations = count($group_pending_invitations); |
|
|
|
|
$total_invitations = $number_of_new_messages_of_friend + $group_pending_invitations; |
|
|
|
|
$cant_msg = Display::badge($number_of_new_messages); |
|
|
|
|
|
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'inbox-message-social', |
|
|
|
|
'icon' => Display::return_icon('inbox.png', get_lang('Inbox')), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'messages/inbox.php', |
|
|
|
|
'title' => get_lang('Inbox').$cant_msg, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'new-message-social', |
|
|
|
|
'icon' => Display::return_icon('new-message.png', get_lang('Compose')), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'messages/new_message.php', |
|
|
|
|
'title' => get_lang('Compose'), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
if ('true' == api_get_setting('allow_social_tool')) { |
|
|
|
|
$total_invitations = Display::badge($total_invitations); |
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'invitations-social', |
|
|
|
|
'icon' => Display::return_icon('invitations.png', get_lang('Pending invitations')), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'social/invitations.php', |
|
|
|
|
'title' => get_lang('Pending invitations').$total_invitations, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'personal-data', |
|
|
|
|
'icon' => Display::return_icon('database.png', get_lang('Personal data')), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'social/personal_data.php', |
|
|
|
|
'title' => get_lang('Personal data'), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
if (api_get_configuration_value('allow_my_files_link_in_homepage')) { |
|
|
|
|
if ('false' !== api_get_setting('allow_my_files')) { |
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'myfiles-social', |
|
|
|
|
'icon' => Display::return_icon('sn-files.png', get_lang('Files')), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'social/myfiles.php', |
|
|
|
|
'title' => get_lang('My files'), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'profile-social', |
|
|
|
|
'icon' => Display::return_icon('edit-profile.png', get_lang('Edit profile')), |
|
|
|
|
'link' => Display::getProfileEditionLink($userId), |
|
|
|
|
'title' => get_lang('Edit profile'), |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
if (api_get_configuration_value('show_link_request_hrm_user') && |
|
|
|
|
api_is_drh() |
|
|
|
|
) { |
|
|
|
|
$label = get_lang('Request linking to student'); |
|
|
|
|
$items[] = [ |
|
|
|
|
'icon' => Display::return_icon('new_group.png', $label), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'social/require_user_linking.php', |
|
|
|
|
'title' => $label, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (api_get_configuration_value('show_my_lps_page')) { |
|
|
|
|
$items[] = [ |
|
|
|
|
'icon' => Display::return_icon('learnpath.png', get_lang('MyLps')), |
|
|
|
|
'link' => api_get_path(WEB_CODE_PATH).'lp/my_list.php', |
|
|
|
|
'title' => get_lang('MyLps'), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (bbb::showGlobalConferenceLink($userInfo)) { |
|
|
|
|
$bbb = new bbb('', '', true, api_get_user_id()); |
|
|
|
|
$url = $bbb->getListingUrl(); |
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'video-conference', |
|
|
|
|
'icon' => Display::return_icon( |
|
|
|
|
'bbb.png', |
|
|
|
|
get_lang('Videoconference') |
|
|
|
|
), |
|
|
|
|
'link' => $url, |
|
|
|
|
'title' => get_lang('Videoconference'), |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ('true' === api_get_plugin_setting('zoom', 'tool_enable')) { |
|
|
|
|
$zoomPlugin = new ZoomPlugin(); |
|
|
|
|
$blocks = $zoomPlugin->getProfileBlockItems(); |
|
|
|
|
foreach ($blocks as $item) { |
|
|
|
|
$items[] = $item; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
true === api_get_configuration_value('whispeak_auth_enabled') && |
|
|
|
|
!WhispeakAuthPlugin::checkUserIsEnrolled($userId) |
|
|
|
|
) { |
|
|
|
|
$itemTitle = get_plugin_lang('EnrollmentTitle', WhispeakAuthPlugin::class); |
|
|
|
|
|
|
|
|
|
$items[] = [ |
|
|
|
|
'class' => 'whispeak-enrollment', |
|
|
|
|
'icon' => Display::return_icon('addworkuser.png', $itemTitle), |
|
|
|
|
'link' => WhispeakAuthPlugin::getEnrollmentUrl(), |
|
|
|
|
'title' => $itemTitle, |
|
|
|
|
]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $items; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return array |
|
|
|
|
*/ |
|
|
|
|