@ -58,9 +58,9 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
Display::addFlash(Display::return_message(get_lang('MessageSent')));
Display::addFlash(Display::return_message(get_lang('MessageSent')));
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
$url = api_get_path(WEB_CODE_PATH).'social/profile.php';
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
header('Location: ' . $url);
header('Location: '.$url);
exit;
exit;
} else if (!empty($_POST['social_wall_new_msg']) & & !empty($_POST['messageId'])) {
} else if (!empty($_POST['social_wall_new_msg']) & & !empty($_POST['messageId'])) {
@ -75,9 +75,9 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
MESSAGE_STATUS_WALL
MESSAGE_STATUS_WALL
);
);
Display::addFlash(Display::return_message(get_lang('MessageSent')));
Display::addFlash(Display::return_message(get_lang('MessageSent')));
$url = api_get_path(WEB_CODE_PATH) . 'social/profile.php';
$url = api_get_path(WEB_CODE_PATH).'social/profile.php';
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
$url .= empty($_SERVER['QUERY_STRING']) ? '' : '?'.Security::remove_XSS($_SERVER['QUERY_STRING']);
header('Location: ' . $url);
header('Location: '.$url);
exit;
exit;
} else if (isset($_GET['messageId'])) {
} else if (isset($_GET['messageId'])) {
@ -89,7 +89,7 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
$status = SocialManager::deleteMessage($messageId);
$status = SocialManager::deleteMessage($messageId);
Display::addFlash(Display::return_message(get_lang('MessageDeleted')));
Display::addFlash(Display::return_message(get_lang('MessageDeleted')));
header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/profile.php');
header('Location: '.api_get_path(WEB_CODE_PATH).'social/profile.php');
exit;
exit;
}
}
}
}
@ -153,16 +153,16 @@ $libpath = api_get_path(LIBRARY_PATH);
$ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php';
$ajax_url = api_get_path(WEB_AJAX_PATH).'message.ajax.php';
$socialAjaxUrl = api_get_path(WEB_AJAX_PATH).'social.ajax.php';
$socialAjaxUrl = api_get_path(WEB_AJAX_PATH).'social.ajax.php';
$javascriptDir = api_get_path(LIBRARY_PATH) . 'javascript/';
$javascriptDir = api_get_path(LIBRARY_PATH).'javascript/';
api_block_anonymous_users();
api_block_anonymous_users();
$locale = api_get_language_isocode();
$locale = api_get_language_isocode();
// Add Jquery scroll pagination plugin
// Add Jquery scroll pagination plugin
$htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js');
$htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js');
// Add Jquery Time ago plugin
// Add Jquery Time ago plugin
$htmlHeadXtra[] = api_get_asset('jquery-timeago/jquery.timeago.js');
$htmlHeadXtra[] = api_get_asset('jquery-timeago/jquery.timeago.js');
$timeAgoLocaleDir = $javascriptDir . 'jquery-timeago/locales/jquery.timeago.' . $locale . '.js';
$timeAgoLocaleDir = $javascriptDir.'jquery-timeago/locales/jquery.timeago.'.$locale.'.js';
if (file_exists($timeAgoLocaleDir)) {
if (file_exists($timeAgoLocaleDir)) {
$htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.' . $locale . '.js');
$htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.'.$locale.'.js');
}
}
$htmlHeadXtra[] = '< script >
$htmlHeadXtra[] = '< script >
@ -170,7 +170,7 @@ $htmlHeadXtra[] = '<script>
$(document).ready(function (){
$(document).ready(function (){
var container = $("#wallMessages");
var container = $("#wallMessages");
container.jscroll({
container.jscroll({
loadingHtml: "< div class = \"well_border\" > ' . get_lang('Loading') . ' < / div > ",
loadingHtml: "< div class = \"well_border\" > ' . get_lang('Loading').' < / div > ",
nextSelector: "a.nextPage:last",
nextSelector: "a.nextPage:last",
contentSelector: "",
contentSelector: "",
callback: timeAgo
callback: timeAgo
@ -201,7 +201,7 @@ $interbreadcrumb[] = array(
if (isset($_GET['u']) & & is_numeric($_GET['u']) & & $_GET['u'] != api_get_user_id()) {
if (isset($_GET['u']) & & is_numeric($_GET['u']) & & $_GET['u'] != api_get_user_id()) {
$info_user = api_get_user_info($_GET['u']);
$info_user = api_get_user_info($_GET['u']);
$interbreadcrumb[]= array(
$interbreadcrumb[] = array(
'url' => '#',
'url' => '#',
'name' => $info_user['complete_name']
'name' => $info_user['complete_name']
);
);
@ -224,7 +224,7 @@ $i = 1;
$list = [];
$list = [];
if (is_array($personal_course_list)) {
if (is_array($personal_course_list)) {
foreach ($personal_course_list as $my_course) {
foreach ($personal_course_list as $my_course) {
if ($i< =10) {
if ($i < = 10) {
$list[] = SocialManager::get_logged_user_course_html($my_course, $i);
$list[] = SocialManager::get_logged_user_course_html($my_course, $i);
$course_list_code[] = array('code' => $my_course['code']);
$course_list_code[] = array('code' => $my_course['code']);
} else {
} else {
@ -262,13 +262,13 @@ $wallSocialAddPost = SocialManager::getWallForm($show_full_profile);
$social_wall_block = $wallSocialAddPost;
$social_wall_block = $wallSocialAddPost;
// Social Post Wall
// Social Post Wall
$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId) ;
$posts = SocialManager::getWallMessagesByUser($my_user_id, $friendId);
$social_post_wall_block = empty($posts) ? '< p > '.get_lang("NoPosts").'< / p > ' : $posts;
$social_post_wall_block = empty($posts) ? '< p > '.get_lang("NoPosts").'< / p > ' : $posts;
$socialAutoExtendLink = Display::url(
$socialAutoExtendLink = Display::url(
get_lang('SeeMore'),
get_lang('SeeMore'),
$socialAjaxUrl . '?u='. $my_user_id . '& a=list_wall_message& start=10& length=5',
$socialAjaxUrl.'?u='.$my_user_id.'& a=list_wall_message& start=10& length=5',
array(
array(
'class' => 'nextPage next',
'class' => 'nextPage next',
)
)
@ -290,12 +290,12 @@ $(document).ready(function() {
$(".spinner").html("'.
$(".spinner").html("'.
'< div class = \'text-center\' > '.
'< div class = \'text-center\' > '.
'< em class = \'fa fa-spinner fa-pulse fa-1x \ ' > < / em > '.
'< em class = \'fa fa-spinner fa-pulse fa-1x \ ' > < / em > '.
'< p > '. get_lang('Loading') . ' ' . get_lang('Preview') .'< / p > '.
'< p > '.get_lang('Loading').' '.get_lang('Preview').'< / p > '.
'< / div > '.
'< / div > '.
'");
'");
},
},
type: "POST",
type: "POST",
url: "'. api_get_path(WEB_AJAX_PATH) .'social.ajax.php?a=read_url_with_open_graph",
url: "'. api_get_path(WEB_AJAX_PATH).'social.ajax.php?a=read_url_with_open_graph",
data: "social_wall_new_msg_main=" + e.originalEvent.clipboardData.getData("text"),
data: "social_wall_new_msg_main=" + e.originalEvent.clipboardData.getData("text"),
success: function(response) {
success: function(response) {
$("[name=\'wall_post_button\']").prop( "disabled", false );
$("[name=\'wall_post_button\']").prop( "disabled", false );
@ -390,7 +390,7 @@ if ($show_full_profile) {
.$tags['tag']
.$tags['tag']
.'< / a > ';
.'< / a > ';
}
}
if (is_array($user_tags) & & count($user_tags)>0) {
if (is_array($user_tags) & & count($user_tags) > 0) {
$extra_information_value .= '< li class = "list-group-item" > '.ucfirst($extraFieldInfo['display_text']).': '
$extra_information_value .= '< li class = "list-group-item" > '.ucfirst($extraFieldInfo['display_text']).': '
.' '.implode('', $tag_tmp).'< / li > ';
.' '.implode('', $tag_tmp).'< / li > ';
}
}
@ -414,7 +414,7 @@ if ($show_full_profile) {
$extra_information_value .= '< li class = "list-group-item" > '.$data.'< / li > ';
$extra_information_value .= '< li class = "list-group-item" > '.$data.'< / li > ';
break;
break;
default:
default:
$extra_information_value .= '< li class = "list-group-item" > '.ucfirst($extraFieldInfo['display_text']) . ': ' . $data . '< / li > ';
$extra_information_value .= '< li class = "list-group-item" > '.ucfirst($extraFieldInfo['display_text']).': '.$data.'< / li > ';
break;
break;
}
}
}
}
@ -423,7 +423,7 @@ if ($show_full_profile) {
// if there are information to show
// if there are information to show
if (!empty($extra_information_value)) {
if (!empty($extra_information_value)) {
$extra_information_value = '< ul class = "list-group" > ' . $extra_information_value . '< / ul > ';
$extra_information_value = '< ul class = "list-group" > '.$extra_information_value.'< / ul > ';
$extra_information .= Display::panelCollapse(
$extra_information .= Display::panelCollapse(
get_lang('ExtraInformation'),
get_lang('ExtraInformation'),
@ -563,7 +563,7 @@ if ($show_full_profile) {
// Images uploaded by course
// Images uploaded by course
$file_list = '';
$file_list = '';
if (is_array($course_list_code) & & count($course_list_code)>0) {
if (is_array($course_list_code) & & count($course_list_code) > 0) {
foreach ($course_list_code as $course) {
foreach ($course_list_code as $course) {
$file_list .= UserManager::get_user_upload_files_by_course(
$file_list .= UserManager::get_user_upload_files_by_course(
$user_id,
$user_id,
@ -575,7 +575,7 @@ if ($show_full_profile) {
$count_pending_invitations = 0;
$count_pending_invitations = 0;
if (!isset($_GET['u']) ||
if (!isset($_GET['u']) ||
(isset($_GET['u']) & & $_GET['u']==api_get_user_id())
(isset($_GET['u']) & & $_GET['u'] == api_get_user_id())
) {
) {
$pending_invitations = SocialManager::get_list_invitation_of_friends_by_user_id(api_get_user_id());
$pending_invitations = SocialManager::get_list_invitation_of_friends_by_user_id(api_get_user_id());
$list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id());
$list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id());
@ -584,7 +584,7 @@ if ($show_full_profile) {
if (!empty($production_list) || !empty($file_list) || $count_pending_invitations > 0) {
if (!empty($production_list) || !empty($file_list) || $count_pending_invitations > 0) {
// Pending invitations
// Pending invitations
if (!isset($_GET['u']) || (isset($_GET['u']) & & $_GET['u']==api_get_user_id())) {
if (!isset($_GET['u']) || (isset($_GET['u']) & & $_GET['u'] == api_get_user_id())) {
if ($count_pending_invitations > 0) {
if ($count_pending_invitations > 0) {
$invitations = '< ul class = "list-group" > ';
$invitations = '< ul class = "list-group" > ';
for ($i = 0; $i < $count_pending_invitations; $i++) {
for ($i = 0; $i < $count_pending_invitations; $i++) {
@ -595,12 +595,12 @@ if ($show_full_profile) {
.' width="40px">';
.' width="40px">';
$userInfo = api_get_user_info($user_invitation_id);
$userInfo = api_get_user_info($user_invitation_id);
$invitations .= '< a href = "'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'" > '
$invitations .= '< a href = "'.api_get_path(WEB_PATH).'main/social/profile.php?u='.$user_invitation_id.'" > '
.api_get_person_name($userInfo['firstname'],$userInfo['lastname']).'< / a > ';
.api_get_person_name($userInfo['firstname'], $userInfo['lastname']).'< / a > ';
$invitations .='< div class = "pull-right" > ';
$invitations .= '< div class = "pull-right" > ';
$invitations .= Display::toolbarButton(
$invitations .= Display::toolbarButton(
get_lang('SocialAddToFriends'),
get_lang('SocialAddToFriends'),
api_get_path(WEB_AJAX_PATH) . 'social.ajax.php?' . http_build_query([
api_get_path(WEB_AJAX_PATH).'social.ajax.php?'.http_build_query([
'a' => 'add_friend',
'a' => 'add_friend',
'friend_id' => $user_invitation_id,
'friend_id' => $user_invitation_id,
'is_my_friend' => 'friend'
'is_my_friend' => 'friend'
@ -647,7 +647,7 @@ if ($show_full_profile) {
}
}
if (!empty($user_info['competences']) || !empty($user_info['diplomas'])
if (!empty($user_info['competences']) || !empty($user_info['diplomas'])
|| !empty($user_info['openarea']) || !empty($user_info['teach']) ) {
|| !empty($user_info['openarea']) || !empty($user_info['teach'])) {
$more_info .= '< div > < h3 > '.get_lang('MoreInformation').'< / h3 > < / div > ';
$more_info .= '< div > < h3 > '.get_lang('MoreInformation').'< / h3 > < / div > ';
if (!empty($user_info['competences'])) {
if (!empty($user_info['competences'])) {