@@ -21,13 +21,13 @@ discard block |
||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | if (isset($_GET['friend_id'])) { |
| 24 | - $my_current_friend = $_GET['friend_id']; |
|
| 24 | + $my_current_friend = $_GET['friend_id']; |
|
| 25 | 25 | UserManager::relate_users($current_user_id, $my_current_friend, $relation_type); |
| 26 | 26 | UserManager::relate_users($my_current_friend, $current_user_id, $relation_type); |
| 27 | 27 | SocialManager::invitation_accepted($my_current_friend, $current_user_id); |
| 28 | 28 | Display::display_normal_message(api_xml_http_response_encode(get_lang('AddedContactToList'))); |
| 29 | 29 | |
| 30 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
| 30 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
| 31 | 31 | } |
| 32 | 32 | break; |
| 33 | 33 | case 'deny_friend': |
@@ -37,15 +37,15 @@ discard block |
||
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | if (isset($_GET['is_my_friend'])) { |
| 40 | - $relation_type = USER_RELATION_TYPE_FRIEND;//my friend |
|
| 40 | + $relation_type = USER_RELATION_TYPE_FRIEND; //my friend |
|
| 41 | 41 | } else { |
| 42 | - $relation_type = USER_RELATION_TYPE_UNKNOW;//Contact unknown |
|
| 42 | + $relation_type = USER_RELATION_TYPE_UNKNOW; //Contact unknown |
|
| 43 | 43 | } |
| 44 | 44 | if (isset($_GET['denied_friend_id'])) { |
| 45 | 45 | SocialManager::invitation_denied($_GET['denied_friend_id'], $current_user_id); |
| 46 | 46 | Display::display_confirmation_message(api_xml_http_response_encode(get_lang('InvitationDenied'))); |
| 47 | 47 | |
| 48 | - header('Location: ' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php'); |
|
| 48 | + header('Location: '.api_get_path(WEB_CODE_PATH).'social/invitations.php'); |
|
| 49 | 49 | } |
| 50 | 50 | break; |
| 51 | 51 | case 'delete_friend': |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | echo ''; |
| 64 | 64 | break; |
| 65 | 65 | } |
| 66 | - $user_id = api_get_user_id(); |
|
| 67 | - $name_search= Security::remove_XSS($_POST['search_name_q']); |
|
| 66 | + $user_id = api_get_user_id(); |
|
| 67 | + $name_search = Security::remove_XSS($_POST['search_name_q']); |
|
| 68 | 68 | $number_friends = 0; |
| 69 | 69 | |
| 70 | 70 | if (isset($name_search) && $name_search != 'undefined') { |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $number_friends = count($friends); |
| 80 | 80 | if ($number_friends != 0) { |
| 81 | - $number_loop = ($number_friends/$number_of_images); |
|
| 81 | + $number_loop = ($number_friends / $number_of_images); |
|
| 82 | 82 | $loop_friends = ceil($number_loop); |
| 83 | - $j=0; |
|
| 84 | - for ($k=0; $k<$loop_friends; $k++) { |
|
| 85 | - if ($j==$number_of_images) { |
|
| 86 | - $number_of_images=$number_of_images*2; |
|
| 83 | + $j = 0; |
|
| 84 | + for ($k = 0; $k < $loop_friends; $k++) { |
|
| 85 | + if ($j == $number_of_images) { |
|
| 86 | + $number_of_images = $number_of_images * 2; |
|
| 87 | 87 | } |
| 88 | - while ($j<$number_of_images) { |
|
| 88 | + while ($j < $number_of_images) { |
|
| 89 | 89 | if (isset($friends[$j])) { |
| 90 | 90 | $friend = $friends[$j]; |
| 91 | 91 | $user_name = api_xml_http_response_encode($friend['firstName'].' '.$friend['lastName']); |
@@ -93,15 +93,15 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $friend_html .= ' |
| 95 | 95 | <div class="col-md-3"> |
| 96 | - <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'] . '"> |
|
| 97 | - <img src="' . $userPicture . '" class="img-responsive" id="imgfriend_' . $friend['friend_user_id'] . '" title="$user_name"> |
|
| 96 | + <div class="thumbnail text-center" id="div_' . $friends[$j]['friend_user_id'].'"> |
|
| 97 | + <img src="' . $userPicture.'" class="img-responsive" id="imgfriend_'.$friend['friend_user_id'].'" title="$user_name"> |
|
| 98 | 98 | <div class="caption"> |
| 99 | 99 | <h3> |
| 100 | - <a href="profile.php?u=' . $friend['friend_user_id'] . '">' . $user_name . '</a> |
|
| 100 | + <a href="profile.php?u=' . $friend['friend_user_id'].'">'.$user_name.'</a> |
|
| 101 | 101 | </h3> |
| 102 | 102 | <p> |
| 103 | - <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'] . '> |
|
| 104 | - ' . get_lang('Delete') . ' |
|
| 103 | + <button class="btn btn-danger" onclick="delete_friend(this)" id=img_' . $friend['friend_user_id'].'> |
|
| 104 | + ' . get_lang('Delete').' |
|
| 105 | 105 | </button> |
| 106 | 106 | </p> |
| 107 | 107 | </div> |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | |
| 131 | 131 | switch ($action) { |
| 132 | 132 | case 'load_course': |
| 133 | - $course_id = intval($_POST['course_code']); // the int course id |
|
| 133 | + $course_id = intval($_POST['course_code']); // the int course id |
|
| 134 | 134 | $course_info = api_get_course_info_by_id($course_id); |
| 135 | 135 | $course_code = $course_info['code']; |
| 136 | 136 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | //------Forum messages |
| 139 | 139 | $forum_result = get_all_post_from_user($user_id, $course_code); |
| 140 | 140 | $all_result_data = 0; |
| 141 | - if ($forum_result !='') { |
|
| 141 | + if ($forum_result != '') { |
|
| 142 | 142 | echo '<div id="social-forum-main-title">'; |
| 143 | 143 | echo api_xml_http_response_encode(get_lang('Forum')); |
| 144 | 144 | echo '</div>'; |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | if (!empty($array)) { |
| 202 | 202 | ksort($array); |
| 203 | 203 | $html = ''; |
| 204 | - for($i = 0; $i < count($array); $i++) { |
|
| 204 | + for ($i = 0; $i < count($array); $i++) { |
|
| 205 | 205 | $post = $array[$i]['html']; |
| 206 | 206 | $comment = SocialManager::getWallMessagesHTML($userId, $friendId, $array[$i]['id']); |
| 207 | 207 | $html .= '<div class="panel panel-info"><div class="panel-body">'.$post.$comment.'</div></div>'; |
@@ -209,8 +209,8 @@ discard block |
||
| 209 | 209 | $html .= Display::div( |
| 210 | 210 | Display::url( |
| 211 | 211 | get_lang('SeeMore'), |
| 212 | - api_get_self() . '?u=' . $userId . '&a=listWallMessage&start=' . |
|
| 213 | - ($start + $length + 1) . '&length=' . $length, |
|
| 212 | + api_get_self().'?u='.$userId.'&a=listWallMessage&start='. |
|
| 213 | + ($start + $length + 1).'&length='.$length, |
|
| 214 | 214 | array( |
| 215 | 215 | 'class' => 'nextPage', |
| 216 | 216 | ) |
@@ -314,7 +314,7 @@ |
||
| 314 | 314 | * Set votes |
| 315 | 315 | * |
| 316 | 316 | * @param integer $votes |
| 317 | - * @return integer |
|
| 317 | + * @return Message |
|
| 318 | 318 | */ |
| 319 | 319 | public function setVotes($votes) |
| 320 | 320 | { |
@@ -112,12 +112,12 @@ discard block |
||
| 112 | 112 | friend_user_id<>'.((int) $user_id).' AND |
| 113 | 113 | user_id='.((int) $user_id); |
| 114 | 114 | if (isset($id_group) && $id_group > 0) { |
| 115 | - $sql.=' AND relation_type='.$id_group; |
|
| 115 | + $sql .= ' AND relation_type='.$id_group; |
|
| 116 | 116 | } |
| 117 | 117 | if (isset($search_name)) { |
| 118 | 118 | $search_name = trim($search_name); |
| 119 | 119 | $search_name = str_replace(' ', '', $search_name); |
| 120 | - $sql.=' AND friend_user_id IN ( |
|
| 120 | + $sql .= ' AND friend_user_id IN ( |
|
| 121 | 121 | SELECT user_id FROM '.$tbl_my_user.' |
| 122 | 122 | WHERE |
| 123 | 123 | firstName LIKE "%'.Database::escape_string($search_name).'%" OR |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | |
| 375 | 375 | $user_info = api_get_user_info($userfriend_id); |
| 376 | 376 | $succes = get_lang('MessageSentTo'); |
| 377 | - $succes.= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']); |
|
| 377 | + $succes .= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']); |
|
| 378 | 378 | |
| 379 | 379 | if (isset($subject_message) && isset($content_message) && isset($userfriend_id)) { |
| 380 | 380 | $send_message = MessageManager::send_message($userfriend_id, $subject_message, $content_message); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | $user_in_course_status = CourseManager :: get_user_in_course_status(api_get_user_id(), $course_code); |
| 494 | 494 | |
| 495 | 495 | //$valor = api_get_settings_params(); |
| 496 | - $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path |
|
| 496 | + $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path |
|
| 497 | 497 | if (api_get_setting('course_images_in_courses_list') === 'true') { |
| 498 | 498 | if (file_exists($course_path.'/course-pic85x85.png')) { |
| 499 | 499 | $image = $my_course['course_info']['course_image']; |
@@ -518,7 +518,7 @@ discard block |
||
| 518 | 518 | if ($course_visibility != COURSE_VISIBILITY_HIDDEN && |
| 519 | 519 | ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER) |
| 520 | 520 | ) { |
| 521 | - $result .= '<span class="title">' . $course_title . '<span>'; |
|
| 521 | + $result .= '<span class="title">'.$course_title.'<span>'; |
|
| 522 | 522 | } else { |
| 523 | 523 | $result .= $course_title." "." ".get_lang('CourseClosed').""; |
| 524 | 524 | } |
@@ -737,57 +737,57 @@ discard block |
||
| 737 | 737 | $links = '<ul class="nav nav-pills nav-stacked">'; |
| 738 | 738 | $active = $show == 'home' ? 'active' : null; |
| 739 | 739 | $links .= ' |
| 740 | - <li class="home-icon ' . $active . '"> |
|
| 741 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php"> |
|
| 742 | - ' . $homeIcon . ' ' . get_lang('Home') . ' |
|
| 740 | + <li class="home-icon ' . $active.'"> |
|
| 741 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php"> |
|
| 742 | + ' . $homeIcon.' '.get_lang('Home').' |
|
| 743 | 743 | </a> |
| 744 | 744 | </li>'; |
| 745 | 745 | $active = $show == 'messages' ? 'active' : null; |
| 746 | 746 | $links .= ' |
| 747 | - <li class="messages-icon ' . $active . '"> |
|
| 748 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social"> |
|
| 749 | - ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . ' |
|
| 747 | + <li class="messages-icon ' . $active.'"> |
|
| 748 | + <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social"> |
|
| 749 | + ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.' |
|
| 750 | 750 | </a> |
| 751 | 751 | </li>'; |
| 752 | 752 | |
| 753 | 753 | //Invitations |
| 754 | 754 | $active = $show == 'invitations' ? 'active' : null; |
| 755 | 755 | $links .= ' |
| 756 | - <li class="invitations-icon ' . $active . '"> |
|
| 757 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php"> |
|
| 758 | - ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . ' |
|
| 756 | + <li class="invitations-icon ' . $active.'"> |
|
| 757 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php"> |
|
| 758 | + ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.' |
|
| 759 | 759 | </a> |
| 760 | 760 | </li>'; |
| 761 | 761 | |
| 762 | 762 | //Shared profile and groups |
| 763 | 763 | $active = $show == 'shared_profile' ? 'active' : null; |
| 764 | 764 | $links .= ' |
| 765 | - <li class="shared-profile-icon' . $active . '"> |
|
| 766 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php"> |
|
| 767 | - ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . ' |
|
| 765 | + <li class="shared-profile-icon' . $active.'"> |
|
| 766 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php"> |
|
| 767 | + ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').' |
|
| 768 | 768 | </a> |
| 769 | 769 | </li>'; |
| 770 | 770 | $active = $show == 'friends' ? 'active' : null; |
| 771 | 771 | $links .= ' |
| 772 | - <li class="friends-icon ' . $active . '"> |
|
| 773 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php"> |
|
| 774 | - ' . $friendsIcon . ' ' . get_lang('Friends') . ' |
|
| 772 | + <li class="friends-icon ' . $active.'"> |
|
| 773 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php"> |
|
| 774 | + ' . $friendsIcon.' '.get_lang('Friends').' |
|
| 775 | 775 | </a> |
| 776 | 776 | </li>'; |
| 777 | 777 | $active = $show == 'browse_groups' ? 'active' : null; |
| 778 | 778 | $links .= ' |
| 779 | - <li class="browse-groups-icon ' . $active . '"> |
|
| 780 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php"> |
|
| 781 | - ' . $groupsIcon . ' ' . get_lang('SocialGroups') . ' |
|
| 779 | + <li class="browse-groups-icon ' . $active.'"> |
|
| 780 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php"> |
|
| 781 | + ' . $groupsIcon.' '.get_lang('SocialGroups').' |
|
| 782 | 782 | </a> |
| 783 | 783 | </li>'; |
| 784 | 784 | |
| 785 | 785 | //Search users |
| 786 | 786 | $active = $show == 'search' ? 'active' : null; |
| 787 | 787 | $links .= ' |
| 788 | - <li class="search-icon ' . $active . '"> |
|
| 789 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php"> |
|
| 790 | - ' . $searchIcon . ' ' . get_lang('Search') . ' |
|
| 788 | + <li class="search-icon ' . $active.'"> |
|
| 789 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php"> |
|
| 790 | + ' . $searchIcon.' '.get_lang('Search').' |
|
| 791 | 791 | </a> |
| 792 | 792 | </li>'; |
| 793 | 793 | |
@@ -795,9 +795,9 @@ discard block |
||
| 795 | 795 | $active = $show == 'myfiles' ? 'active' : null; |
| 796 | 796 | |
| 797 | 797 | $myFiles = ' |
| 798 | - <li class="myfiles-icon ' . $active . '"> |
|
| 799 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php"> |
|
| 800 | - ' . $filesIcon . ' ' . get_lang('MyFiles') . ' |
|
| 798 | + <li class="myfiles-icon ' . $active.'"> |
|
| 799 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php"> |
|
| 800 | + ' . $filesIcon.' '.get_lang('MyFiles').' |
|
| 801 | 801 | </a> |
| 802 | 802 | </li>'; |
| 803 | 803 | |
@@ -806,7 +806,7 @@ discard block |
||
| 806 | 806 | } |
| 807 | 807 | $links .= $myFiles; |
| 808 | 808 | |
| 809 | - $links .='</ul>'; |
|
| 809 | + $links .= '</ul>'; |
|
| 810 | 810 | |
| 811 | 811 | $html .= Display::panelCollapse( |
| 812 | 812 | get_lang('SocialNetwork'), |
@@ -827,57 +827,57 @@ discard block |
||
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | if ($show == 'shared_profile') { |
| 830 | - $links = '<ul class="nav nav-pills nav-stacked">'; |
|
| 830 | + $links = '<ul class="nav nav-pills nav-stacked">'; |
|
| 831 | 831 | // My own profile |
| 832 | 832 | if ($show_full_profile && $user_id == intval(api_get_user_id())) { |
| 833 | 833 | $links .= ' |
| 834 | - <li class="home-icon ' . $active . '"> |
|
| 835 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php"> |
|
| 836 | - ' . $homeIcon . ' ' . get_lang('Home') . ' |
|
| 834 | + <li class="home-icon ' . $active.'"> |
|
| 835 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php"> |
|
| 836 | + ' . $homeIcon.' '.get_lang('Home').' |
|
| 837 | 837 | </a> |
| 838 | 838 | </li> |
| 839 | - <li class="messages-icon ' . $active . '"> |
|
| 840 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social"> |
|
| 841 | - ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . ' |
|
| 839 | + <li class="messages-icon ' . $active.'"> |
|
| 840 | + <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social"> |
|
| 841 | + ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.' |
|
| 842 | 842 | </a> |
| 843 | 843 | </li>'; |
| 844 | 844 | $active = $show == 'invitations' ? 'active' : null; |
| 845 | 845 | $links .= ' |
| 846 | - <li class="invitations-icon' . $active . '"> |
|
| 847 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php"> |
|
| 848 | - ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . ' |
|
| 846 | + <li class="invitations-icon' . $active.'"> |
|
| 847 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php"> |
|
| 848 | + ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.' |
|
| 849 | 849 | </a> |
| 850 | 850 | </li>'; |
| 851 | 851 | |
| 852 | 852 | $links .= ' |
| 853 | 853 | <li class="shared-profile-icon active"> |
| 854 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php"> |
|
| 855 | - ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . ' |
|
| 854 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php"> |
|
| 855 | + ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').' |
|
| 856 | 856 | </a> |
| 857 | 857 | </li> |
| 858 | 858 | <li class="friends-icon"> |
| 859 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php"> |
|
| 860 | - ' . $friendsIcon . ' ' . get_lang('Friends') . ' |
|
| 859 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php"> |
|
| 860 | + ' . $friendsIcon.' '.get_lang('Friends').' |
|
| 861 | 861 | </a> |
| 862 | 862 | </li> |
| 863 | 863 | <li class="browse-groups-icon"> |
| 864 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php"> |
|
| 865 | - ' . $groupsIcon . ' ' . get_lang('SocialGroups') . ' |
|
| 864 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php"> |
|
| 865 | + ' . $groupsIcon.' '.get_lang('SocialGroups').' |
|
| 866 | 866 | </a> |
| 867 | 867 | </li>'; |
| 868 | 868 | $active = $show == 'search' ? 'active' : null; |
| 869 | 869 | $links .= ' |
| 870 | - <li class="search-icon ' . $active . '"> |
|
| 871 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php"> |
|
| 872 | - ' . $searchIcon . ' ' . get_lang('Search') . ' |
|
| 870 | + <li class="search-icon ' . $active.'"> |
|
| 871 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php"> |
|
| 872 | + ' . $searchIcon.' '.get_lang('Search').' |
|
| 873 | 873 | </a> |
| 874 | 874 | </li>'; |
| 875 | 875 | $active = $show == 'myfiles' ? 'active' : null; |
| 876 | 876 | |
| 877 | 877 | $myFiles = ' |
| 878 | - <li class="myfiles-icon ' . $active . '"> |
|
| 879 | - <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php"> |
|
| 880 | - ' . $filesIcon . ' ' . get_lang('MyFiles') . ' |
|
| 878 | + <li class="myfiles-icon ' . $active.'"> |
|
| 879 | + <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php"> |
|
| 880 | + ' . $filesIcon.' '.get_lang('MyFiles').' |
|
| 881 | 881 | </a> |
| 882 | 882 | </li>'; |
| 883 | 883 | |
@@ -923,7 +923,7 @@ discard block |
||
| 923 | 923 | $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).' '.get_lang('YouAlreadySentAnInvitation').'</a></li>'; |
| 924 | 924 | } else { |
| 925 | 925 | if (!$show_full_profile) { |
| 926 | - $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="' . $user_id . '" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).' '.get_lang('SendInvitation').'</a></li>'; |
|
| 926 | + $links .= '<li><a class="btn-to-send-invitation" href="#" data-send-to="'.$user_id.'" title="'.get_lang('SendInvitation').'">'.Display :: return_icon('invitation.png', get_lang('SocialInvitationToFriends')).' '.get_lang('SendInvitation').'</a></li>'; |
|
| 927 | 927 | } |
| 928 | 928 | } |
| 929 | 929 | |
@@ -1035,10 +1035,10 @@ discard block |
||
| 1035 | 1035 | foreach ($user_list as $uid) { |
| 1036 | 1036 | $user_info = api_get_user_info($uid, $checkIfUserOnline = true); |
| 1037 | 1037 | $lastname = $user_info['lastname']; |
| 1038 | - $firstname = $user_info['firstname']; |
|
| 1038 | + $firstname = $user_info['firstname']; |
|
| 1039 | 1039 | $completeName = $firstname.', '.$lastname; |
| 1040 | 1040 | |
| 1041 | - $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png',get_lang('Teacher'),null,ICON_SIZE_TINY) : Display::return_icon('user.png',get_lang('Student'),null,ICON_SIZE_TINY); |
|
| 1041 | + $user_rol = $user_info['status'] == 1 ? Display::return_icon('teacher.png', get_lang('Teacher'), null, ICON_SIZE_TINY) : Display::return_icon('user.png', get_lang('Student'), null, ICON_SIZE_TINY); |
|
| 1042 | 1042 | $status_icon_chat = null; |
| 1043 | 1043 | if ($user_info['user_is_online_in_chat'] == 1) { |
| 1044 | 1044 | $status_icon_chat = Display::return_icon('online.png', get_lang('Online')); |
@@ -1049,7 +1049,7 @@ discard block |
||
| 1049 | 1049 | $userPicture = $user_info['avatar']; |
| 1050 | 1050 | $img = '<img class="img-responsive img-circle" title="'.$completeName.'" alt="'.$completeName.'" src="'.$userPicture.'">'; |
| 1051 | 1051 | |
| 1052 | - $url = null; |
|
| 1052 | + $url = null; |
|
| 1053 | 1053 | // Anonymous users can't have access to the profile |
| 1054 | 1054 | if (!api_is_anonymous()) { |
| 1055 | 1055 | if (api_get_setting('allow_social_tool') == 'true') { |
@@ -1215,13 +1215,13 @@ discard block |
||
| 1215 | 1215 | case SOCIAL_CENTER_PLUGIN: |
| 1216 | 1216 | $social_plugins = array(1, 2); |
| 1217 | 1217 | if (is_array($social_plugins) && count($social_plugins) > 0) { |
| 1218 | - $content.= '<div id="social-plugins">'; |
|
| 1218 | + $content .= '<div id="social-plugins">'; |
|
| 1219 | 1219 | foreach ($social_plugins as $plugin) { |
| 1220 | - $content.= '<div class="social-plugin-item">'; |
|
| 1221 | - $content.= $plugin; |
|
| 1222 | - $content.= '</div>'; |
|
| 1220 | + $content .= '<div class="social-plugin-item">'; |
|
| 1221 | + $content .= $plugin; |
|
| 1222 | + $content .= '</div>'; |
|
| 1223 | 1223 | } |
| 1224 | - $content.= '</div>'; |
|
| 1224 | + $content .= '</div>'; |
|
| 1225 | 1225 | } |
| 1226 | 1226 | break; |
| 1227 | 1227 | case SOCIAL_LEFT_PLUGIN: |
@@ -1292,12 +1292,12 @@ discard block |
||
| 1292 | 1292 | if (!in_array($extension, $allowedTypes)) { |
| 1293 | 1293 | $flag = false; |
| 1294 | 1294 | } else { |
| 1295 | - $newFileName = uniqid('') . '.' . $extension; |
|
| 1295 | + $newFileName = uniqid('').'.'.$extension; |
|
| 1296 | 1296 | if (!file_exists($pathMessageAttach)) { |
| 1297 | 1297 | @mkdir($pathMessageAttach, api_get_permissions_for_new_directories(), true); |
| 1298 | 1298 | } |
| 1299 | 1299 | |
| 1300 | - $newPath = $pathMessageAttach . $newFileName; |
|
| 1300 | + $newPath = $pathMessageAttach.$newFileName; |
|
| 1301 | 1301 | if (is_uploaded_file($fileAttach['tmp_name'])) { |
| 1302 | 1302 | @copy($fileAttach['tmp_name'], $newPath); |
| 1303 | 1303 | } |
@@ -1306,9 +1306,9 @@ discard block |
||
| 1306 | 1306 | $medium = self::resize_picture($newPath, IMAGE_WALL_MEDIUM_SIZE); |
| 1307 | 1307 | |
| 1308 | 1308 | $big = new Image($newPath); |
| 1309 | - $ok = $small && $small->send_image($pathMessageAttach . IMAGE_WALL_SMALL . '_' . $newFileName) && |
|
| 1310 | - $medium && $medium->send_image($pathMessageAttach . IMAGE_WALL_MEDIUM .'_' . $newFileName) && |
|
| 1311 | - $big && $big->send_image($pathMessageAttach . IMAGE_WALL_BIG . '_' . $newFileName); |
|
| 1309 | + $ok = $small && $small->send_image($pathMessageAttach.IMAGE_WALL_SMALL.'_'.$newFileName) && |
|
| 1310 | + $medium && $medium->send_image($pathMessageAttach.IMAGE_WALL_MEDIUM.'_'.$newFileName) && |
|
| 1311 | + $big && $big->send_image($pathMessageAttach.IMAGE_WALL_BIG.'_'.$newFileName); |
|
| 1312 | 1312 | |
| 1313 | 1313 | // Insert |
| 1314 | 1314 | $newFileName = $social.$newFileName; |
@@ -1400,7 +1400,7 @@ discard block |
||
| 1400 | 1400 | $start = '0000-00-00'; |
| 1401 | 1401 | } |
| 1402 | 1402 | |
| 1403 | - $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
| 1403 | + $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
| 1404 | 1404 | $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL, $idMessage, $start, $limit, $offset); |
| 1405 | 1405 | $formattedList = '<div class="sub-mediapost">'; |
| 1406 | 1406 | $users = array(); |
@@ -1415,20 +1415,20 @@ discard block |
||
| 1415 | 1415 | } |
| 1416 | 1416 | |
| 1417 | 1417 | $nameComplete = api_is_western_name_order() |
| 1418 | - ? $users[$userIdLoop]['firstname'] .' ' . $users[$userIdLoop]['lastname'] |
|
| 1419 | - : $users[$userIdLoop]['lastname'] . ' ' . $users[$userIdLoop]['firstname']; |
|
| 1418 | + ? $users[$userIdLoop]['firstname'].' '.$users[$userIdLoop]['lastname'] |
|
| 1419 | + : $users[$userIdLoop]['lastname'].' '.$users[$userIdLoop]['firstname']; |
|
| 1420 | 1420 | $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop; |
| 1421 | 1421 | $media = ''; |
| 1422 | 1422 | $media .= '<div class="rep-post">'; |
| 1423 | 1423 | $media .= '<div class="col-md-2 col-xs-2 social-post-answers">'; |
| 1424 | 1424 | $media .= '<div class="user-image pull-right">'; |
| 1425 | - $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] . |
|
| 1425 | + $media .= '<a href="'.$url.'" ><img src="'.$users[$userIdLoop]['avatar']. |
|
| 1426 | 1426 | '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>'; |
| 1427 | 1427 | $media .= '</div>'; |
| 1428 | 1428 | $media .= '</div>'; |
| 1429 | 1429 | $media .= '<div class="col-md-9 col-xs-9 social-post-answers">'; |
| 1430 | 1430 | $media .= '<div class="user-data">'; |
| 1431 | - $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a> <span>'.Security::remove_XSS($message['content']).'</span></div>'; |
|
| 1431 | + $media .= '<div class="username">'.'<a href="'.$url.'">'.$nameComplete.'</a> <span>'.Security::remove_XSS($message['content']).'</span></div>'; |
|
| 1432 | 1432 | $media .= '<div class="time timeago" title="'.$date.'">'.$date.'</div>'; |
| 1433 | 1433 | $media .= '<br />'; |
| 1434 | 1434 | $media .= '</div>'; |
@@ -1471,12 +1471,12 @@ discard block |
||
| 1471 | 1471 | * @param int $offset Wall messages offset |
| 1472 | 1472 | * @return array $data return user's starting wall messages along with message extra data |
| 1473 | 1473 | */ |
| 1474 | - public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset= 0) |
|
| 1474 | + public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset = 0) |
|
| 1475 | 1475 | { |
| 1476 | 1476 | if (empty($start)) { |
| 1477 | 1477 | $start = '0000-00-00'; |
| 1478 | 1478 | } |
| 1479 | - $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
| 1479 | + $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId); |
|
| 1480 | 1480 | $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL_POST, null, $start, $limit, $offset); |
| 1481 | 1481 | $users = array(); |
| 1482 | 1482 | $data = array(); |
@@ -1535,7 +1535,7 @@ discard block |
||
| 1535 | 1535 | |
| 1536 | 1536 | $htmlReceiver = ''; |
| 1537 | 1537 | if ($authorId != $receiverId) { |
| 1538 | - $htmlReceiver = ' > <a href="'.$urlReceiver.'">' . $nameCompleteReceiver . '</a> '; |
|
| 1538 | + $htmlReceiver = ' > <a href="'.$urlReceiver.'">'.$nameCompleteReceiver.'</a> '; |
|
| 1539 | 1539 | } |
| 1540 | 1540 | |
| 1541 | 1541 | $wallImage = ''; |
@@ -1570,7 +1570,7 @@ discard block |
||
| 1570 | 1570 | $html .= '<div class="img-post">'; |
| 1571 | 1571 | $html .= $wallImage; |
| 1572 | 1572 | $html .= '</div>'; |
| 1573 | - $html .= '<p>'. Security::remove_XSS($message['content']).'</p>'; |
|
| 1573 | + $html .= '<p>'.Security::remove_XSS($message['content']).'</p>'; |
|
| 1574 | 1574 | $html .= '</div>'; |
| 1575 | 1575 | $html .= '</div>'; // end mediaPost |
| 1576 | 1576 | |
@@ -1654,16 +1654,16 @@ discard block |
||
| 1654 | 1654 | if (isset($array[2]) && !empty($array[2])) { |
| 1655 | 1655 | |
| 1656 | 1656 | if ($size == IMAGE_WALL_SMALL) { |
| 1657 | - $name = IMAGE_WALL_SMALL. '_' . $array[2]; |
|
| 1658 | - }else if($size == IMAGE_WALL_MEDIUM){ |
|
| 1659 | - $name = IMAGE_WALL_MEDIUM. '_' . $array[2]; |
|
| 1660 | - }else if($size == IMAGE_WALL_BIG){ |
|
| 1661 | - $name = IMAGE_WALL_BIG. '_' . $array[2]; |
|
| 1662 | - }else { |
|
| 1663 | - $name = IMAGE_WALL_SMALL. '_' . $array[2]; |
|
| 1657 | + $name = IMAGE_WALL_SMALL.'_'.$array[2]; |
|
| 1658 | + } else if ($size == IMAGE_WALL_MEDIUM) { |
|
| 1659 | + $name = IMAGE_WALL_MEDIUM.'_'.$array[2]; |
|
| 1660 | + } else if ($size == IMAGE_WALL_BIG) { |
|
| 1661 | + $name = IMAGE_WALL_BIG.'_'.$array[2]; |
|
| 1662 | + } else { |
|
| 1663 | + $name = IMAGE_WALL_SMALL.'_'.$array[2]; |
|
| 1664 | 1664 | } |
| 1665 | 1665 | $lessImage = str_replace($array[2], '', $path); |
| 1666 | - $name = $lessImage . $name; |
|
| 1666 | + $name = $lessImage.$name; |
|
| 1667 | 1667 | } |
| 1668 | 1668 | |
| 1669 | 1669 | return $name; |
@@ -1771,18 +1771,18 @@ discard block |
||
| 1771 | 1771 | if ($number_friends != 0) { |
| 1772 | 1772 | if ($number_friends > $number_of_images) { |
| 1773 | 1773 | if (api_get_user_id() == $user_id) { |
| 1774 | - $friendHtml.= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>'; |
|
| 1774 | + $friendHtml .= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>'; |
|
| 1775 | 1775 | } else { |
| 1776 | - $friendHtml.= ' <span>' |
|
| 1776 | + $friendHtml .= ' <span>' |
|
| 1777 | 1777 | .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php' |
| 1778 | 1778 | .'?view=friends&height=390&width=610&user_id='.$user_id.'"' |
| 1779 | 1779 | .'class="ajax" data-title="'.get_lang('SeeAll').'" title="'.get_lang('SeeAll').'" >'.get_lang('SeeAll').'</a></span>'; |
| 1780 | 1780 | } |
| 1781 | 1781 | } |
| 1782 | 1782 | |
| 1783 | - $friendHtml.= '<ul class="nav nav-list">'; |
|
| 1783 | + $friendHtml .= '<ul class="nav nav-list">'; |
|
| 1784 | 1784 | $j = 1; |
| 1785 | - for ($k=0; $k < $number_friends; $k++) { |
|
| 1785 | + for ($k = 0; $k < $number_friends; $k++) { |
|
| 1786 | 1786 | if ($j > $number_of_images) break; |
| 1787 | 1787 | |
| 1788 | 1788 | if (isset($friends[$k])) { |
@@ -1796,26 +1796,26 @@ discard block |
||
| 1796 | 1796 | $statusIcon = Display::span('', array('class' => 'offline_user_in_text')); |
| 1797 | 1797 | } |
| 1798 | 1798 | |
| 1799 | - $friendHtml.= '<li>'; |
|
| 1800 | - $friendHtml.= '<div>'; |
|
| 1799 | + $friendHtml .= '<li>'; |
|
| 1800 | + $friendHtml .= '<div>'; |
|
| 1801 | 1801 | |
| 1802 | 1802 | // the height = 92 must be the same in the image_friend_network span style in default.css |
| 1803 | 1803 | $friends_profile = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_SMALL); |
| 1804 | - $friendHtml.= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>'; |
|
| 1804 | + $friendHtml .= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>'; |
|
| 1805 | 1805 | $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared; |
| 1806 | - $friendHtml.= $statusIcon .'<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user .'</a>'; |
|
| 1807 | - $friendHtml.= '</div>'; |
|
| 1808 | - $friendHtml.= '</li>'; |
|
| 1806 | + $friendHtml .= $statusIcon.'<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'">'.$name_user.'</a>'; |
|
| 1807 | + $friendHtml .= '</div>'; |
|
| 1808 | + $friendHtml .= '</li>'; |
|
| 1809 | 1809 | } |
| 1810 | 1810 | $j++; |
| 1811 | 1811 | } |
| 1812 | - $friendHtml.='</ul>'; |
|
| 1812 | + $friendHtml .= '</ul>'; |
|
| 1813 | 1813 | } else { |
| 1814 | - $friendHtml.= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />' |
|
| 1815 | - .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
| 1814 | + $friendHtml .= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />' |
|
| 1815 | + .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
| 1816 | 1816 | } |
| 1817 | 1817 | |
| 1818 | - $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' (' . $number_friends . ')' ); |
|
| 1818 | + $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' ('.$number_friends.')'); |
|
| 1819 | 1819 | |
| 1820 | 1820 | return $friendHtml; |
| 1821 | 1821 | } |
@@ -1836,9 +1836,9 @@ discard block |
||
| 1836 | 1836 | |
| 1837 | 1837 | if ($number_friends != 0) { |
| 1838 | 1838 | |
| 1839 | - $friendHtml.= '<div class="list-group">'; |
|
| 1839 | + $friendHtml .= '<div class="list-group">'; |
|
| 1840 | 1840 | $j = 1; |
| 1841 | - for ($k=0; $k < $number_friends; $k++) { |
|
| 1841 | + for ($k = 0; $k < $number_friends; $k++) { |
|
| 1842 | 1842 | if ($j > $number_of_images) { |
| 1843 | 1843 | break; |
| 1844 | 1844 | } |
@@ -1848,11 +1848,11 @@ discard block |
||
| 1848 | 1848 | $user_info_friend = api_get_user_info($friend['friend_user_id'], true); |
| 1849 | 1849 | |
| 1850 | 1850 | if ($user_info_friend['user_is_online']) { |
| 1851 | - $statusIcon = Display::return_icon('statusonline.png',get_lang('Online')); |
|
| 1852 | - $status=1; |
|
| 1851 | + $statusIcon = Display::return_icon('statusonline.png', get_lang('Online')); |
|
| 1852 | + $status = 1; |
|
| 1853 | 1853 | } else { |
| 1854 | - $statusIcon = Display::return_icon('statusoffline.png',get_lang('Offline')); |
|
| 1855 | - $status=0; |
|
| 1854 | + $statusIcon = Display::return_icon('statusoffline.png', get_lang('Offline')); |
|
| 1855 | + $status = 0; |
|
| 1856 | 1856 | } |
| 1857 | 1857 | |
| 1858 | 1858 | $friendAvatarMedium = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_MEDIUM); |
@@ -1861,24 +1861,24 @@ discard block |
||
| 1861 | 1861 | $showLinkToChat = api_is_global_chat_enabled() && |
| 1862 | 1862 | $friend['friend_user_id'] != api_get_user_id(); |
| 1863 | 1863 | |
| 1864 | - if ($showLinkToChat){ |
|
| 1864 | + if ($showLinkToChat) { |
|
| 1865 | 1865 | $friendHtml .= '<a onclick="javascript:chatWith(\''.$friend['friend_user_id'].'\', \''.$name_user.'\', \''.$status.'\',\''.$friendAvatarSmall.'\')" href="javascript:void(0);" class="list-group-item">'; |
| 1866 | - $friendHtml .= $friend_avatar.' <span class="username">' . $name_user . '</span>'; |
|
| 1867 | - $friendHtml .= '<span class="status">' . $statusIcon . '</span>'; |
|
| 1866 | + $friendHtml .= $friend_avatar.' <span class="username">'.$name_user.'</span>'; |
|
| 1867 | + $friendHtml .= '<span class="status">'.$statusIcon.'</span>'; |
|
| 1868 | 1868 | } else { |
| 1869 | 1869 | $link_shared = empty($link_shared) ? '' : '&'.$link_shared; |
| 1870 | - $friendHtml .= '<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '" class="list-group-item">'; |
|
| 1871 | - $friendHtml .= $friend_avatar.' <span class="username-all">' . $name_user . '</span>'; |
|
| 1870 | + $friendHtml .= '<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'" class="list-group-item">'; |
|
| 1871 | + $friendHtml .= $friend_avatar.' <span class="username-all">'.$name_user.'</span>'; |
|
| 1872 | 1872 | } |
| 1873 | 1873 | |
| 1874 | 1874 | $friendHtml .= '</a>'; |
| 1875 | 1875 | } |
| 1876 | 1876 | $j++; |
| 1877 | 1877 | } |
| 1878 | - $friendHtml.='</div>'; |
|
| 1878 | + $friendHtml .= '</div>'; |
|
| 1879 | 1879 | } else { |
| 1880 | - $friendHtml.= '<div class="help">'.get_lang('NoFriendsInYourContactList').' ' |
|
| 1881 | - .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
| 1880 | + $friendHtml .= '<div class="help">'.get_lang('NoFriendsInYourContactList').' ' |
|
| 1881 | + .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>'; |
|
| 1882 | 1882 | } |
| 1883 | 1883 | |
| 1884 | 1884 | return $friendHtml; |
@@ -1896,7 +1896,7 @@ discard block |
||
| 1896 | 1896 | 'post', |
| 1897 | 1897 | api_get_path(WEB_CODE_PATH).'social/profile.php'.$userId, |
| 1898 | 1898 | null, |
| 1899 | - array('enctype' => 'multipart/form-data') , |
|
| 1899 | + array('enctype' => 'multipart/form-data'), |
|
| 1900 | 1900 | FormValidator::LAYOUT_HORIZONTAL |
| 1901 | 1901 | ); |
| 1902 | 1902 | |