Completed
Push — 1.11.x ( a69e20...60645e )
by José
113:03 queued 73:51
created
main/inc/ajax/social.ajax.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
                     )
Please login to merge, or discard this patch.
main/inc/lib/social.lib.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
923 923
                 $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/invitations.php">'.Display::return_icon('invitation.png', get_lang('YouAlreadySentAnInvitation')).'&nbsp;&nbsp;'.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')).'&nbsp;'.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')).'&nbsp;'.get_lang('SendInvitation').'</a></li>';
927 927
                 }
928 928
             }
929 929
 
@@ -1035,10 +1035,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
main/inc/lib/surveymanager.lib.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -47,20 +47,20 @@  discard block
 block discarded – undo
47 47
         $res = Database::query($sql);
48 48
         $refs = array();
49 49
         $list = array();
50
-        $plain_array=array();
50
+        $plain_array = array();
51 51
 
52 52
         while ($survey = Database::fetch_array($res, 'ASSOC')) {
53
-            $plain_array[$survey['survey_id']]=$survey;
54
-            $surveys_parents[]=$survey['survey_version'];
55
-            $thisref = &$refs[ $survey['survey_id'] ];
53
+            $plain_array[$survey['survey_id']] = $survey;
54
+            $surveys_parents[] = $survey['survey_version'];
55
+            $thisref = &$refs[$survey['survey_id']];
56 56
             $thisref['parent_id'] = $survey['parent_id'];
57 57
             $thisref['name'] = $survey['name'];
58 58
             $thisref['id'] = $survey['survey_id'];
59 59
             $thisref['survey_version'] = $survey['survey_version'];
60 60
             if ($survey['parent_id'] == 0) {
61
-                $list[ $survey['survey_id'] ] = &$thisref;
61
+                $list[$survey['survey_id']] = &$thisref;
62 62
             } else {
63
-                $refs[ $survey['parent_id'] ]['children'][ $survey['survey_id'] ] = &$thisref;
63
+                $refs[$survey['parent_id']]['children'][$survey['survey_id']] = &$thisref;
64 64
             }
65 65
         }
66 66
         $this->surveylist = $list;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function getParentId($id)
80 80
     {
81 81
         $node = $this->plainsurveylist[$id];
82
-        if (is_array($node)&& !empty($node['parent_id'])) {
82
+        if (is_array($node) && !empty($node['parent_id'])) {
83 83
             return $node['parent_id'];
84 84
         } else {
85 85
             return -1;
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
         if (is_array($list)) {
100 100
             foreach ($list as $key => $node) {
101 101
                 if (isset($node['children']) && is_array($node['children'])) {
102
-                    $result[$key]= $node['name'];
102
+                    $result[$key] = $node['name'];
103 103
                     $re = self::createList($node['children']);
104 104
                     if (!empty($re)) {
105 105
                         if (is_array($re)) {
106 106
                             foreach ($re as $key => $r) {
107
-                                $result[$key] = '' . $r;
107
+                                $result[$key] = ''.$r;
108 108
                             }
109 109
                         } else {
110 110
                             $result[] = $re;
Please login to merge, or discard this patch.
main/survey/preview.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 						survey_question_option.c_id = $course_id
155 155
 					WHERE
156 156
 					    survey_question.survey_id = '".intval($survey_id)."' AND
157
-						survey_question.question_id IN (".Database::escape_string(implode(',',$paged_questions[$_GET['show']]), null, false).") AND
157
+						survey_question.question_id IN (".Database::escape_string(implode(',', $paged_questions[$_GET['show']]), null, false).") AND
158 158
 						survey_question.c_id =  $course_id
159 159
 					ORDER BY survey_question.sort, survey_question_option.sort ASC";
160 160
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
 	// Displaying the form with the questions
193 193
 	if (isset($_GET['show'])) {
194
-		$show = (int)$_GET['show'] + 1;
194
+		$show = (int) $_GET['show'] + 1;
195 195
 	} else {
196 196
 		$show = 0;
197 197
 	}
Please login to merge, or discard this patch.
main/forum/reply.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 $origin = '';
31 31
 if (isset($_GET['origin'])) {
32
-    $origin =  Security::remove_XSS($_GET['origin']);
32
+    $origin = Security::remove_XSS($_GET['origin']);
33 33
     $origin_string = '&origin='.$origin;
34 34
 }
35 35
 
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 require_once 'forumconfig.inc.php';
38 38
 require_once 'forumfunction.inc.php';
39 39
 
40
-$forumId = isset($_GET['forum']) ? (int)$_GET['forum'] : 0;
41
-$threadId = isset($_GET['thread']) ? (int)$_GET['thread'] : 0;
40
+$forumId = isset($_GET['forum']) ? (int) $_GET['forum'] : 0;
41
+$threadId = isset($_GET['thread']) ? (int) $_GET['thread'] : 0;
42 42
 
43 43
 /* MAIN DISPLAY SECTION */
44 44
 
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 // We are getting all the information about the current forum and forum category.
47 47
 // Note pcool: I tried to use only one sql statement (and function) for this,
48 48
 // but the problem is that the visibility of the forum AND forum cateogory are stored in the item_property table.
49
-$current_thread	= get_thread_information($threadId); // Note: This has to be validated that it is an existing thread.
50
-$current_forum	= get_forum_information($current_thread['forum_id']); // Note: This has to be validated that it is an existing forum.
49
+$current_thread = get_thread_information($threadId); // Note: This has to be validated that it is an existing thread.
50
+$current_forum = get_forum_information($current_thread['forum_id']); // Note: This has to be validated that it is an existing forum.
51 51
 $current_forum_category = get_forumcategory_information(Security::remove_XSS($current_forum['forum_category']));
52 52
 
53 53
 /* Is the user allowed here? */
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
 /* Breadcrumbs */
86 86
 
87 87
 $gradebook = null;
88
-if (isset($_SESSION['gradebook'])){
88
+if (isset($_SESSION['gradebook'])) {
89 89
     $gradebook = Security::remove_XSS($_SESSION['gradebook']);
90 90
 }
91 91
 
92 92
 if (!empty($gradebook) && $gradebook == 'view') {
93
-    $interbreadcrumb[] = array (
93
+    $interbreadcrumb[] = array(
94 94
         'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']),
95 95
         'name' => get_lang('ToolGradebook')
96 96
     );
Please login to merge, or discard this patch.
main/ticket/tutor_report.lib.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     $table_post = Database::get_course_table(TABLE_FORUM_POST);
22 22
     $table_work = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
23 23
     $course_code = Database::escape_string($course_code);
24
-    $res = Database::query("SELECT COUNT(*) as cant FROM $table_reporte_semanas WHERE course_code = '" . $course_code . "'");
24
+    $res = Database::query("SELECT COUNT(*) as cant FROM $table_reporte_semanas WHERE course_code = '".$course_code."'");
25 25
     $sqlWeeks = "SELECT semanas FROM $table_semanas_curso WHERE course_code = '$course_code'";
26 26
     $resWeeks = Database::query($sqlWeeks);
27 27
     $weeks = Database::fetch_object($resWeeks);
@@ -105,52 +105,52 @@  discard block
 block discarded – undo
105 105
     $lineHeaderExport = array(null, null);
106 106
     $lineHeaderExport2 = array(null, ull);
107 107
     while ($rowe = Database::fetch_assoc($resultHeader)) {
108
-        $lineHeaderExport[] = utf8_decode('Work' . $rowe['week_id']);
109
-        $lineHeaderExport[] = utf8_decode('Forum' . $rowe['week_id']);
108
+        $lineHeaderExport[] = utf8_decode('Work'.$rowe['week_id']);
109
+        $lineHeaderExport[] = utf8_decode('Forum'.$rowe['week_id']);
110 110
         //$fila_export_encabezado[] =  utf8_decode('Eval'.$rowe['week_id']);
111 111
         //$fila_export_encabezado[] =  utf8_decode('PC'.$rowe['week_id']);
112 112
         $lineHeaderExport2[] = utf8_decode($rowe['work_title']);
113 113
         $lineHeaderExport2[] = utf8_decode($rowe['thread_title']);
114 114
         //$fila_export_encabezado2[] = utf8_decode($rowe['eval_title']);
115 115
         //$fila_export_encabezado2[] = utf8_decode($rowe['pc_title']);
116
-        $fila_export = array('Work' . $rowe['week_id'], 'Forum' . $rowe['week_id'], 'Eval' . $rowe['week_id'], 'PC' . $rowe['week_id']);
116
+        $fila_export = array('Work'.$rowe['week_id'], 'Forum'.$rowe['week_id'], 'Eval'.$rowe['week_id'], 'PC'.$rowe['week_id']);
117 117
         if ($rowe['week_id'] > (($page - 1) * 7) && $rowe['week_id'] <= (7 * $page)) {
118 118
             $ids[$rowe['week_id']] = $rowe['id'];
119
-            $line.='<th>
120
-                <a href="#" onClick="showContent(' . "'tarea" . $rowe['week_id'] . "'" . ');">Work' . $rowe['week_id'] . '
121
-                        <div class="blackboard_hide" id="tarea' . $rowe['week_id'] . '">' . $rowe['work_title'] . '</div>
119
+            $line .= '<th>
120
+                <a href="#" onClick="showContent(' . "'tarea".$rowe['week_id']."'".');">Work'.$rowe['week_id'].'
121
+                        <div class="blackboard_hide" id="tarea' . $rowe['week_id'].'">'.$rowe['work_title'].'</div>
122 122
                 </a></th>';
123
-            $line.= '<th>
124
-                <a href="#" onClick="showContent(' . "'foro" . $rowe['week_id'] . "'" . ');">Forum' . $rowe['week_id'] . '
125
-                        <div class="blackboard_hide" id="foro' . $rowe['week_id'] . '">' . $rowe['thread_title'] . '</div>
123
+            $line .= '<th>
124
+                <a href="#" onClick="showContent(' . "'foro".$rowe['week_id']."'".');">Forum'.$rowe['week_id'].'
125
+                        <div class="blackboard_hide" id="foro' . $rowe['week_id'].'">'.$rowe['thread_title'].'</div>
126 126
                 </a>
127 127
                 </th>';
128 128
         }
129 129
     }
130 130
     $tableExport[] = $lineHeaderExport;
131 131
     $tableExport[] = $lineHeaderExport2;
132
-    $line.= '</tr>';
132
+    $line .= '</tr>';
133 133
 
134 134
     $html = '<form action="tutor.php" name="semanas" id="semanas" method="POST">
135 135
             <div class="row">
136
-            ' . get_lang('SelectWeeksSpan') . '
136
+            ' . get_lang('SelectWeeksSpan').'
137 137
             <select name="weeksNumber" id="weeksNumber" onChange="submit();">
138
-            <option value="7" ' . (($weeksCount == 7) ? 'selected="selected"' : "") . '>7 weeks</option>
139
-            <option value="14" ' . (($weeksCount == 14) ? 'selected="selected"' : "") . '>14 weeks</option>
138
+            <option value="7" ' . (($weeksCount == 7) ? 'selected="selected"' : "").'>7 weeks</option>
139
+            <option value="14" ' . (($weeksCount == 14) ? 'selected="selected"' : "").'>14 weeks</option>
140 140
             </select>';
141 141
 
142 142
 
143 143
     if ($weeksCount == 14) {
144
-        $html .= '<span style="float:right;"><a href="tutor.php?page=' . (($page == 1) ? 2 : 1) . '">' . (($page == 1) ? "Siguiente" : "Anterior") . '</a></span>';
144
+        $html .= '<span style="float:right;"><a href="tutor.php?page='.(($page == 1) ? 2 : 1).'">'.(($page == 1) ? "Siguiente" : "Anterior").'</a></span>';
145 145
     }
146
-    $html .= '<span style="float:right;"><a href="' . api_get_self() . '?action=export' . $get_parameter . $get_parameter2 . '">' . Display::return_icon('export_excel.png', get_lang('Export'), '', '32') . '</a></span>';
146
+    $html .= '<span style="float:right;"><a href="'.api_get_self().'?action=export'.$get_parameter.$get_parameter2.'">'.Display::return_icon('export_excel.png', get_lang('Export'), '', '32').'</a></span>';
147 147
 
148 148
     $html .= '</form>';
149 149
     $html .= '<table class="reports">';
150 150
     $html .= '<tr>
151 151
             <th ></th>';
152 152
     for ($i = (7 * $page - 6); $i <= $page * 7; $i++) {
153
-        $html .= '<th colspan="2">Week ' . $i . '<a href="assign_tickets.php?id=' . $ids[$i] . '" class="ajax">' . Display::return_icon('edit.png', get_lang('Edit'), array('width' => '16', 'height' => '16'), 22) . '</a></th>';
153
+        $html .= '<th colspan="2">Week '.$i.'<a href="assign_tickets.php?id='.$ids[$i].'" class="ajax">'.Display::return_icon('edit.png', get_lang('Edit'), array('width' => '16', 'height' => '16'), 22).'</a></th>';
154 154
     }
155 155
     $html .= '</tr>';
156 156
     $html .= $line;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         if ($row['week_id'] > (($page - 1) * 7) && $row['week_id'] <= (7 * $page)) {
168 168
             $results[$row['username']][$row['week_id']] = $row;
169 169
             if (count($results[$row['username']]) == 7) {
170
-                $html.= showStudentResult($results[$row['username']], $page);
170
+                $html .= showStudentResult($results[$row['username']], $page);
171 171
             }
172 172
         }
173 173
         if (count($resultadose[$row['username']]) == $weeksCount) {
@@ -190,12 +190,12 @@  discard block
 block discarded – undo
190 190
     $inicio = (7 * $pagina - 6);
191 191
     $fila = '<tr>';
192 192
 
193
-    $fila.= '<td><a href="' . api_get_path(WEB_CODE_PATH) . 'user/userInfo.php?' . api_get_cidreq() . '&uInfo=' . $datos[$inicio]['user_id'] . '">' . $datos[$inicio]['username'] . '</a></td>';
193
+    $fila .= '<td><a href="'.api_get_path(WEB_CODE_PATH).'user/userInfo.php?'.api_get_cidreq().'&uInfo='.$datos[$inicio]['user_id'].'">'.$datos[$inicio]['username'].'</a></td>';
194 194
     foreach ($datos as $dato) {
195
-        $fila.= '<td align="center">' . (($dato['work_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')) . '</td>';
196
-        $fila.= '<td align="center">' . (($dato['thread_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')) . '</td>';
195
+        $fila .= '<td align="center">'.(($dato['work_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')).'</td>';
196
+        $fila .= '<td align="center">'.(($dato['thread_ok'] == 1) ? Display::return_icon('check.png') : Display::return_icon('aspa.png')).'</td>';
197 197
     }
198
-    $fila.= '</tr>';
198
+    $fila .= '</tr>';
199 199
     return $fila;
200 200
 }
201 201
 
Please login to merge, or discard this patch.
main/ticket/assign_tickets.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 echo '<div id="confirmation"></div>';
21 21
 $id = intval($_GET['id']);
22 22
 $tblWeeklyReport = Database::get_main_table('rp_reporte_semanas');
23
-$sql ="SELECT * FROM $tblWeeklyReport WHERE id = '$id'";
23
+$sql = "SELECT * FROM $tblWeeklyReport WHERE id = '$id'";
24 24
 $sql_tasks = "SELECT id AS colid, title as coltitle
25 25
     FROM ".Database::get_course_table(TABLE_STUDENT_PUBLICATION)."
26 26
     WHERE parent_id = 0
@@ -45,28 +45,28 @@  discard block
 block discarded – undo
45 45
 $result_forum = Database::query($sql_forum);
46 46
 
47 47
 echo '<div class="row">
48
-        <input type="hidden" id="rs_id" name ="rs_id" value="' . $id . '">
49
-        <div class="formw">' . get_lang('PleaseSelectTasks') . '</div>
48
+        <input type="hidden" id="rs_id" name ="rs_id" value="' . $id.'">
49
+        <div class="formw">' . get_lang('PleaseSelectTasks').'</div>
50 50
     </div>';
51 51
 echo '<div class="row"><div class="formw"><select name ="work_id" id="work_id">';
52
-echo '<option value="0"' . (($row['colid'] == $rs->work_id) ? "selected" : "") . '>' . get_lang('PleaseSelect') . '</option>';
52
+echo '<option value="0"'.(($row['colid'] == $rs->work_id) ? "selected" : "").'>'.get_lang('PleaseSelect').'</option>';
53 53
 while ($row = Database::fetch_assoc($result_tasks)) {
54
-    echo '<option value="' . $row['colid'] . '"' . (($row['colid'] == $rs->work_id) ? "selected" : "") . '>' . $row['coltitle'] . '</option>';
54
+    echo '<option value="'.$row['colid'].'"'.(($row['colid'] == $rs->work_id) ? "selected" : "").'>'.$row['coltitle'].'</option>';
55 55
 }
56 56
 echo '</select></div><div>';
57 57
 echo '<div class="row">
58
-        <div class="formw">' . get_lang('PleaseSelectThread') . '</div>
58
+        <div class="formw">' . get_lang('PleaseSelectThread').'</div>
59 59
     </div>';
60 60
 echo '<div class="row"><div class="formw"><select name ="forum_id" id="forum_id">';
61
-echo '<option value="0"' . (($row['colid'] == $rs->work_id) ? "forum_id" : "") . '>' . get_lang('PleaseSelect') . '</option>';
61
+echo '<option value="0"'.(($row['colid'] == $rs->work_id) ? "forum_id" : "").'>'.get_lang('PleaseSelect').'</option>';
62 62
 while ($row = Database::fetch_assoc($result_forum)) {
63
-    echo '<option value="' . $row['colid'] . '"' . (($row['colid'] == $rs->forum_id) ? "selected" : "") . '>' . $row['coltitle'] . '</option>';
63
+    echo '<option value="'.$row['colid'].'"'.(($row['colid'] == $rs->forum_id) ? "selected" : "").'>'.$row['coltitle'].'</option>';
64 64
 }
65 65
 echo '</select></div><div>';
66 66
 echo '<div class="row">
67 67
         <div class="formw">
68
-        <button class="save" name="edit" type="button" value="' . get_lang('Edit') . '" onClick="save(' . "$id" . ');">' .
69
-            get_lang('Edit') . '</button>
68
+        <button class="save" name="edit" type="button" value="' . get_lang('Edit').'" onClick="save('."$id".');">'.
69
+            get_lang('Edit').'</button>
70 70
         </div>
71 71
     </div>';
72 72
 echo '</form>';
Please login to merge, or discard this patch.
main/ticket/tutor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
         var url     = this.href;
18 18
         var dialog  = $("#dialog");
19 19
         if ($("#dialog").length == 0) {
20
-                dialog  = $("' . '<div id="dialog" style="display:hidden"></div>' . '").appendTo("body");
20
+                dialog  = $("' . '<div id="dialog" style="display:hidden"></div>'.'").appendTo("body");
21 21
         }
22 22
 
23 23
         // load remote content
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 $.ajax({
57 57
 		contentType: "application/x-www-form-urlencoded",
58 58
 		beforeSend: function(objeto) {
59
-		$("div#confirmation").html("<img src=\"' . api_get_path(WEB_LIBRARY_PATH) . 'javascript/indicator.gif\" />"); },
59
+		$("div#confirmation").html("<img src=\"' . api_get_path(WEB_LIBRARY_PATH).'javascript/indicator.gif\" />"); },
60 60
 		type: "POST",
61 61
 		url: "update_report.php",
62 62
 		data: "work_id="+work_id+"&forum_id="+forum_id+"&rs_id="+rs_id,
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 $course_code = api_get_course_id();
96 96
 $results = initializeReport($course_code);
97 97
 if (isset($_GET['action'])) {
98
-    Export::arrayToXls($results['export'], "COURSE_USER_REPORT" . $course_code);
98
+    Export::arrayToXls($results['export'], "COURSE_USER_REPORT".$course_code);
99 99
 } else {
100 100
     Display::display_header();
101 101
     api_protect_course_script();
Please login to merge, or discard this patch.
main/ticket/download.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
 $file_url = Database::escape_string($file_url);
43 43
 $title = $_GET['title'];
44 44
 $path_attachment = api_get_path(SYS_ARCHIVE_PATH);
45
-$path_message_attach = $path_attachment . 'plugin_ticket_messageattch/';
46
-$full_file_name = $path_message_attach . $file_url;
45
+$path_message_attach = $path_attachment.'plugin_ticket_messageattch/';
46
+$full_file_name = $path_message_attach.$file_url;
47 47
 if (Security::check_abs_path($full_file_name, $path_message_attach)) {
48 48
     DocumentManager::file_send_for_download($full_file_name, true, $title);
49 49
 }
Please login to merge, or discard this patch.