diff --git a/main/inc/ajax/social.ajax.php b/main/inc/ajax/social.ajax.php index b2ce8ab4fa..7e88996470 100755 --- a/main/inc/ajax/social.ajax.php +++ b/main/inc/ajax/social.ajax.php @@ -3,18 +3,18 @@ /** * Responses to AJAX calls */ +$language_file = array('messages','userInfo'); require_once '../global.inc.php'; $action = $_GET['a']; $current_user_id = api_get_user_id(); switch ($action) { - case 'add_friend': - - if (api_is_anonymous()){ + case 'add_friend': + if (api_is_anonymous()) { echo ''; break; - } + } $my_current_friend = Security::remove_XSS($_POST['friend_id']); $my_denied_current_friend= Security::remove_XSS($_POST['denied_friend_id']); @@ -32,8 +32,7 @@ switch ($action) { if (isset($_POST['friend_id'])) { UserManager::relate_users($current_user_id,$my_current_friend,$relation_type); - UserManager::relate_users($my_current_friend,$current_user_id,$relation_type); - + UserManager::relate_users($my_current_friend,$current_user_id,$relation_type); SocialManager::invitation_accepted($my_current_friend,$current_user_id); if (isset($_POST['is_my_friend'])) { @@ -42,14 +41,12 @@ switch ($action) { Display::display_normal_message(api_xml_http_response_encode(get_lang('AddedContactToList'))); } } - - case 'deny_friend': - + break; + case 'deny_friend': if (api_is_anonymous()){ echo ''; break; } - $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']); @@ -66,9 +63,8 @@ switch ($action) { Display::display_confirmation_message(api_xml_http_response_encode(get_lang('InvitationDenied'))); } break; - case 'delete_friend': - - if (api_is_anonymous()){ + case 'delete_friend': + if (api_is_anonymous()) { echo ''; break; } @@ -90,8 +86,7 @@ switch ($action) { echo api_xml_http_response_encode(get_lang('AttachContactsToGroupSuccesfuly')); }*/ break; - case 'show_my_friends': - + case 'show_my_friends': if (api_is_anonymous()) { echo ''; break; @@ -150,10 +145,9 @@ switch ($action) { if ($_POST['action']) {$action = $_POST['action'];} - switch ($action) { + switch ($action) { case 'load_course' : - $course_db = $_POST['course_code']; - + $course_db = $_POST['course_code']; $course_id = CourseManager::get_course_id_by_database_name($course_db); if (api_is_user_of_course($course_id, api_get_user_id())) { diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index c64eac6eb0..a681f4f400 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -1253,13 +1253,15 @@ function inbox_display() { //$table->set_header(2,$title,true); $table->set_header(2,api_xml_http_response_encode(get_lang('Date')),true, array('style' => 'width:160px;')); $table->set_header(3,$action,false,array ('style' => 'width:70px;')); - + if ($_REQUEST['f']=='social') { $parameters['f'] = 'social'; $table->set_additional_parameters($parameters); } $table->set_form_actions(array ('delete' => get_lang('DeleteSelectedMessages'))); - $table->display(); + + $table->display(); + } function get_number_of_messages_mask() { diff --git a/main/social/profile.php b/main/social/profile.php index e5bd7b63b0..e6756e172d 100755 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -161,23 +161,24 @@ function hide_display_message () { } } function register_friend(element_input) { - if(confirm("'.get_lang('AddToFriends').'")) { + if(confirm("'.get_lang('AddToFriends').'")) { name_button=$(element_input).attr("id"); name_div_id="id_"+name_button.substring(13); user_id=name_div_id.split("_"); - user_friend_id=user_id[1]; - $.ajax({ + user_friend_id=user_id[1]; + $.ajax({ contentType: "application/x-www-form-urlencoded", beforeSend: function(objeto) { - $("div#dpending_"+user_friend_id).html(""); }, + $("div#dpending_"+user_friend_id).html(""); + }, type: "POST", url: "'.api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=add_friend", data: "friend_id="+user_friend_id+"&is_my_friend="+"friend", success: function(datos) { - $("form").submit() + $("#dpending_" + user_friend_id).html(datos); } }); - } + } } '; @@ -583,23 +584,28 @@ if ($show_full_profile) { } } - echo '
'; + //--Productions $production_list = UserManager::build_production_list($user_id); - if (!empty($production_list )) { - echo '

'.get_lang('MyProductions').'

'; - echo '
'; - echo $production_list; - echo '
'; + $product_content = ''; + if (!empty($production_list)) { + $product_content .= '

'.get_lang('MyProductions').'

'; + $product_content .= '
'; + $product_content .= $production_list; + $product_content .= '
'; } // Images uploaded by course if (!empty($file_list)) { - echo '

'.get_lang('ImagesUploaded').'

'; - echo '
'; - echo $file_list; - echo '
'; + $product_content .= '

'.get_lang('ImagesUploaded').'

'; + $product_content .= '
'; + $product_content .= $file_list; + $product_content .= '
'; } - echo '
'; // close rounded + if (!empty($product_content)) { + echo '
'; + echo $product_content; + echo '
'; // close rounded + } }