|
@@ -58,9 +58,9 @@ if (!empty($_POST['social_wall_new_msg_main']) || !empty($_FILES['picture']['tmp
|
|
|
|
|
|
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']);
|
|
|
- header('Location: ' . $url);
|
|
|
+ header('Location: '.$url);
|
|
|
exit;
|
|
|
|
|
|
} 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
|
|
|
);
|
|
|
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']);
|
|
|
- header('Location: ' . $url);
|
|
|
+ header('Location: '.$url);
|
|
|
exit;
|
|
|
|
|
|
} 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);
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
@@ -153,16 +153,16 @@ $libpath = api_get_path(LIBRARY_PATH);
|
|
|
|
|
|
$ajax_url = api_get_path(WEB_AJAX_PATH).'message.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();
|
|
|
$locale = api_get_language_isocode();
|
|
|
// Add Jquery scroll pagination plugin
|
|
|
$htmlHeadXtra[] = api_get_js('jscroll/jquery.jscroll.js');
|
|
|
// Add Jquery Time ago plugin
|
|
|
$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)) {
|
|
|
- $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.' . $locale . '.js');
|
|
|
+ $htmlHeadXtra[] = api_get_js('jquery-timeago/locales/jquery.timeago.'.$locale.'.js');
|
|
|
}
|
|
|
|
|
|
$htmlHeadXtra[] = '<script>
|
|
@@ -170,7 +170,7 @@ $htmlHeadXtra[] = '<script>
|
|
|
$(document).ready(function (){
|
|
|
var container = $("#wallMessages");
|
|
|
container.jscroll({
|
|
|
- loadingHtml: "<div class=\"well_border\">' . get_lang('Loading') . ' </div>",
|
|
|
+ loadingHtml: "<div class=\"well_border\">' . get_lang('Loading').' </div>",
|
|
|
nextSelector: "a.nextPage:last",
|
|
|
contentSelector: "",
|
|
|
callback: timeAgo
|
|
@@ -200,8 +200,8 @@ $interbreadcrumb[] = array(
|
|
|
);
|
|
|
|
|
|
if (isset($_GET['u']) && is_numeric($_GET['u']) && $_GET['u'] != api_get_user_id()) {
|
|
|
- $info_user = api_get_user_info($_GET['u']);
|
|
|
- $interbreadcrumb[]= array(
|
|
|
+ $info_user = api_get_user_info($_GET['u']);
|
|
|
+ $interbreadcrumb[] = array(
|
|
|
'url' => '#',
|
|
|
'name' => $info_user['complete_name']
|
|
|
);
|
|
@@ -224,7 +224,7 @@ $i = 1;
|
|
|
$list = [];
|
|
|
if (is_array($personal_course_list)) {
|
|
|
foreach ($personal_course_list as $my_course) {
|
|
|
- if ($i<=10) {
|
|
|
+ if ($i <= 10) {
|
|
|
$list[] = SocialManager::get_logged_user_course_html($my_course, $i);
|
|
|
$course_list_code[] = array('code' => $my_course['code']);
|
|
|
} else {
|
|
@@ -262,13 +262,13 @@ $wallSocialAddPost = SocialManager::getWallForm($show_full_profile);
|
|
|
$social_wall_block = $wallSocialAddPost;
|
|
|
|
|
|
// 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;
|
|
|
|
|
|
$socialAutoExtendLink = Display::url(
|
|
|
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(
|
|
|
'class' => 'nextPage next',
|
|
|
)
|
|
@@ -290,12 +290,12 @@ $(document).ready(function() {
|
|
|
$(".spinner").html("'.
|
|
|
'<div class=\'text-center\'>'.
|
|
|
'<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>'.
|
|
|
'");
|
|
|
},
|
|
|
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"),
|
|
|
success: function(response) {
|
|
|
$("[name=\'wall_post_button\']").prop( "disabled", false );
|
|
@@ -390,7 +390,7 @@ if ($show_full_profile) {
|
|
|
.$tags['tag']
|
|
|
.'</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']).': '
|
|
|
.' '.implode('', $tag_tmp).'</li>';
|
|
|
}
|
|
@@ -414,7 +414,7 @@ if ($show_full_profile) {
|
|
|
$extra_information_value .= '<li class="list-group-item">'.$data.'</li>';
|
|
|
break;
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
@@ -423,7 +423,7 @@ if ($show_full_profile) {
|
|
|
// if there are information to show
|
|
|
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(
|
|
|
get_lang('ExtraInformation'),
|
|
@@ -503,10 +503,10 @@ if ($show_full_profile) {
|
|
|
|
|
|
if ($i > $max_numbers_of_group) {
|
|
|
if (api_get_user_id() == $user_id) {
|
|
|
- $my_groups .= '<div class="box_shared_profile_group_actions">'
|
|
|
+ $my_groups .= '<div class="box_shared_profile_group_actions">'
|
|
|
.'<a href="groups.php?#tab_browse-1">'.get_lang('SeeAllMyGroups').'</a></div>';
|
|
|
} else {
|
|
|
- $my_groups .= '<div class="box_shared_profile_group_actions">'
|
|
|
+ $my_groups .= '<div class="box_shared_profile_group_actions">'
|
|
|
.'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php'
|
|
|
.'?view=mygroups&height=390&width=610&user_id='.$user_id.'"'
|
|
|
.' class="ajax" title="'.get_lang('SeeAll').'" >'
|
|
@@ -519,7 +519,7 @@ if ($show_full_profile) {
|
|
|
$i = 1;
|
|
|
foreach ($grid_my_groups as $group) {
|
|
|
$my_groups .= '<div class="panel-body">';
|
|
|
- $my_groups .= $group[0];
|
|
|
+ $my_groups .= $group[0];
|
|
|
$my_groups .= '</div>';
|
|
|
$i++;
|
|
|
}
|
|
@@ -542,7 +542,7 @@ if ($show_full_profile) {
|
|
|
$i++;
|
|
|
}
|
|
|
}
|
|
|
- $social_course_block .= $my_courses;
|
|
|
+ $social_course_block .= $my_courses;
|
|
|
}
|
|
|
|
|
|
// Block Social Sessions
|
|
@@ -563,7 +563,7 @@ if ($show_full_profile) {
|
|
|
|
|
|
// Images uploaded by course
|
|
|
$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) {
|
|
|
$file_list .= UserManager::get_user_upload_files_by_course(
|
|
|
$user_id,
|
|
@@ -575,7 +575,7 @@ if ($show_full_profile) {
|
|
|
|
|
|
$count_pending_invitations = 0;
|
|
|
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());
|
|
|
$list_get_path_web = SocialManager::get_list_web_path_user_invitation_by_user_id(api_get_user_id());
|
|
@@ -584,23 +584,23 @@ if ($show_full_profile) {
|
|
|
|
|
|
if (!empty($production_list) || !empty($file_list) || $count_pending_invitations > 0) {
|
|
|
// 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) {
|
|
|
- $invitations = '<ul class="list-group">';
|
|
|
+ $invitations = '<ul class="list-group">';
|
|
|
for ($i = 0; $i < $count_pending_invitations; $i++) {
|
|
|
$user_invitation_id = $pending_invitations[$i]['user_sender_id'];
|
|
|
- $invitations .= '<li id="dpending_'.$user_invitation_id.'" class="list-group-item">';
|
|
|
- $invitations .= '<img class="img-rounded" '
|
|
|
+ $invitations .= '<li id="dpending_'.$user_invitation_id.'" class="list-group-item">';
|
|
|
+ $invitations .= '<img class="img-rounded" '
|
|
|
.' src="'.$list_get_path_web[$i]['dir'].'/'.$list_get_path_web[$i]['file'].'"'
|
|
|
.' width="40px">';
|
|
|
$userInfo = api_get_user_info($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(
|
|
|
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',
|
|
|
'friend_id' => $user_invitation_id,
|
|
|
'is_my_friend' => 'friend'
|
|
@@ -611,8 +611,8 @@ if ($show_full_profile) {
|
|
|
false
|
|
|
);
|
|
|
$invitations .= '</div>';
|
|
|
- $invitations .= '<div id="id_response"></div>';
|
|
|
- $invitations .= '</li>';
|
|
|
+ $invitations .= '<div id="id_response"></div>';
|
|
|
+ $invitations .= '</li>';
|
|
|
}
|
|
|
$invitations .= '</ul>';
|
|
|
$listInvitations = Display::panelCollapse(
|
|
@@ -627,51 +627,51 @@ if ($show_full_profile) {
|
|
|
}
|
|
|
|
|
|
// Productions
|
|
|
- $production_list = UserManager::build_production_list($user_id);
|
|
|
+ $production_list = UserManager::build_production_list($user_id);
|
|
|
$product_content = '';
|
|
|
if (!empty($production_list)) {
|
|
|
$product_content .= '<div><h3>'.get_lang('MyProductions').'</h3></div>';
|
|
|
- $product_content .= $production_list;
|
|
|
- $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4);
|
|
|
+ $product_content .= $production_list;
|
|
|
+ $socialRightInformation .= SocialManager::social_wrapper_div($product_content, 4);
|
|
|
}
|
|
|
|
|
|
$images_uploaded = null;
|
|
|
// Images uploaded by course
|
|
|
if (!empty($file_list)) {
|
|
|
- $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>';
|
|
|
- $images_uploaded .= '<div class="social-content-information">';
|
|
|
- $images_uploaded .= $file_list;
|
|
|
- $images_uploaded .= '</div>';
|
|
|
- $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4);
|
|
|
+ $images_uploaded .= '<div><h3>'.get_lang('ImagesUploaded').'</h3></div>';
|
|
|
+ $images_uploaded .= '<div class="social-content-information">';
|
|
|
+ $images_uploaded .= $file_list;
|
|
|
+ $images_uploaded .= '</div>';
|
|
|
+ $socialRightInformation .= SocialManager::social_wrapper_div($images_uploaded, 4);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
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'])) {
|
|
|
- $more_info .= '<br />';
|
|
|
- $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>';
|
|
|
- $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>';
|
|
|
- $more_info .= '<br />';
|
|
|
+ $more_info .= '<br />';
|
|
|
+ $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyCompetences').'</strong></div>';
|
|
|
+ $more_info .= '<div class="social-profile-extended">'.$user_info['competences'].'</div>';
|
|
|
+ $more_info .= '<br />';
|
|
|
}
|
|
|
if (!empty($user_info['diplomas'])) {
|
|
|
- $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>';
|
|
|
- $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>';
|
|
|
- $more_info .= '<br />';
|
|
|
+ $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyDiplomas').'</strong></div>';
|
|
|
+ $more_info .= '<div class="social-profile-extended">'.$user_info['diplomas'].'</div>';
|
|
|
+ $more_info .= '<br />';
|
|
|
}
|
|
|
if (!empty($user_info['openarea'])) {
|
|
|
- $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>';
|
|
|
- $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>';
|
|
|
- $more_info .= '<br />';
|
|
|
+ $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyPersonalOpenArea').'</strong></div>';
|
|
|
+ $more_info .= '<div class="social-profile-extended">'.$user_info['openarea'].'</div>';
|
|
|
+ $more_info .= '<br />';
|
|
|
}
|
|
|
if (!empty($user_info['teach'])) {
|
|
|
- $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>';
|
|
|
- $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>';
|
|
|
- $more_info .= '<br />';
|
|
|
+ $more_info .= '<div class="social-actions-message"><strong>'.get_lang('MyTeach').'</strong></div>';
|
|
|
+ $more_info .= '<div class="social-profile-extended">'.$user_info['teach'].'</div>';
|
|
|
+ $more_info .= '<br />';
|
|
|
}
|
|
|
- $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4);
|
|
|
+ $socialRightInformation .= SocialManager::social_wrapper_div($more_info, 4);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -699,7 +699,7 @@ $tpl->assign('invitations', $listInvitations);
|
|
|
$tpl->assign('social_right_information', $socialRightInformation);
|
|
|
$tpl->assign('social_auto_extend_link', $socialAutoExtendLink);
|
|
|
|
|
|
-$formModalTpl = new Template();
|
|
|
+$formModalTpl = new Template();
|
|
|
$formModalTpl->assign('invitation_form', MessageManager::generate_invitation_form('send_invitation'));
|
|
|
$template = $formModalTpl->get_template('social/form_modals.tpl');
|
|
|
$formModals = $formModalTpl->fetch($template);
|