diff --git a/main/auth/profile.php b/main/auth/profile.php index f329ce23d8..815be106f1 100644 --- a/main/auth/profile.php +++ b/main/auth/profile.php @@ -249,14 +249,15 @@ if (api_get_setting('profile', 'language') !== 'true') { // EXTENDED PROFILE this make the page very slow! if (api_get_setting('extended_profile') == 'true') { if (!isset($_GET['type']) || (isset($_GET['type']) && $_GET['type'] == 'extended')) { + $width_extended_profile = 500; //$form->addElement('html', ' show_extend_profile'); $form->addElement('static', null, ''.get_lang('OptionalTextFields').''); // MY COMPETENCES - $form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '580', 'Height' => '130')); + $form->add_html_editor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130')); // MY DIPLOMAS - $form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '580', 'Height' => '130')); + $form->add_html_editor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130')); // WHAT I AM ABLE TO TEACH - $form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '580', 'Height' => '130')); + $form->add_html_editor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '130')); // MY PRODUCTIONS $form->addElement('file', 'production', get_lang('MyProductions')); @@ -264,7 +265,7 @@ if (api_get_setting('extended_profile') == 'true') { $form->addElement('static', 'productions_list', null, $production_list); } // MY PERSONAL OPEN AREA - $form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '580', 'Height' => '350')); + $form->add_html_editor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => $width_extended_profile, 'Height' => '350')); $form->applyFilter(array('competences', 'diplomas', 'teach', 'openarea'), 'stripslashes'); $form->applyFilter(array('competences', 'diplomas', 'teach'), 'trim'); // openarea is untrimmed for maximum openness } @@ -828,21 +829,7 @@ if (api_get_setting('allow_social_tool') == 'true') { echo ''; echo '
'; - echo '
'; - //Useless link - /* - echo '
'; - if (api_get_setting('extended_profile') == 'true') { - $show = isset($_GET['show']) ? '&show='.Security::remove_XSS($_GET['show']) : ''; - if (isset($_GET['type']) && $_GET['type'] == 'reduced') { - echo ''; - } else { - echo ''; - } - } - echo '
';*/ - $form->display(); - echo '
'; + $form->display(); echo '
'; } else { // Style position:absolute has been removed for Opera-compatibility. diff --git a/main/inc/ajax/social.ajax.php b/main/inc/ajax/social.ajax.php index 7e88996470..adb50dcf09 100755 --- a/main/inc/ajax/social.ajax.php +++ b/main/inc/ajax/social.ajax.php @@ -68,23 +68,10 @@ switch ($action) { echo ''; break; } - - //deprecated variables? - //$my_current_friend = Security::remove_XSS($_POST['friend_id']); - //$my_denied_current_friend= Security::remove_XSS($_POST['denied_friend_id']); - $my_delete_friend = Security::remove_XSS($_POST['delete_friend_id']); - //$friend_id_qualify = Security::remove_XSS($_POST['user_id_friend_q']); - //$type_friend_qualify = Security::remove_XSS($_POST['type_friend_q']); //filtered? - //$is_my_friend = Security::remove_XSS($_POST['is_my_friend']); //filtered? - + $my_delete_friend = intval($_POST['delete_friend_id']); if (isset($_POST['delete_friend_id'])) { SocialManager::remove_user_rel_user($my_delete_friend); - } - /* - if(isset($_POST['user_id_friend_q']) && isset($_POST['type_friend_q'])) { - SocialManager::qualify_friend($friend_id_qualify,$type_friend_qualify); - echo api_xml_http_response_encode(get_lang('AttachContactsToGroupSuccesfuly')); - }*/ + } break; case 'show_my_friends': if (api_is_anonymous()) { @@ -93,11 +80,11 @@ switch ($action) { } $list_path_friends = array(); $user_id = api_get_user_id(); - $name_search= Security::remove_XSS($_POST['search_name_q']); + $name_search= Security::remove_XSS($_POST['search_name_q']); $number_friends = 0; - if (isset($name_search) && $name_search!='undefined') { - $friends = SocialManager::get_friends($user_id,null,$name_search); + if (isset($name_search) && $name_search != 'undefined') { + $friends = SocialManager::get_friends($user_id, null, $name_search); } else { $friends = SocialManager::get_friends($user_id); } @@ -123,7 +110,7 @@ switch ($action) { $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92); $friend_html.='
'; $friend_html.='
'; - $friend_html.='
'.$user_name.'
'; + $friend_html.='
'.$user_name.'
'; } $j++; } diff --git a/main/social/friends.php b/main/social/friends.php index dd790ccf04..70cc33b2e8 100755 --- a/main/social/friends.php +++ b/main/social/friends.php @@ -42,15 +42,15 @@ function delete_friend (element_div) { } -function search_image_social(element_html) { - name_search=$(element_html).attr("value"); +function search_image_social() { + var name_search = $("#id_search_image").attr("value"); $.ajax({ contentType: "application/x-www-form-urlencoded", type: "POST", url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=show_my_friends", data: "search_name_q="+name_search, success: function(datos) { - $("div#div_content_table").html(datos); + $("#friend_table").html(datos); } }); } @@ -114,64 +114,35 @@ if (count($friends) == 0 ) { echo get_lang('NoFriendsInYourContactList').'

'; echo ''.get_lang('TryAndFindSomeFriends').''; } else { - - ?> -
- - - - - - - -
- - - - -
- - - - -
- + + '; - //echo '
'; - - $friend_html.= ''; - for ($k=0;$k<$number_friends;$k++) { - $friend_html.=''; - } - $friend_html.='
'; - - while ($j<$number_friends) { - if (isset($friends[$j])) { - $friend = $friends[$j]; - $user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']); - $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92); - $friend_html.='
'; - $friend_html.='
'; - $friend_html.='
'.$user_name.'
'; - } - $j++; - } - $friend_html.='
'; - echo $friend_html; - echo '
'; - ?> -
-
- '; + for ($k=0;$k<$number_friends;$k++) { + $friend_html.=''; + + while ($j<$number_friends) { + if (isset($friends[$j])) { + $friend = $friends[$j]; + $user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']); + $friends_profile = SocialManager::get_picture_user($friend['friend_user_id'], $friend['image'], 92); + $friend_html.='
'; + $friend_html.='
'; + $friend_html.='
'.$user_name.'
'; + } + $j++; + } + $friend_html.=''; + } + $friend_html.='
'; + echo $friend_html; + } echo ''; echo ''; -Display :: display_footer(); +Display :: display_footer(); \ No newline at end of file