Julio Montoya 15 years ago
parent
commit
8d12aac236

+ 3 - 16
main/auth/profile.php

@@ -813,15 +813,14 @@ $big_image_height = $big_image_size[1];
 $url_big_image = $big_image.'?rnd='.time();
 
 
-if (api_get_setting('allow_social_tool') == 'true') {	
+if (api_get_setting('allow_social_tool') == 'true') {
 	echo '<div id="social-content">';
 	
 		echo '<div id="social-content-left">';
 		SocialManager::show_social_menu('home', null, $user_id, $show_full_profile);
 		echo '</div>';
 	
-		echo '<div id="social-content-right">';
-		
+		echo '<div id="social-content-right">';		
 			echo '<div id="social-content-online">';
 				if (api_get_setting('extended_profile') == 'true') {				
 					$show = isset($_GET['show']) ? '&amp;show='.Security::remove_XSS($_GET['show']) : '';							 
@@ -831,19 +830,7 @@ if (api_get_setting('allow_social_tool') == 'true') {
 						echo '<a href="profile.php?type=extended'.$show.'"><span class="social-menu-text1">'.Display::return_icon('edit.gif', get_lang('EditExtendProfile')).'&nbsp;'.get_lang('EditExtendProfile').'</span></a>';
 					}				
 				}			
-			echo '</div>';
-			
-		
-			// Style position:absolute has been removed for Opera-compatibility. 
-			//echo '<div id="image-message-container" style="float:right;display:inline;position:absolute;padding:3px;width:250px;" >';
-			echo '<div id="image-message-container" style="float:right;display:inline;padding:3px;width:150px;" >';
-			
-			if ($image == 'unknown.jpg') {
-				echo '<img '.$img_attributes.' />';
-			} else {
-				echo '<input type="image" '.$img_attributes.' onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
-			}
-			echo '</div>';		
+			echo '</div>';	
 			$form->display();
 		echo '</div>';
 	echo '</div>';

+ 3 - 3
main/css/academica/default.css

@@ -2600,7 +2600,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -2630,7 +2630,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -2845,7 +2845,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/baby_orange/default.css

@@ -2589,7 +2589,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -2619,7 +2619,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#EE8204;
@@ -2834,7 +2834,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/blue_lagoon/default.css

@@ -3215,7 +3215,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3245,7 +3245,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -3460,7 +3460,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 4 - 4
main/css/chamilo/default.css

@@ -3428,9 +3428,9 @@ div.image-social-content center.friend {
 #social-content-left {
 	float:left;
 	height:auto;
-	margin-right:16px;
+	margin-right:2px;
 	min-height:300px;
-	width:200px;
+	width:195px;
 	overflow:hidden;	
 }
 .social-content-description {
@@ -3488,7 +3488,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3518,7 +3518,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#00AAE3;

+ 3 - 3
main/css/cool_blue/default.css

@@ -3098,7 +3098,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3128,7 +3128,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -3343,7 +3343,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/corporate/default.css

@@ -2588,7 +2588,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -2618,7 +2618,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#434343;
@@ -2833,7 +2833,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/cosmic_campus/default.css

@@ -2627,7 +2627,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -2657,7 +2657,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -2872,7 +2872,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/delicious_bordeaux/default.css

@@ -3110,7 +3110,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3140,7 +3140,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#975B5B;
@@ -3355,7 +3355,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/dokeos_blue/default.css

@@ -3103,7 +3103,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3133,7 +3133,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#4171B5;
@@ -3348,7 +3348,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/dokeos_classic/default.css

@@ -3385,7 +3385,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3415,7 +3415,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -3630,7 +3630,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/dokeos_classic_2D/default.css

@@ -3413,7 +3413,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3443,7 +3443,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -3658,7 +3658,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/empire_green/default.css

@@ -3113,7 +3113,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3143,7 +3143,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#5B975B;
@@ -3358,7 +3358,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/fruity_orange/default.css

@@ -3115,7 +3115,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3145,7 +3145,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#F8B846;
@@ -3360,7 +3360,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/medical/default.css

@@ -3569,7 +3569,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3599,7 +3599,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#AF8B97;
@@ -3814,7 +3814,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/public_admin/default.css

@@ -3293,7 +3293,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3323,7 +3323,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#32578b;
@@ -3538,7 +3538,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/royal_purple/default.css

@@ -3107,7 +3107,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3137,7 +3137,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#8E5B97;
@@ -3352,7 +3352,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/silver_line/default.css

@@ -2982,7 +2982,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3012,7 +3012,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#A5A6AA;
@@ -3227,7 +3227,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/sober_brown/default.css

@@ -3290,7 +3290,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3320,7 +3320,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#716D61;
@@ -3535,7 +3535,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/steel_grey/default.css

@@ -3116,7 +3116,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3146,7 +3146,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#808080;
@@ -3361,7 +3361,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 3 - 3
main/css/tasty_olive/default.css

@@ -3118,7 +3118,7 @@ div.image-social-content center.friend {
 
 /*  SOCIAL MENU VERTICAL */
 .social-menu  {
-	width:180px;
+	width:100%;
 	height:auto;
 }
 .social-menu ul {
@@ -3148,7 +3148,7 @@ div.image-social-content center.friend {
 	margin-left:20px;
 }
 .social-menu-title{
-	width:180px;
+	width:100%;
 	float:left;
 	height:auto;
 	background-color:#8E975B;
@@ -3363,7 +3363,7 @@ div.image-social-content center.friend {
 }
 
 #social-content-online {
-	background-color:#32578B;
+	background-color:#616161;
 	margin-bottom:5px;
 	margin-top:2px;
 	padding:1px;

+ 57 - 48
main/inc/lib/social.lib.php

@@ -188,8 +188,12 @@ class SocialManager extends UserManager {
 			$sql.=' AND relation_type='.$id_group;
 		}
 		if (isset($search_name) && is_string($search_name)===true) {
-			$sql.=' AND friend_user_id IN (SELECT user_id FROM '.$tbl_my_user.' WHERE '.(api_is_western_name_order() ? 'concat(firstName, lastName)' : 'concat(lastName, firstName)').' like concat("%","'.Database::escape_string($search_name).'","%"));';
+			$search_name = trim($search_name);
+			$search_name = str_replace(' ', '', $search_name);
+			//$sql.=' AND friend_user_id IN (SELECT user_id FROM '.$tbl_my_user.' WHERE '.(api_is_western_name_order() ? 'concat(firstName, lastName)' : 'concat(lastName, firstName)').' like concat("%","'.Database::escape_string($search_name).'","%"));';
+			$sql.=' AND friend_user_id IN (SELECT user_id FROM '.$tbl_my_user.' WHERE firstName LIKE "%'.Database::escape_string($search_name).'%" OR lastName LIKE "%'.Database::escape_string($search_name).'%"   OR    '.(api_is_western_name_order() ? 'concat(firstName, lastName)' : 'concat(lastName, firstName)').' like concat("%","'.Database::escape_string($search_name).'","%")    ) ';
 		}		
+		
 		$res=Database::query($sql,__FILE__,__LINE__);
 		while ($row=Database::fetch_array($res,'ASSOC')) {
 			if ($load_extra_info == true) {
@@ -649,10 +653,15 @@ class SocialManager extends UserManager {
 	 * @param bool show profile or not (show or hide the user image/information)
 	 * 
 	 */
-	public static function show_social_menu($show = '',$group_id = 0, $user_id = 0, $show_full_profile = false) {
+	public static function show_social_menu($show = '', $group_id = 0, $user_id = 0, $show_full_profile = false) {
+		
+		if (empty($user_id)) {
+			$user_id = api_get_user_id();
+		}
 		
 		$img_array = UserManager::get_user_picture_path_by_id($user_id,'web',true,true);
-		$big_image = UserManager::get_picture_user($user_id, $img_array['file'],'',USER_IMAGE_SIZE_BIG);
+		$big_image = UserManager::get_picture_user($user_id, $img_array['file'],'', USER_IMAGE_SIZE_BIG);
+		
 		$big_image = $big_image['file'].$big_image['dir'];
 		$show_groups = array('groups', 'group_messages', 'messages_list', 'group_add', 'mygroups', 'group_edit', 'member_list', 'invite_friends', 'waiting_list');
 		$show_messages = array('messages', 'messages_inbox', 'messages_outbox', 'messages_compose');
@@ -668,7 +677,25 @@ class SocialManager extends UserManager {
 		}
 		
 		echo '<div class="social-menu">';				
+	
+		//--- User image	        	
+		echo '<div class="social-content-image">';
+			echo '<div class="social-background-content" onmouseout="hide_icon_edit()" onmouseover="show_icon_edit()"><center>';
+						
+				if ($img_array['file'] != 'unknown.jpg') {
+	    	  		echo '<a class="thickbox" href="'.$big_image.'"><img src='.$img_array['dir'].$img_array['file'].' /> </a>';
+				} else {
+					echo '<img src='.$img_array['dir'].$img_array['file'].' width="110px" />';
+				}
+				if (api_get_user_id() == $user_id) {		
+					echo '<div id="edit_image" class="hidden_message" style="display:none"><a href="'.api_get_path(WEB_PATH).'main/auth/profile.php">'.get_lang('EditProfile').'</a></div>';
+				}
 				
+    	  	echo '</center></div>';
+	  	echo '</div>';
+	  	
+		
+		
 		if ($show != 'shared_profile') {
 			
 			echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';
@@ -687,24 +714,21 @@ class SocialManager extends UserManager {
 					echo '</ul></li>';					
 				}
 	        
-	        // why this link was hide?
-	        //if ($show == 'invitations') {
-	        	echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('mail.png',get_lang('Invitations'),array('hspace'=>'6')).'<span class="'.($show=='invitations'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Invitations').'</span></a></li>';	        	
-	        //}
-	                     
-	        echo	'<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6')).'<span class="'.($show=='shared_profile'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('ViewMySharedProfile').'</span></a></li>
-	        			<li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('members.gif',get_lang('Friends'),array('hspace'=>'6')).'<span class="'.($show=='friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Friends').'</span></a></li>
-	                    <li><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.gif',get_lang('Groups'),array('hspace'=>'6')).'<span class="'.($show=='groups'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Groups').'</span></a></li>';
+	        //Invitations
+	        echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('mail.png',get_lang('Invitations'),array('hspace'=>'6')).'<span class="'.($show=='invitations'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Invitations').'</span></a></li>';
+	        echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6')).'<span class="'.($show=='shared_profile'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('ViewMySharedProfile').'</span></a></li>
+	        	  <li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('members.gif',get_lang('Friends'),array('hspace'=>'6')).'<span class="'.($show=='friends'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Friends').'</span></a></li>
+	              <li><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.gif',get_lang('Groups'),array('hspace'=>'6')).'<span class="'.($show=='groups'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Groups').'</span></a></li>';
 	                    	        
 	        if (in_array($show,$show_groups)) {
 					echo '<li><ul>';
 						echo $create_group_item;
 						echo '<li class="social-menu-sub-level" style="background:none;padding:0px"><a href="'.api_get_path(WEB_PATH).'main/social/groups.php?view=mygroups">'.Display::return_icon('group.gif',get_lang('MyGroups'),array('hspace'=>'6')).'<span class="'.($show=='mygroups'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MyGroups').'</span></a></li>';												
 					echo '</ul></li>';
-				}                                        	
-	                     echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/search.php">'.Display::return_icon('search.gif',get_lang('Search'),array('hspace'=>'6')).'<span class="'.($show=='search'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Search').'</span></a></li>
-	                    </ul>
-	                </div>'; 	 
+			}                                        	
+	        echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/search.php">'.Display::return_icon('search.gif',get_lang('Search'),array('hspace'=>'6')).'<span class="'.($show=='search'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Search').'</span></a></li>
+	        	  </ul>
+				  </div>'; 	 
 	                     
 	        if (in_array($show, $show_groups) && !empty($group_id)) {
 	        	echo GroupPortalManager::show_group_column_information($group_id, api_get_user_id(), $show);
@@ -712,59 +736,44 @@ class SocialManager extends UserManager {
 		}
 
         if ($show == 'shared_profile') {
-        	       	        	                	
-        	//--- User image	        	
-			echo '<div class="social-content-image">';
-				echo '<div class="social-background-content" onmouseout="hide_icon_edit()" onmouseover="show_icon_edit()"><center>';			
-					if ($img_array['file'] != 'unknown.jpg') {
-		    	  		echo '<a class="thickbox" href="'.$big_image.'"><img src='.$img_array['dir'].$img_array['file'].' width="180px" /> </a>';
-					} else {
-						echo '<img src='.$img_array['dir'].$img_array['file'].' width="110px" />';
-					}
-					if (api_get_user_id() == $user_id) {		
-						echo '<div id="edit_image" class="hidden_message" style="display:none"><a href="'.api_get_path(WEB_PATH).'main/auth/profile.php">'.get_lang('EditProfile').'</a></div>';
-					}
-					
-	    	  	echo '</center></div>';
-    	  	echo '</div>';
-    	  	
-    	  	if ($user_id != intval(api_get_user_id())) {
-    			$user_info = api_get_user_info($user_id);        			
-    			echo '<div><center><strong>'.api_get_person_name($user_info['firstName'], $user_info['lastName']).'</strong></center></div><br />';        			
-			}    
-			
-    	  	
-    	  	if ($show_full_profile && $user_id == intval(api_get_user_id())) { 	  	   	  	        	
-	        	echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';        
+        	
+				echo '<div align="center" class="social-menu-title" ><span class="social-menu-text1">'.get_lang('Menu').'</span></div>';        
 	        	echo 	'<div>
-	                	<ul>
+	                	<ul>';
+	                					
+    	  	// My own profile
+    	  	if ($show_full_profile && $user_id == intval(api_get_user_id())) {  	        	
+	        	echo '
 	                     <li><a href="'.api_get_path(WEB_PATH).'main/social/home.php">'.Display::return_icon('home.gif',get_lang('Home'),array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('Home').'</span></a></li>
 	                     <li><a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'.Display::return_icon('inbox.png',get_lang('Messages'),array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('Messages').'</span></a></li>';
 	        	echo '   <li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.Display::return_icon('mail.png',get_lang('Invitations'),array('hspace'=>'6')).'<span class="'.($show=='invitations'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('Invitations').'</span></a></li>';	                     
 	        	echo	'<li><a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.Display::return_icon('shared_profile.png',get_lang('ViewMySharedProfile'),array('hspace'=>'6','style'=>'float:left')).'<span class="social-menu-text-active" >'.get_lang('ViewMySharedProfile').'</span></a></li>
 	        			 <li><a href="'.api_get_path(WEB_PATH).'main/social/friends.php">'.Display::return_icon('members.gif',get_lang('Friends'),array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('Friends').'</span></a></li>
 	                     <li><a href="'.api_get_path(WEB_PATH).'main/social/groups.php">'.Display::return_icon('group.gif',get_lang('Groups'),array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('Groups').'</span></a></li>';
-	            echo   '</ul></div>';
+	      
     	  	}
     	  	
     	   
-    	  	
+    	  	// My friend profile
     	  	$html_actions = '';
-	  		if ($user_id != api_get_user_id()) {
-	  			$html_actions =  '&nbsp;<a href="'.api_get_path(WEB_PATH).'main/messages/send_message_to_userfriend.inc.php?height=300&width=610&user_friend='.$user_id.'&view=profile&view_panel=1" class="thickbox" title="'.get_lang('SendMessage').'">';
-	  			$html_actions .= Display::return_icon('message_new.png').'&nbsp;&nbsp;'.get_lang('SendMessage').'</a><br />';	  		
+    	  		        	  	
+	  		if ($user_id != api_get_user_id()) {		
+	  			echo  '<li><a href="'.api_get_path(WEB_PATH).'main/messages/send_message_to_userfriend.inc.php?height=300&width=610&user_friend='.$user_id.'&view=profile&view_panel=1" class="thickbox" title="'.get_lang('SendMessage').'">';
+	  			echo  Display::return_icon('message_new.png').'&nbsp;&nbsp;'.get_lang('SendMessage').'</a></li>';	  		
 	  		}	  		
+	  		
 	  		//check if I already sent an invitation message
 	  		$invitation_sent_list = SocialManager::get_list_invitation_sent_by_user_id(api_get_user_id());
 	  			  		
 	  		if (is_array($invitation_sent_list) && is_array($invitation_sent_list[$user_id]) && count($invitation_sent_list[$user_id]) >0 ) {  	  		
-	  			$html_actions .= '<a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.get_lang('YouAlreadySentAnInvitation').'</a>';
+	  			echo '<li><a href="'.api_get_path(WEB_PATH).'main/social/invitations.php">'.get_lang('YouAlreadySentAnInvitation').'</a></li>';
 	  		} else {
 	  			if (!$show_full_profile) {
-	  				$html_actions .=  '&nbsp;<a href="'.api_get_path(WEB_PATH).'main/messages/send_message_to_userfriend.inc.php?view_panel=2&height=260&width=610&user_friend='.$user_id.'" class="thickbox" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('add_multiple_users.gif', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a>';
+	  				echo  '<li><a href="'.api_get_path(WEB_PATH).'main/messages/send_message_to_userfriend.inc.php?view_panel=2&height=260&width=610&user_friend='.$user_id.'" class="thickbox" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('add_multiple_users.gif', get_lang('SocialInvitationToFriends')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
 	  			}
 	  		}
-	  		echo $html_actions;
+	  		echo '</ul></div>';
+	  
 
         	/*
         	// ---- My Agenda Items

+ 10 - 0
main/messages/inbox.php

@@ -46,6 +46,16 @@ function deselect_all(formita)
 				formita.elements[i].checked=0
 	}
 }
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
 //-->
 </script>';
 

+ 12 - 0
main/social/friends.php

@@ -79,6 +79,18 @@ function clear_form () {
 	$("div#div_qualify_image").html("");
 	$("div#div_info_user").html("");
 }
+	
+		
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
 </script>';
 
 $interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));

+ 10 - 1
main/social/group_add.php

@@ -31,7 +31,16 @@ function text_longitud(){
    }else{
       textarea = document.forms[0].description.value;
    } 
-} 
+}
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}	
 </script>';
 					
 $table_message = Database::get_main_table(TABLE_MESSAGE);

+ 10 - 1
main/social/group_edit.php

@@ -31,7 +31,16 @@ function textarea_maxlength(){
    }else{
       textarea = document.forms[0].description.value;
    } 
-} 
+}
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
 </script>';
 
 $group_id = isset($_GET['id']) ? intval($_GET['id']) : intval($_POST['id']);

+ 13 - 1
main/social/group_invitation.php

@@ -20,7 +20,19 @@ api_block_anonymous_users();
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>'; 
 $htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
-
+$htmlHeadXtra[] = '<script type="text/javascript">
+		
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
+</script>';
 $xajax = new xajax();
 //$xajax->debugOn();
 $xajax -> registerFunction ('search_users');

+ 13 - 1
main/social/group_members.php

@@ -15,7 +15,19 @@ require_once api_get_path(LIBRARY_PATH).'social.lib.php';
 $htmlHeadXtra[] = '<script type="text/javascript" src="/main/inc/lib/javascript/jquery.js"></script>';
 $htmlHeadXtra[] = '<script type="text/javascript" src="/main/inc/lib/javascript/thickbox.js"></script>';
 $htmlHeadXtra[] = '<link rel="stylesheet" href="/main/inc/lib/javascript/thickbox.css" type="text/css" media="projection, screen">';
-
+$htmlHeadXtra[] = '<script type="text/javascript">
+		
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
+</script>';
 
 $this_section = SECTION_SOCIAL;
 $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));

+ 12 - 0
main/social/group_waiting_list.php

@@ -14,7 +14,19 @@ require_once api_get_path(LIBRARY_PATH).'social.lib.php';
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>'; 
 $htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
+$htmlHeadXtra[] = '<script type="text/javascript">
+		
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
 
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
+</script>';
 $this_section = SECTION_SOCIAL;
 $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));
 $interbreadcrumb[]= array ('url' =>'groups.php','name' => get_lang('Groups'));

+ 13 - 1
main/social/groups.php

@@ -112,7 +112,19 @@ jQuery(document).ready(function() {
    } 
    	
 });
-	</script>';
+	
+
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
+</script>';
 
 $allowed_views = array('mygroups','newest','pop');		   	
 $interbreadcrumb[]= array ('url' =>'home.php','name' => get_lang('Social'));

+ 13 - 43
main/social/home.php

@@ -25,7 +25,19 @@ api_block_anonymous_users();
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery.js" type="text/javascript" language="javascript"></script>'; //jQuery
 $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.js" type="text/javascript" language="javascript"></script>';
 $htmlHeadXtra[] = '<link rel="stylesheet" href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/thickbox.css" type="text/css" media="projection, screen">';
+$htmlHeadXtra[] = '<script type="text/javascript">
+		
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
 
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
+</script>';
 //fast upload image
 if (api_get_setting('profile', 'picture') == 'true') {
 	require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
@@ -68,55 +80,13 @@ echo '<div id="social-content">';
 	echo '<div id="social-content-right">';
 		echo '<div class="social-box-main1">';
 			echo '<div class="social-box-left">';
-						
-				$user_image_array = UserManager::get_picture_user(api_get_user_id(), $user_info['picture_uri'], 400, USER_IMAGE_SIZE_ORIGINAL);
-
-				//@todo fix this aswell as in main/auth/profile.php
-				//User picture size is calculated from SYSTEM path
-				$image_syspath = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'system', false, true);
-				$image_syspath['dir'].$image_syspath['file'];
-				
-				$image_size = @getimagesize($image_syspath['dir'].$image_syspath['file']);
-				
-				//Web path
-				$image_path = UserManager::get_user_picture_path_by_id(api_get_user_id(), 'web', false, true);
-				$image_dir = $image_path['dir'];
-				$image = $image_path['file'];
-				$image_file = $image_dir.$image;
-				$img_attributes = ' hspace="6" height="90" align="left" width="80" src="'.$image_file.'?rand='.time().'" '
-					.'alt="'.api_get_person_name($user_data['firstname'], $user_data['lastname']).'" ';
-					
-				if ($image_size[0] > 80) {
-					//limit display width to 80px
-					$img_attributes .= 'width="80" ';
-				}
-				
-				// get the path,width and height from original picture
-				$big_image = $image_dir.'big_'.$image;
-				
-				$big_image_size = api_getimagesize($big_image);
-				$big_image_width = $big_image_size[0];
-				$big_image_height = $big_image_size[1];
-				$url_big_image = $big_image.'?rnd='.time();
-								
-				if ($image == 'unknown.jpg') {
-					$image =  '<a href="'.api_get_path(WEB_CODE_PATH).'auth/profile.php"><img '.$img_attributes.' /></a>';
-					/*if (api_get_setting('profile', 'picture') == 'true') {				
-						$form->display();
-					}*/					
-				} else {
-					$big_image = UserManager::get_picture_user(api_get_user_id(), $user_info['picture_uri'],'',USER_IMAGE_SIZE_BIG);
-					$big_image = $big_image['file'].$big_image['dir'];					
-					$image = '<a class="thickbox" href="'.$big_image.'"><img '.$img_attributes.' /> </a>';					 
-					//$image = '<input type="image" '.$img_attributes.' onclick="javascript: return show_image(\''.$url_big_image.'\',\''.$big_image_width.'\',\''.$big_image_height.'\');"/>';
-				}
+			
 									
 			// information current user			
 			echo	'<div class="social-box-container1">
                     	<div>'.Display::return_icon('boxmygroups.jpg').'</div>
                         <div class="social-box-content1">';
                    
-                   //echo	'<div><img hspace="6" height="90" align="left" width="80" src="'.$user_image_array['dir'].$user_image_array['file'].'"/></div>';
                    echo	'<div>'.$image.'</div>';                        	
                             
                        echo '<div><p><strong>'.get_lang('Name').'</strong><br /><span class="social-groups-text4">'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'</span></p></div>

+ 12 - 0
main/social/invitations.php

@@ -61,6 +61,18 @@ function register_friend(element_input) {
 		});
  }
 }
+	
+
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
 
 </script>';
 api_block_anonymous_users();

+ 35 - 27
main/social/profile.php

@@ -177,6 +177,7 @@ function register_friend(element_input) {
 		});
  }
 }
+	
 
 function show_icon_edit(element_html) {	
 	ident="#edit_image";
@@ -268,35 +269,42 @@ echo '<div id="social-content-right">';
 		echo '<div class="social-box-left">';		
 			echo '<div>'.Display::return_icon('boxmygroups.jpg').'</div>';
 			echo '<div class="social-box-content1">';
+			
+			if (!empty($user_info['firstname']) || !empty($user_info['lastname'])) {
+    			echo '<div><h3>'.api_get_person_name($user_info['firstname'], $user_info['lastname']).'</h3></div>';
+			} else {
 				//--- Basic Information
-				echo '<div><h3>'.get_lang('Information').'</h3></div>';						
-				if ($show_full_profile) {
-					echo '<div class="social-profile-info" >';
-						echo '<dt>'.get_lang('UserName').'</dt>
-							  <dd>'. $user_info['username'].'	</dd>';
-						if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
-							echo '<dt>'.get_lang('Name').'</dt>
-							  	  <dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
-						if (!empty($user_info['official_code']))
-							echo '<dt>'.get_lang('OfficialCode').'</dt>
-							  <dd>'.$user_info['official_code'].'</dd>';
-						if (!empty($user_info['email']))
-							if (api_get_setting('show_email_addresses')=='true')
-								echo '<dt>'.get_lang('Email').'</dt>
-							  <dd>'.$user_info['email'].'</dd>';
-						if (!empty($user_info['phone']))
-							echo '<dt>'.get_lang('Phone').'</dt>
-							  <dd>'. $user_info['phone'].'</dd>';
-						echo '</dl>';
-					echo '</div>';
-				} else {
-					echo '<div class="social-profile-info" >';
-						echo '<dl>';
-						if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
+				echo '<div><h3>'.get_lang('Information').'</h3></div>';				
+			}        			
+			 
+								
+			if ($show_full_profile) {
+				echo '<div class="social-profile-info" >';
+					echo '<dt>'.get_lang('UserName').'</dt>
+						  <dd>'. $user_info['username'].'	</dd>';
+/*						if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
 							echo '<dt>'.get_lang('Name').'</dt>
-							  <dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
-					echo '</div>';
-				}
+							  	  <dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';*/
+					if (!empty($user_info['official_code']))
+						echo '<dt>'.get_lang('OfficialCode').'</dt>
+						  <dd>'.$user_info['official_code'].'</dd>';
+					if (!empty($user_info['email']))
+						if (api_get_setting('show_email_addresses')=='true')
+							echo '<dt>'.get_lang('Email').'</dt>
+						  <dd>'.$user_info['email'].'</dd>';
+					if (!empty($user_info['phone']))
+						echo '<dt>'.get_lang('Phone').'</dt>
+						  <dd>'. $user_info['phone'].'</dd>';
+					echo '</dl>';
+				echo '</div>';
+			} else {
+				echo '<div class="social-profile-info" >';
+					echo '<dl>';
+					if (!empty($user_info['firstname']) || !empty($user_info['lastname']))
+						echo '<dt>'.get_lang('Name').'</dt>
+						  <dd>'. api_get_person_name($user_info['firstname'], $user_info['lastname']).'</dd>';
+				echo '</div>';
+			}
 			
 				echo '<div class="clear"></div>';
 			

+ 13 - 0
main/social/search.php

@@ -18,6 +18,19 @@ api_block_anonymous_users();
 $this_section = SECTION_SOCIAL;
 $tool_name = get_lang('Search');
 $interbreadcrumb[]= array ('url' =>'profile.php','name' => get_lang('Social'));
+$htmlHeadXtra[] = '<script type="text/javascript">
+		
+function show_icon_edit(element_html) {	
+	ident="#edit_image";
+	$(ident).show();
+}		
+
+function hide_icon_edit(element_html)  {
+	ident="#edit_image";
+	$(ident).hide();
+}		
+		
+</script>';
 
 Display :: display_header($tool_name);
 

+ 1 - 1
user_portal.php

@@ -1228,7 +1228,7 @@ if ($show_menu) {
 		
 			echo '<div id="social_widget_image">';
 				if ($no_image == false)
-					echo '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php"><img src="'.$img_array['file'].'"  '.$img_array['style'].' border="1"></a>';
+					echo '<a href="'.api_get_path(WEB_PATH).'main/social/home.php"><img src="'.$img_array['file'].'"  '.$img_array['style'].' border="1"></a>';
 				else 
 					echo '<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>';
 			echo '</div>';