|
|
|
@ -1,11 +1,14 @@ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* This is the profile social main page |
|
|
|
|
* @author Julio Montoya <gugli100@gmail.com> |
|
|
|
|
* @author Isaac Flores Paz <florespaz_isaac@hotmail.com> |
|
|
|
|
* @package chamilo.social |
|
|
|
|
*/ |
|
|
|
|
* This is the profile social main page |
|
|
|
|
* @author Julio Montoya <gugli100@gmail.com> |
|
|
|
|
* @author Isaac Flores Paz <florespaz_isaac@hotmail.com> |
|
|
|
|
* @todo use Display::panel() |
|
|
|
|
* @package chamilo.social |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
$cidReset = true; |
|
|
|
|
require_once '../inc/global.inc.php'; |
|
|
|
|
// Include OpenGraph NOT AVAILABLE |
|
|
|
@ -37,9 +40,20 @@ $social_session_block = null; |
|
|
|
|
|
|
|
|
|
if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp_name'])) { |
|
|
|
|
$messageId = 0; |
|
|
|
|
$idMessage = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $_POST['social_wall_new_msg_main'], $messageId, MESSAGE_STATUS_WALL_POST); |
|
|
|
|
$idMessage = SocialManager::sendWallMessage( |
|
|
|
|
api_get_user_id(), |
|
|
|
|
$friendId, |
|
|
|
|
$_POST['social_wall_new_msg_main'], |
|
|
|
|
$messageId, |
|
|
|
|
MESSAGE_STATUS_WALL_POST |
|
|
|
|
); |
|
|
|
|
if (!empty($_FILES['picture']['tmp_name']) && $idMessage > 0) { |
|
|
|
|
$error = SocialManager::sendWallMessageAttachmentFile(api_get_user_id(), $_FILES['picture'], $idMessage, $fileComment = ''); |
|
|
|
|
$error = SocialManager::sendWallMessageAttachmentFile( |
|
|
|
|
api_get_user_id(), |
|
|
|
|
$_FILES['picture'], |
|
|
|
|
$idMessage, |
|
|
|
|
$fileComment = '' |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; |
|
|
|
@ -49,7 +63,13 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp |
|
|
|
|
|
|
|
|
|
} else if (!empty($_POST['social_wall_new_msg']) && !empty($_POST['messageId'])) { |
|
|
|
|
$messageId = intval($_POST['messageId']); |
|
|
|
|
$res = SocialManager::sendWallMessage(api_get_user_id(), $friendId, $_POST['social_wall_new_msg'], $messageId , MESSAGE_STATUS_WALL); |
|
|
|
|
$res = SocialManager::sendWallMessage( |
|
|
|
|
api_get_user_id(), |
|
|
|
|
$friendId, |
|
|
|
|
$_POST['social_wall_new_msg'], |
|
|
|
|
$messageId, |
|
|
|
|
MESSAGE_STATUS_WALL |
|
|
|
|
); |
|
|
|
|
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php'; |
|
|
|
|
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']); |
|
|
|
|
header('Location: ' . $url); |
|
|
|
@ -97,10 +117,10 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$user_info = UserManager::get_user_info_by_id($user_id); |
|
|
|
|
$user_info = UserManager::get_user_info_by_id($user_id); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
$user_info = UserManager::get_user_info_by_id($user_id); |
|
|
|
|
$user_info = UserManager::get_user_info_by_id($user_id); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -283,8 +303,9 @@ if ($show_full_profile) { |
|
|
|
|
$wallSocialAddPost = SocialManager::getWallForm(); |
|
|
|
|
$social_wall_block = $wallSocialAddPost; |
|
|
|
|
|
|
|
|
|
//Social Post Wall |
|
|
|
|
// Social Post Wall |
|
|
|
|
$post_wall = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ; |
|
|
|
|
|
|
|
|
|
$social_post_wall_block = '<div class="panel panel-default social-post">'; |
|
|
|
|
$social_post_wall_block .= '<div class="panel-heading">Mis publicaciones</div>'; |
|
|
|
|
$social_post_wall_block .='<div class="panel-body">'; |
|
|
|
@ -486,17 +507,14 @@ if ($show_full_profile) { |
|
|
|
|
|
|
|
|
|
$total = count($grid_my_groups); |
|
|
|
|
$i = 1; |
|
|
|
|
foreach($grid_my_groups as $group) { |
|
|
|
|
foreach ($grid_my_groups as $group) { |
|
|
|
|
$my_groups .= '<div class="panel-body">'; |
|
|
|
|
$my_groups .= $group[0]; |
|
|
|
|
$my_groups .= '</div>'; |
|
|
|
|
if ($i < $total) { |
|
|
|
|
$my_groups .= ', '; |
|
|
|
|
} |
|
|
|
|
$i++; |
|
|
|
|
} |
|
|
|
|
$my_groups .= '</div>'; |
|
|
|
|
$social_group_info_block = $my_groups; |
|
|
|
|
$social_group_info_block = $my_groups; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Block Social Course |
|
|
|
|