|
@@ -226,30 +226,31 @@ echo '</div>';
|
|
|
|
|
|
echo '<div id="menu-wrapper">';
|
|
|
if (!api_is_anonymous()) {
|
|
|
- // @todo move all this in a class/function
|
|
|
- if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
|
|
|
+ // @todo move all this in a class/function
|
|
|
|
|
|
- //Always show the user image
|
|
|
- $img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
|
|
|
- $no_image = false;
|
|
|
- if ($img_array['file'] == 'unknown.jpg') {
|
|
|
- $no_image = true;
|
|
|
- }
|
|
|
- $img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
|
|
|
-
|
|
|
- $profile_content .='<div id="social_widget">';
|
|
|
-
|
|
|
- $profile_content .= '<div id="social_widget_image">';
|
|
|
- if (api_get_setting('allow_social_tool') == 'true') {
|
|
|
- if (!$no_image) {
|
|
|
- $profile_content .='<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
|
|
|
- } else {
|
|
|
- $profile_content .='<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
|
|
|
- }
|
|
|
+ //Always show the user image
|
|
|
+ $img_array = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', true, true);
|
|
|
+ $no_image = false;
|
|
|
+ if ($img_array['file'] == 'unknown.jpg') {
|
|
|
+ $no_image = true;
|
|
|
+ }
|
|
|
+ $img_array = UserManager::get_picture_user(api_get_user_id(), $img_array['file'], 50, USER_IMAGE_SIZE_MEDIUM, ' width="90" height="90" ');
|
|
|
+
|
|
|
+ $profile_content .='<div id="social_widget">';
|
|
|
+
|
|
|
+ $profile_content .= '<div id="social_widget_image">';
|
|
|
+ if (api_get_setting('allow_social_tool') == 'true') {
|
|
|
+ if (!$no_image) {
|
|
|
+ $profile_content .='<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
|
|
|
} else {
|
|
|
$profile_content .='<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
|
|
|
}
|
|
|
- $profile_content .= ' </div></div>';
|
|
|
+ } else {
|
|
|
+ $profile_content .='<a href="'.api_get_path(WEB_PATH).'main/auth/profile.php"><img title="'.get_lang('EditProfile').'" src="'.$img_array['file'].'" '.$img_array['style'].' border="1"></a>';
|
|
|
+ }
|
|
|
+ $profile_content .= ' </div></div>';
|
|
|
+
|
|
|
+ if (api_get_setting('allow_message_tool') == 'true') {
|
|
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
|
|
|
require_once api_get_path(LIBRARY_PATH).'social.lib.php';
|
|
@@ -272,19 +273,20 @@ if (!api_is_anonymous()) {
|
|
|
$profile_content .= '<div class="clear"></div>';
|
|
|
$profile_content .= '<div class="message-content"><ul class="menulist">';
|
|
|
$link = '';
|
|
|
- if (api_get_setting('show_tabs', 'social') == 'true') {
|
|
|
+ if (api_get_setting('allow_social_tool') == 'true') {
|
|
|
$link = '?f=social';
|
|
|
}
|
|
|
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php'.$link.'" class="message-body">'.get_lang('Inbox').$cant_msg.' </a></li>';
|
|
|
$profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php'.$link.'" class="message-body">'.get_lang('Compose').' </a></li>';
|
|
|
|
|
|
- if ($total_invitations == 0) {
|
|
|
- $total_invitations = '';
|
|
|
- } else {
|
|
|
- $total_invitations = ' ('.$total_invitations.')';
|
|
|
+ if (api_get_setting('allow_social_tool') == 'true') {
|
|
|
+ if ($total_invitations == 0) {
|
|
|
+ $total_invitations = '';
|
|
|
+ } else {
|
|
|
+ $total_invitations = ' ('.$total_invitations.')';
|
|
|
+ }
|
|
|
+ $profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' '.$total_invitations.' </a></li>';
|
|
|
}
|
|
|
- $profile_content .= '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php" class="message-body">'.get_lang('PendingInvitations').' '.$total_invitations.' </a></li>';
|
|
|
-
|
|
|
$profile_content .= '</ul>';
|
|
|
$profile_content .= '</div>';
|
|
|
}
|