Completed
Push — 1.10.x ( 501d19...0db498 )
by Yannick
89:35 queued 49:03
created
main/inc/lib/skill.visualizer.lib.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -30,6 +30,9 @@
 block discarded – undo
30 30
         $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2);
31 31
     }
32 32
 
33
+    /**
34
+     * @param string $class
35
+     */
33 36
     function prepare_skill_box($skill, $position, $class)
34 37
     {
35 38
         $block_id = $skill['id'];
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $this->skills   = $skills;
29 29
         $this->type     = $type;
30
-        $this->center_x = intval($offset_x + $this->canvas_x/2 - $this->block_size/2);
30
+        $this->center_x = intval($offset_x + $this->canvas_x / 2 - $this->block_size / 2);
31 31
     }
32 32
 
33 33
     function prepare_skill_box($skill, $position, $class)
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
             $extra_class = 'second_window';
40 40
         }
41 41
 
42
-        $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.'  '.$class.'" style = "top:' . $position['y'] . 'px; left:' . $position['x'] . 'px;">';
42
+        $this->html .= '<div id="block_'.$block_id.'" class = "open_block window '.$extra_class.'  '.$class.'" style = "top:'.$position['y'].'px; left:'.$position['x'].'px;">';
43 43
 
44
-        $content =  $skill['name'];
44
+        $content = $skill['name'];
45 45
         $content .= '<div class="btn-group">';
46 46
         $content .= Display::url(get_lang('Edit'), '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn'));
47 47
         $content .= Display::url('+', '#', array('id'=>'edit_block_'.$block_id, 'class'=>'edit_block btn'));
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
         }
88 88
         //default_arrow_color
89 89
 
90
-        $this->js .= 'var e'.$block_id.' = prepare("block_' . $block_id.'",  '.$end_point.');'."\n";
91
-        $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_' . $skill['parent_id'].'",  '.$end_point.');'."\n";
92
-        $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n";;
90
+        $this->js .= 'var e'.$block_id.' = prepare("block_'.$block_id.'",  '.$end_point.');'."\n";
91
+        $this->js .= 'var e'.$skill['parent_id'].' = prepare("block_'.$skill['parent_id'].'",  '.$end_point.');'."\n";
92
+        $this->js .= 'jsPlumb.connect({source: e'.$block_id.', target:e'.$skill['parent_id'].'});'."\n"; ;
93 93
     }
94 94
 
95 95
     /**
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
         $brothers = array();
126 126
 
127 127
         foreach ($this->skills as &$skill) {
128
-            if (!in_array($skill['parent_id'], array(0,1))) {
128
+            if (!in_array($skill['parent_id'], array(0, 1))) {
129 129
                 continue;
130 130
             }
131
-            $childs = isset($skill['children']) ? count($skill['children']) : 0 ;
131
+            $childs = isset($skill['children']) ? count($skill['children']) : 0;
132 132
 
133 133
             //$x = round($this->offsetX * sin(deg2rad($corner * $count)));
134 134
             //$y = round($this->offsetY * cos(deg2rad($corner * $count)));
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
             if ($skill['parent_id'] == 0) {
145 145
                 //$x = 130*$childs/2;
146 146
                 //$x = $this->space_between_blocks_x*$childs/2;
147
-                $x = $this->canvas_x/2  - $this->block_size/2;
147
+                $x = $this->canvas_x / 2 - $this->block_size / 2;
148 148
             } else {
149 149
                 $max = isset($this->skills[$skill['parent_id']]['children']) ? count($this->skills[$skill['parent_id']]['children']) : 0;
150
-                foreach($this->skills[$skill['parent_id']]['children'] as  $id => $sk) {
150
+                foreach ($this->skills[$skill['parent_id']]['children'] as  $id => $sk) {
151 151
                     if ($skill['id'] == $sk['id']) {
152 152
                         break;
153 153
                     }
@@ -155,17 +155,17 @@  discard block
 block discarded – undo
155 155
                 }
156 156
                 $parent_x = isset($this->skills[$skill['parent_id']]['x']) ? $this->skills[$skill['parent_id']]['x'] : 0;
157 157
                 //$x = $my_count*$this->space_between_blocks_x + $parent_x  + $this->block_size - ($this->space_between_blocks_x*$max/2) ;
158
-                $x = $my_count*$this->space_between_blocks_x + $parent_x  + $this->block_size - ($this->canvas_x/2 ) ;
158
+                $x = $my_count * $this->space_between_blocks_x + $parent_x + $this->block_size - ($this->canvas_x / 2);
159 159
             }
160 160
 
161
-            $y = $skill['level']*$this->space_between_blocks_y;
161
+            $y = $skill['level'] * $this->space_between_blocks_y;
162 162
 
163 163
             $skill['x'] = $x;
164 164
             $skill['y'] = $y;
165 165
 
166 166
             //$skill['description']  = "{$brothers[$skill['parent_id']]} $x - $y";
167 167
             //$skill['name']  =  $skill['name']."  |  $x = $my_count * 150  +  $parent_x - (150* $max/2) - 10*$childs ";
168
-            $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y +$y));
168
+            $this->add_item($skill, array('x' => $this->offset_x + $x, 'y' => $this->offset_y + $y));
169 169
         }
170 170
         return $this->get_html();
171 171
     }
Please login to merge, or discard this patch.
main/inc/lib/social.lib.php 4 patches
Doc Comments   +14 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,6 +63,8 @@  discard block
 block discarded – undo
63 63
      * @param int user id
64 64
      * @param int user friend id
65 65
      * @param string
66
+     * @param integer $user_id
67
+     * @param integer $user_friend
66 68
      * @author isaac flores paz
67 69
      */
68 70
     public static function get_relation_between_contacts($user_id, $user_friend)
@@ -94,6 +96,8 @@  discard block
 block discarded – undo
94 96
      * @param int group id
95 97
      * @param string name to search
96 98
      * @param bool true will load firstname, lastname, and image name
99
+     * @param integer $user_id
100
+     * @param integer $id_group
97 101
      * @return array
98 102
      * @author Julio Montoya <[email protected]> Cleaning code, function renamed, $load_extra_info option added
99 103
      * @author isaac flores paz
@@ -170,6 +174,9 @@  discard block
 block discarded – undo
170 174
      * @param int user friend id
171 175
      * @param string title of the message
172 176
      * @param string content of the message
177
+     * @param integer $user_id
178
+     * @param string $message_title
179
+     * @param string $message_content
173 180
      * @return boolean
174 181
      * @author isaac flores paz
175 182
      * @author Julio Montoya <[email protected]> Cleaning code
@@ -241,6 +248,7 @@  discard block
 block discarded – undo
241 248
      * Get number messages of the inbox
242 249
      * @author isaac flores paz
243 250
      * @param int user receiver id
251
+     * @param integer $user_receiver_id
244 252
      * @return int
245 253
      */
246 254
     public static function get_message_number_invitation_by_user_id($user_receiver_id)
@@ -283,6 +291,7 @@  discard block
 block discarded – undo
283 291
      * Get invitation list sent by user
284 292
      * @author Julio Montoya <[email protected]>
285 293
      * @param int user id
294
+     * @param integer $user_id
286 295
      * @return array()
287 296
      */
288 297
     public static function get_list_invitation_sent_by_user_id($user_id)
@@ -325,6 +334,7 @@  discard block
 block discarded – undo
325 334
      * Denies invitation
326 335
      * @param int user sender id
327 336
      * @param int user receiver id
337
+     * @param integer $user_receiver_id
328 338
      * @author isaac flores paz
329 339
      * @author Julio Montoya <[email protected]> Cleaning code
330 340
      */
@@ -360,7 +370,7 @@  discard block
 block discarded – undo
360 370
      * @author Isaac Flores Paz <[email protected]>
361 371
      * @author Julio Montoya <[email protected]> Cleaning code
362 372
      * @param void
363
-     * @return string message invitation
373
+     * @return false|null message invitation
364 374
      */
365 375
     public static function send_invitation_friend_user($userfriend_id, $subject_message = '', $content_message = '')
366 376
     {
@@ -1229,7 +1239,7 @@  discard block
 block discarded – undo
1229 1239
      * @param string $messageContent of the message
1230 1240
      * @param int $messageId id parent
1231 1241
      * @param string $messageStatus status type of message
1232
-     * @return boolean
1242
+     * @return false|string
1233 1243
      * @author Yannick Warnier
1234 1244
      */
1235 1245
     public static function sendWallMessage($userId, $friendId, $messageContent, $messageId = 0, $messageStatus = '')
@@ -1318,7 +1328,7 @@  discard block
 block discarded – undo
1318 1328
      * Gets all messages from someone's wall (within specific limits)
1319 1329
      * @param int $userId id of wall shown
1320 1330
      * @param string $messageStatus status wall message
1321
-     * @param int|string $parentId id message (Post main)
1331
+     * @param integer|null $parentId id message (Post main)
1322 1332
      * @param date $start Date from which we want to show the messages, in UTC time
1323 1333
      * @param int $limit Limit for the number of parent messages we want to show
1324 1334
      * @param int $offset Wall message query offset
@@ -1647,7 +1657,7 @@  discard block
 block discarded – undo
1647 1657
     /**
1648 1658
     * Delete messages delete logic
1649 1659
     * @param int $id id message to delete.
1650
-    * @return bool status query
1660
+    * @return Statement|null status query
1651 1661
     */
1652 1662
     public static function deleteMessage($id)
1653 1663
     {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         if ($course_visibility != COURSE_VISIBILITY_HIDDEN &&
511 511
             ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER)
512 512
         ) {
513
-           $result .= '<span class="title">' . $course_title . '<span>';
513
+            $result .= '<span class="title">' . $course_title . '<span>';
514 514
         } else {
515 515
             $result .= $course_title." "." ".get_lang('CourseClosed')."";
516 516
         }
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
             }
1415 1415
             $media .= '<div class="user-image">';
1416 1416
             $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] .
1417
-                       '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1417
+                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1418 1418
             $media .= '</div>';
1419 1419
             $media .= '<div class="user-data">';
1420 1420
             $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a></div>';
@@ -1645,10 +1645,10 @@  discard block
 block discarded – undo
1645 1645
         return $name;
1646 1646
     }
1647 1647
     /**
1648
-    * Delete messages delete logic
1649
-    * @param int $id id message to delete.
1650
-    * @return bool status query
1651
-    */
1648
+     * Delete messages delete logic
1649
+     * @param int $id id message to delete.
1650
+     * @return bool status query
1651
+     */
1652 1652
     public static function deleteMessage($id)
1653 1653
     {
1654 1654
         $id = intval($id);
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1631,11 +1631,11 @@  discard block
 block discarded – undo
1631 1631
 
1632 1632
             if ($size == IMAGE_WALL_SMALL) {
1633 1633
                 $name = IMAGE_WALL_SMALL. '_' . $array[2];
1634
-            }else if($size == IMAGE_WALL_MEDIUM){
1634
+            } else if($size == IMAGE_WALL_MEDIUM){
1635 1635
                 $name = IMAGE_WALL_MEDIUM. '_' . $array[2];
1636
-            }else if($size == IMAGE_WALL_BIG){
1636
+            } else if($size == IMAGE_WALL_BIG){
1637 1637
                 $name = IMAGE_WALL_BIG. '_' . $array[2];
1638
-            }else {
1638
+            } else {
1639 1639
                 $name = IMAGE_WALL_SMALL. '_' . $array[2];
1640 1640
             }
1641 1641
             $lessImage = str_replace($array[2], '', $path);
@@ -1759,7 +1759,9 @@  discard block
 block discarded – undo
1759 1759
             $friendHtml.= '<ul class="nav nav-list">';
1760 1760
             $j = 1;
1761 1761
             for ($k=0; $k < $number_friends; $k++) {
1762
-                if ($j > $number_of_images) break;
1762
+                if ($j > $number_of_images) {
1763
+                    break;
1764
+                }
1763 1765
 
1764 1766
                 if (isset($friends[$k])) {
1765 1767
                     $friend = $friends[$k];
@@ -1815,7 +1817,9 @@  discard block
 block discarded – undo
1815 1817
             $friendHtml.= '<div class="list-group">';
1816 1818
             $j = 1;
1817 1819
             for ($k=0; $k < $number_friends; $k++) {
1818
-                if ($j > $number_of_images) break;
1820
+                if ($j > $number_of_images) {
1821
+                    break;
1822
+                }
1819 1823
 
1820 1824
                 if (isset($friends[$k])) {
1821 1825
                     $friend = $friends[$k];
Please login to merge, or discard this patch.
Spacing   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -109,12 +109,12 @@  discard block
 block discarded – undo
109 109
                     friend_user_id<>'.((int) $user_id).' AND
110 110
                     user_id='.((int) $user_id);
111 111
         if (isset($id_group) && $id_group > 0) {
112
-            $sql.=' AND relation_type='.$id_group;
112
+            $sql .= ' AND relation_type='.$id_group;
113 113
         }
114 114
         if (isset($search_name)) {
115 115
             $search_name = trim($search_name);
116 116
             $search_name = str_replace(' ', '', $search_name);
117
-            $sql.=' AND friend_user_id IN (
117
+            $sql .= ' AND friend_user_id IN (
118 118
                 SELECT user_id FROM '.$tbl_my_user.'
119 119
                 WHERE
120 120
                     firstName LIKE "%'.Database::escape_string($search_name).'%" OR
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 
369 369
         $user_info = api_get_user_info($userfriend_id);
370 370
         $succes = get_lang('MessageSentTo');
371
-        $succes.= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']);
371
+        $succes .= ' : '.api_get_person_name($user_info['firstName'], $user_info['lastName']);
372 372
 
373 373
         if (isset($subject_message) && isset($content_message) && isset($userfriend_id)) {
374 374
             $send_message = MessageManager::send_message($userfriend_id, $subject_message, $content_message);
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         $user_in_course_status = CourseManager :: get_user_in_course_status(api_get_user_id(), $course_code);
486 486
 
487 487
         //$valor = api_get_settings_params();
488
-        $course_path = api_get_path(SYS_COURSE_PATH).$course_directory;   // course path
488
+        $course_path = api_get_path(SYS_COURSE_PATH).$course_directory; // course path
489 489
         if (api_get_setting('course_images_in_courses_list') === 'true') {
490 490
             if (file_exists($course_path.'/course-pic85x85.png')) {
491 491
                 $image = $my_course['course_info']['course_image'];
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
         if ($course_visibility != COURSE_VISIBILITY_HIDDEN &&
511 511
             ($course_visibility != COURSE_VISIBILITY_CLOSED || $user_in_course_status == COURSEMANAGER)
512 512
         ) {
513
-           $result .= '<span class="title">' . $course_title . '<span>';
513
+           $result .= '<span class="title">'.$course_title.'<span>';
514 514
         } else {
515 515
             $result .= $course_title." "." ".get_lang('CourseClosed')."";
516 516
         }
@@ -729,57 +729,57 @@  discard block
 block discarded – undo
729 729
             $links = '<ul class="nav nav-pills nav-stacked">';
730 730
             $active = $show == 'home' ? 'active' : null;
731 731
             $links .= '
732
-                <li class="home-icon ' . $active . '">
733
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
734
-                        ' . $homeIcon . ' ' . get_lang('Home') . '
732
+                <li class="home-icon ' . $active.'">
733
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php">
734
+                        ' . $homeIcon.' '.get_lang('Home').'
735 735
                     </a>
736 736
                 </li>';
737 737
             $active = $show == 'messages' ? 'active' : null;
738 738
             $links .= '
739
-                <li class="messages-icon ' . $active . '">
740
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
741
-                        ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
739
+                <li class="messages-icon ' . $active.'">
740
+                    <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social">
741
+                        ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.'
742 742
                     </a>
743 743
                 </li>';
744 744
 
745 745
             //Invitations
746 746
             $active = $show == 'invitations' ? 'active' : null;
747 747
             $links .= '
748
-                <li class="invitations-icon ' . $active . '">
749
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
750
-                        ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
748
+                <li class="invitations-icon ' . $active.'">
749
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php">
750
+                        ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.'
751 751
                     </a>
752 752
                 </li>';
753 753
 
754 754
             //Shared profile and groups
755 755
             $active = $show == 'shared_profile' ? 'active' : null;
756 756
             $links .= '
757
-                <li class="shared-profile-icon' . $active . '">
758
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
759
-                        ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
757
+                <li class="shared-profile-icon' . $active.'">
758
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php">
759
+                        ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').'
760 760
                     </a>
761 761
                 </li>';
762 762
             $active = $show == 'friends' ? 'active' : null;
763 763
             $links .= '
764
-                <li class="friends-icon ' . $active . '">
765
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
766
-                        ' . $friendsIcon . ' ' . get_lang('Friends') . '
764
+                <li class="friends-icon ' . $active.'">
765
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php">
766
+                        ' . $friendsIcon.' '.get_lang('Friends').'
767 767
                     </a>
768 768
                 </li>';
769 769
             $active = $show == 'browse_groups' ? 'active' : null;
770 770
             $links .= '
771
-                <li class="browse-groups-icon ' . $active . '">
772
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
773
-                        ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
771
+                <li class="browse-groups-icon ' . $active.'">
772
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php">
773
+                        ' . $groupsIcon.' '.get_lang('SocialGroups').'
774 774
                     </a>
775 775
                 </li>';
776 776
 
777 777
             //Search users
778 778
             $active = $show == 'search' ? 'active' : null;
779 779
             $links .= '
780
-                <li class="search-icon ' . $active . '">
781
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
782
-                        ' . $searchIcon . ' ' . get_lang('Search') . '
780
+                <li class="search-icon ' . $active.'">
781
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php">
782
+                        ' . $searchIcon.' '.get_lang('Search').'
783 783
                     </a>
784 784
                 </li>';
785 785
 
@@ -787,9 +787,9 @@  discard block
 block discarded – undo
787 787
             $active = $show == 'myfiles' ? 'active' : null;
788 788
 
789 789
             $myFiles = '
790
-                <li class="myfiles-icon ' . $active . '">
791
-                    <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
792
-                        ' . $filesIcon . ' ' . get_lang('MyFiles') . '
790
+                <li class="myfiles-icon ' . $active.'">
791
+                    <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php">
792
+                        ' . $filesIcon.' '.get_lang('MyFiles').'
793 793
                     </a>
794 794
                 </li>';
795 795
 
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
             }
799 799
             $links .= $myFiles;
800 800
 
801
-            $links .='</ul>';
801
+            $links .= '</ul>';
802 802
             
803 803
             $html .= Display::panelCollapse(
804 804
                     get_lang('SocialNetwork'),
@@ -819,57 +819,57 @@  discard block
 block discarded – undo
819 819
         }
820 820
 
821 821
         if ($show == 'shared_profile') {
822
-            $links =  '<ul class="nav nav-pills nav-stacked">';
822
+            $links = '<ul class="nav nav-pills nav-stacked">';
823 823
             // My own profile
824 824
             if ($show_full_profile && $user_id == intval(api_get_user_id())) {
825 825
                 $links .= '
826
-                    <li class="home-icon ' . $active . '">
827
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/home.php">
828
-                            ' . $homeIcon . ' ' . get_lang('Home') . '
826
+                    <li class="home-icon ' . $active.'">
827
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/home.php">
828
+                            ' . $homeIcon.' '.get_lang('Home').'
829 829
                         </a>
830 830
                     </li>
831
-                    <li class="messages-icon ' . $active . '">
832
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'messages/inbox.php?f=social">
833
-                            ' . $messagesIcon . ' ' . get_lang('Messages') . $count_unread_message . '
831
+                    <li class="messages-icon ' . $active.'">
832
+                        <a href="' . api_get_path(WEB_CODE_PATH).'messages/inbox.php?f=social">
833
+                            ' . $messagesIcon.' '.get_lang('Messages').$count_unread_message.'
834 834
                         </a>
835 835
                     </li>';
836 836
                 $active = $show == 'invitations' ? 'active' : null;
837 837
                 $links .= '
838
-                    <li class="invitations-icon' . $active . '">
839
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/invitations.php">
840
-                            ' . $invitationsIcon . ' ' . get_lang('Invitations') . $total_invitations . '
838
+                    <li class="invitations-icon' . $active.'">
839
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/invitations.php">
840
+                            ' . $invitationsIcon.' '.get_lang('Invitations').$total_invitations.'
841 841
                         </a>
842 842
                     </li>';
843 843
 
844 844
                 $links .= '
845 845
                     <li class="shared-profile-icon active">
846
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/profile.php">
847
-                            ' . $sharedProfileIcon . ' ' . get_lang('ViewMySharedProfile') . '
846
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/profile.php">
847
+                            ' . $sharedProfileIcon.' '.get_lang('ViewMySharedProfile').'
848 848
                         </a>
849 849
                     </li>
850 850
                     <li class="friends-icon">
851
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/friends.php">
852
-                            ' . $friendsIcon . ' ' . get_lang('Friends') . '
851
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/friends.php">
852
+                            ' . $friendsIcon.' '.get_lang('Friends').'
853 853
                         </a>
854 854
                     </li>
855 855
                     <li class="browse-groups-icon">
856
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/groups.php">
857
-                            ' . $groupsIcon . ' ' . get_lang('SocialGroups') . '
856
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/groups.php">
857
+                            ' . $groupsIcon.' '.get_lang('SocialGroups').'
858 858
                         </a>
859 859
                     </li>';
860 860
                 $active = $show == 'search' ? 'active' : null;
861 861
                 $links .= '
862
-                    <li class="search-icon ' . $active . '">
863
-                        <a href="' . api_get_path(WEB_CODE_PATH) . 'social/search.php">
864
-                            ' . $searchIcon . ' ' . get_lang('Search') . '
862
+                    <li class="search-icon ' . $active.'">
863
+                        <a href="' . api_get_path(WEB_CODE_PATH).'social/search.php">
864
+                            ' . $searchIcon.' '.get_lang('Search').'
865 865
                         </a>
866 866
                     </li>';
867 867
                 $active = $show == 'myfiles' ? 'active' : null;
868 868
 
869 869
                 $myFiles = '
870
-                    <li class="myfiles-icon ' . $active . '">
871
-                     <a href="' . api_get_path(WEB_CODE_PATH) . 'social/myfiles.php">
872
-                            ' . $filesIcon . ' ' . get_lang('MyFiles') . '
870
+                    <li class="myfiles-icon ' . $active.'">
871
+                     <a href="' . api_get_path(WEB_CODE_PATH).'social/myfiles.php">
872
+                            ' . $filesIcon.' '.get_lang('MyFiles').'
873 873
                         </a>
874 874
                     </li>';
875 875
 
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
                 $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>';
916 916
             } else {
917 917
                 if (!$show_full_profile) {
918
-                    $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>';
918
+                    $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>';
919 919
                 }
920 920
             }
921 921
 
@@ -1027,10 +1027,10 @@  discard block
 block discarded – undo
1027 1027
         foreach ($user_list as $uid) {
1028 1028
             $user_info = api_get_user_info($uid, $checkIfUserOnline = true);
1029 1029
             $lastname = $user_info['lastname'];
1030
-            $firstname =  $user_info['firstname'];
1030
+            $firstname = $user_info['firstname'];
1031 1031
             $completeName = $firstname.', '.$lastname;
1032 1032
 
1033
-            $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);
1033
+            $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);
1034 1034
             $status_icon_chat = null;
1035 1035
             if ($user_info['user_is_online_in_chat'] == 1) {
1036 1036
                 $status_icon_chat = Display::return_icon('online.png', get_lang('Online'));
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
             $officialCode = '<div class="items-user-official-code"><p style="min-height: 30px;" title="'.get_lang('OfficialCode').'">'.$user_info['official_code'].'</p></div>';
1043 1043
             $img = '<img class="img-responsive img-circle" title="'.$completeName.'" alt="'.$completeName.'" src="'.$userPicture.'">';
1044 1044
 
1045
-            $url =  null;
1045
+            $url = null;
1046 1046
             // Anonymous users can't have access to the profile
1047 1047
             if (!api_is_anonymous()) {
1048 1048
                 if (api_get_setting('allow_social_tool') == 'true') {
@@ -1209,13 +1209,13 @@  discard block
 block discarded – undo
1209 1209
             case SOCIAL_CENTER_PLUGIN:
1210 1210
                 $social_plugins = array(1, 2);
1211 1211
                 if (is_array($social_plugins) && count($social_plugins) > 0) {
1212
-                    $content.= '<div id="social-plugins">';
1212
+                    $content .= '<div id="social-plugins">';
1213 1213
                     foreach ($social_plugins as $plugin) {
1214
-                        $content.= '<div class="social-plugin-item">';
1215
-                        $content.= $plugin;
1216
-                        $content.= '</div>';
1214
+                        $content .= '<div class="social-plugin-item">';
1215
+                        $content .= $plugin;
1216
+                        $content .= '</div>';
1217 1217
                     }
1218
-                    $content.= '</div>';
1218
+                    $content .= '</div>';
1219 1219
                 }
1220 1220
                 break;
1221 1221
             case SOCIAL_LEFT_PLUGIN:
@@ -1283,12 +1283,12 @@  discard block
 block discarded – undo
1283 1283
         if (!in_array($extension, $allowedTypes)) {
1284 1284
             $flag = false;
1285 1285
         } else {
1286
-            $newFileName = uniqid('') . '.' . $extension;
1286
+            $newFileName = uniqid('').'.'.$extension;
1287 1287
             if (!file_exists($pathMessageAttach)) {
1288 1288
                 @mkdir($pathMessageAttach, api_get_permissions_for_new_directories(), true);
1289 1289
             }
1290 1290
 
1291
-            $newPath = $pathMessageAttach . $newFileName;
1291
+            $newPath = $pathMessageAttach.$newFileName;
1292 1292
             if (is_uploaded_file($fileAttach['tmp_name'])) {
1293 1293
                 @copy($fileAttach['tmp_name'], $newPath);
1294 1294
             }
@@ -1297,9 +1297,9 @@  discard block
 block discarded – undo
1297 1297
             $medium = self::resize_picture($newPath, IMAGE_WALL_MEDIUM_SIZE);
1298 1298
 
1299 1299
             $big = new Image($newPath);
1300
-            $ok = $small && $small->send_image($pathMessageAttach . IMAGE_WALL_SMALL . '_' . $newFileName) &&
1301
-                $medium && $medium->send_image($pathMessageAttach . IMAGE_WALL_MEDIUM .'_' . $newFileName) &&
1302
-                $big && $big->send_image($pathMessageAttach . IMAGE_WALL_BIG . '_' . $newFileName);
1300
+            $ok = $small && $small->send_image($pathMessageAttach.IMAGE_WALL_SMALL.'_'.$newFileName) &&
1301
+                $medium && $medium->send_image($pathMessageAttach.IMAGE_WALL_MEDIUM.'_'.$newFileName) &&
1302
+                $big && $big->send_image($pathMessageAttach.IMAGE_WALL_BIG.'_'.$newFileName);
1303 1303
 
1304 1304
             // Insert
1305 1305
             $newFileName = $social.$newFileName;
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
             $start = '0000-00-00';
1391 1391
         }
1392 1392
 
1393
-        $isOwnWall = (api_get_user_id() == $userId  && $userId == $friendId);
1393
+        $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId);
1394 1394
         $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL, $idMessage, $start, $limit, $offset);
1395 1395
         $formattedList = '<div class="sub-mediapost">';
1396 1396
         $users = array();
@@ -1405,8 +1405,8 @@  discard block
 block discarded – undo
1405 1405
             }
1406 1406
 
1407 1407
             $nameComplete = api_is_western_name_order()
1408
-                ? $users[$userIdLoop]['firstname'] .' ' . $users[$userIdLoop]['lastname']
1409
-                : $users[$userIdLoop]['lastname'] . ' ' . $users[$userIdLoop]['firstname'];
1408
+                ? $users[$userIdLoop]['firstname'].' '.$users[$userIdLoop]['lastname']
1409
+                : $users[$userIdLoop]['lastname'].' '.$users[$userIdLoop]['firstname'];
1410 1410
             $url = api_get_path(WEB_CODE_PATH).'social/profile.php?u='.$userIdLoop;
1411 1411
             $media = '';
1412 1412
             $media .= '<div class="rep-post">';
@@ -1417,11 +1417,11 @@  discard block
 block discarded – undo
1417 1417
                 $media .= '</div>';
1418 1418
             }
1419 1419
             $media .= '<div class="user-image">';
1420
-            $media .= '<a href="'.$url.'" ><img src="'. $users[$userIdLoop]['avatar'] .
1420
+            $media .= '<a href="'.$url.'" ><img src="'.$users[$userIdLoop]['avatar'].
1421 1421
                        '" alt="'.$users[$userIdLoop]['complete_name'].'" class="avatar-thumb"></a>';
1422 1422
             $media .= '</div>';
1423 1423
             $media .= '<div class="user-data">';
1424
-            $media .= '<div class="username">' . '<a href="'.$url.'">'.$nameComplete.'</a></div>';
1424
+            $media .= '<div class="username">'.'<a href="'.$url.'">'.$nameComplete.'</a></div>';
1425 1425
             $media .= '<div class="time timeago" title="'.$date.'">'.$date.'</div>';
1426 1426
             $media .= '</div>';
1427 1427
             $media .= '<div class="msg-content">';
@@ -1456,12 +1456,12 @@  discard block
 block discarded – undo
1456 1456
      * @param   int     $offset     Wall messages offset
1457 1457
      * @return  array   $data       return user's starting wall messages along with message extra data
1458 1458
      */
1459
-    public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset= 0)
1459
+    public static function getWallMessagesPostHTML($userId, $friendId = 0, $start = null, $limit = 10, $offset = 0)
1460 1460
     {
1461 1461
         if (empty($start)) {
1462 1462
             $start = '0000-00-00';
1463 1463
         }
1464
-        $isOwnWall = (api_get_user_id() == $userId  && $userId == $friendId);
1464
+        $isOwnWall = (api_get_user_id() == $userId && $userId == $friendId);
1465 1465
         $messages = self::getWallMessages($userId, MESSAGE_STATUS_WALL_POST, null, $start, $limit, $offset);
1466 1466
         $users = array();
1467 1467
         $data = array();
@@ -1520,7 +1520,7 @@  discard block
 block discarded – undo
1520 1520
 
1521 1521
         $htmlReceiver = '';
1522 1522
         if ($authorId != $receiverId) {
1523
-            $htmlReceiver = ' > <a href="'.$urlReceiver.'">' . $nameCompleteReceiver . '</a> ';
1523
+            $htmlReceiver = ' > <a href="'.$urlReceiver.'">'.$nameCompleteReceiver.'</a> ';
1524 1524
         }
1525 1525
 
1526 1526
         $wallImage = '';
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
         $html .= '<div class="img-post">';
1556 1556
         $html .= $wallImage;
1557 1557
         $html .= '</div>';
1558
-        $html .= '<p>'. Security::remove_XSS($message['content']).'</p>';
1558
+        $html .= '<p>'.Security::remove_XSS($message['content']).'</p>';
1559 1559
         $html .= '</div>';
1560 1560
         $html .= '</div>'; // end mediaPost
1561 1561
 
@@ -1578,11 +1578,11 @@  discard block
 block discarded – undo
1578 1578
         $domain = empty($url) ? parse_url($link) : parse_url($url);
1579 1579
         $domain = $domain['scheme'].'://'.$domain['host'];
1580 1580
         // Trick to verify if the Image Url Exist because of some bad metatag dev
1581
-        if (self::verifyUrl($image) == false){
1582
-            if (!($image[0] == '/')){
1583
-                $domain = $domain . '/';
1581
+        if (self::verifyUrl($image) == false) {
1582
+            if (!($image[0] == '/')) {
1583
+                $domain = $domain.'/';
1584 1584
             }
1585
-            $image = $domain . $image;
1585
+            $image = $domain.$image;
1586 1586
         }
1587 1587
         $title = $graph->title;
1588 1588
         
@@ -1634,16 +1634,16 @@  discard block
 block discarded – undo
1634 1634
         if (isset($array[2]) && !empty($array[2])) {
1635 1635
 
1636 1636
             if ($size == IMAGE_WALL_SMALL) {
1637
-                $name = IMAGE_WALL_SMALL. '_' . $array[2];
1638
-            }else if($size == IMAGE_WALL_MEDIUM){
1639
-                $name = IMAGE_WALL_MEDIUM. '_' . $array[2];
1640
-            }else if($size == IMAGE_WALL_BIG){
1641
-                $name = IMAGE_WALL_BIG. '_' . $array[2];
1642
-            }else {
1643
-                $name = IMAGE_WALL_SMALL. '_' . $array[2];
1637
+                $name = IMAGE_WALL_SMALL.'_'.$array[2];
1638
+            } else if ($size == IMAGE_WALL_MEDIUM) {
1639
+                $name = IMAGE_WALL_MEDIUM.'_'.$array[2];
1640
+            } else if ($size == IMAGE_WALL_BIG) {
1641
+                $name = IMAGE_WALL_BIG.'_'.$array[2];
1642
+            } else {
1643
+                $name = IMAGE_WALL_SMALL.'_'.$array[2];
1644 1644
             }
1645 1645
             $lessImage = str_replace($array[2], '', $path);
1646
-            $name = $lessImage . $name;
1646
+            $name = $lessImage.$name;
1647 1647
         }
1648 1648
 
1649 1649
         return $name;
@@ -1752,18 +1752,18 @@  discard block
 block discarded – undo
1752 1752
         if ($number_friends != 0) {
1753 1753
             if ($number_friends > $number_of_images) {
1754 1754
                 if (api_get_user_id() == $user_id) {
1755
-                    $friendHtml.= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
1755
+                    $friendHtml .= ' <span><a href="friends.php">'.get_lang('SeeAll').'</a></span>';
1756 1756
                 } else {
1757
-                    $friendHtml.= ' <span>'
1757
+                    $friendHtml .= ' <span>'
1758 1758
                         .'<a href="'.api_get_path(WEB_CODE_PATH).'social/profile_friends_and_groups.inc.php'
1759 1759
                         .'?view=friends&height=390&width=610&user_id='.$user_id.'"'
1760 1760
                         .'class="ajax" data-title="'.get_lang('SeeAll').'" title="'.get_lang('SeeAll').'" >'.get_lang('SeeAll').'</a></span>';
1761 1761
                 }
1762 1762
             }
1763 1763
 
1764
-            $friendHtml.= '<ul class="nav nav-list">';
1764
+            $friendHtml .= '<ul class="nav nav-list">';
1765 1765
             $j = 1;
1766
-            for ($k=0; $k < $number_friends; $k++) {
1766
+            for ($k = 0; $k < $number_friends; $k++) {
1767 1767
                 if ($j > $number_of_images) break;
1768 1768
 
1769 1769
                 if (isset($friends[$k])) {
@@ -1777,26 +1777,26 @@  discard block
 block discarded – undo
1777 1777
                         $statusIcon = Display::span('', array('class' => 'offline_user_in_text'));
1778 1778
                     }
1779 1779
 
1780
-                    $friendHtml.= '<li>';
1781
-                    $friendHtml.= '<div>';
1780
+                    $friendHtml .= '<li>';
1781
+                    $friendHtml .= '<div>';
1782 1782
 
1783 1783
                     // the height = 92 must be the same in the image_friend_network span style in default.css
1784 1784
                     $friends_profile = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_SMALL);
1785
-                    $friendHtml.= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
1785
+                    $friendHtml .= '<img src="'.$friends_profile.'" id="imgfriend_'.$friend['friend_user_id'].'" title="'.$name_user.'"/>';
1786 1786
                     $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared;
1787
-                    $friendHtml.= $statusIcon .'<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '">' . $name_user .'</a>';
1788
-                    $friendHtml.= '</div>';
1789
-                    $friendHtml.= '</li>';
1787
+                    $friendHtml .= $statusIcon.'<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'">'.$name_user.'</a>';
1788
+                    $friendHtml .= '</div>';
1789
+                    $friendHtml .= '</li>';
1790 1790
                 }
1791 1791
                 $j++;
1792 1792
             }
1793
-            $friendHtml.='</ul>';
1793
+            $friendHtml .= '</ul>';
1794 1794
         } else {
1795
-            $friendHtml.= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
1796
-                .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>';
1795
+            $friendHtml .= '<div class="">'.get_lang('NoFriendsInYourContactList').'<br />'
1796
+                .'<a class="btn btn-primary" href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>';
1797 1797
         }
1798 1798
 
1799
-        $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' (' . $number_friends . ')' );
1799
+        $friendHtml = Display::panel($friendHtml, get_lang('SocialFriend').' ('.$number_friends.')');
1800 1800
 
1801 1801
         return $friendHtml;
1802 1802
     }
@@ -1817,9 +1817,9 @@  discard block
 block discarded – undo
1817 1817
 
1818 1818
         if ($number_friends != 0) {
1819 1819
 
1820
-            $friendHtml.= '<div class="list-group">';
1820
+            $friendHtml .= '<div class="list-group">';
1821 1821
             $j = 1;
1822
-            for ($k=0; $k < $number_friends; $k++) {
1822
+            for ($k = 0; $k < $number_friends; $k++) {
1823 1823
                 if ($j > $number_of_images) break;
1824 1824
 
1825 1825
                 if (isset($friends[$k])) {
@@ -1828,11 +1828,11 @@  discard block
 block discarded – undo
1828 1828
                     $user_info_friend = api_get_user_info($friend['friend_user_id'], true);
1829 1829
 
1830 1830
                     if ($user_info_friend['user_is_online']) {
1831
-                        $statusIcon = Display::return_icon('statusonline.png',get_lang('Online'));
1832
-                        $status=1;
1831
+                        $statusIcon = Display::return_icon('statusonline.png', get_lang('Online'));
1832
+                        $status = 1;
1833 1833
                     } else {
1834
-                        $statusIcon = Display::return_icon('statusoffline.png',get_lang('Offline'));
1835
-                        $status=0;
1834
+                        $statusIcon = Display::return_icon('statusoffline.png', get_lang('Offline'));
1835
+                        $status = 0;
1836 1836
                     }
1837 1837
 
1838 1838
                     $friendAvatarMedium = UserManager::getUserPicture($friend['friend_user_id'], USER_IMAGE_SIZE_MEDIUM);
@@ -1841,24 +1841,24 @@  discard block
 block discarded – undo
1841 1841
                     $showLinkToChat = api_is_global_chat_enabled() &&
1842 1842
                         $friend['friend_user_id'] != api_get_user_id();
1843 1843
 
1844
-                    if ($showLinkToChat){
1844
+                    if ($showLinkToChat) {
1845 1845
                         $friendHtml .= '<a onclick="javascript:chatWith(\''.$friend['friend_user_id'].'\', \''.$name_user.'\', \''.$status.'\',\''.$friendAvatarSmall.'\')" href="javascript:void(0);" class="list-group-item">';
1846
-                        $friendHtml .=  $friend_avatar.' <span class="username">' . $name_user . '</span>';
1847
-                        $friendHtml .= '<span class="status">' . $statusIcon . '</span>';
1846
+                        $friendHtml .= $friend_avatar.' <span class="username">'.$name_user.'</span>';
1847
+                        $friendHtml .= '<span class="status">'.$statusIcon.'</span>';
1848 1848
                     } else {
1849 1849
                         $link_shared = (empty($link_shared)) ? '' : '&'.$link_shared;
1850
-                        $friendHtml .= '<a href="profile.php?' .'u=' . $friend['friend_user_id'] . $link_shared . '" class="list-group-item">';
1851
-                        $friendHtml .=  $friend_avatar.' <span class="username-all">' . $name_user . '</span>';
1850
+                        $friendHtml .= '<a href="profile.php?'.'u='.$friend['friend_user_id'].$link_shared.'" class="list-group-item">';
1851
+                        $friendHtml .= $friend_avatar.' <span class="username-all">'.$name_user.'</span>';
1852 1852
                     }
1853 1853
 
1854 1854
                     $friendHtml .= '</a>';
1855 1855
                 }
1856 1856
                 $j++;
1857 1857
             }
1858
-            $friendHtml.='</div>';
1858
+            $friendHtml .= '</div>';
1859 1859
         } else {
1860
-            $friendHtml.= '<div class="help">'.get_lang('NoFriendsInYourContactList').' '
1861
-                .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '. get_lang('TryAndFindSomeFriends').'</a></div>';
1860
+            $friendHtml .= '<div class="help">'.get_lang('NoFriendsInYourContactList').' '
1861
+                .'<a href="'.api_get_path(WEB_PATH).'whoisonline.php"><em class="fa fa-search"></em> '.get_lang('TryAndFindSomeFriends').'</a></div>';
1862 1862
         }
1863 1863
 
1864 1864
         return $friendHtml;
@@ -1876,7 +1876,7 @@  discard block
 block discarded – undo
1876 1876
                 'post',
1877 1877
                 api_get_path(WEB_CODE_PATH).'social/profile.php'.$userId,
1878 1878
                 null,
1879
-                array('enctype' => 'multipart/form-data') ,
1879
+                array('enctype' => 'multipart/form-data'),
1880 1880
                 FormValidator::LAYOUT_HORIZONTAL    
1881 1881
             );
1882 1882
 
Please login to merge, or discard this patch.
main/inc/lib/sortable_table.class.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -443,6 +443,7 @@
 block discarded – undo
443 443
      * @param bool       hide navigation optionally
444 444
      * @param int        content per page when show navigation (optional)
445 445
      * @param bool       sort data optionally
446
+     * @param boolean $visibility_options
446 447
      * @return string    grid html
447 448
      */
448 449
     public function display_simple_grid($visibility_options, $hide_navigation = true, $per_page = 20, $sort_data = true, $grid_class = array())
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -339,9 +339,9 @@  discard block
 block discarded – undo
339 339
     }
340 340
 
341 341
     /**
342
-    * This function shows the content of a table in a grid.
343
-    * Should not be use to edit information (edit/delete rows) only.
344
-    **/
342
+     * This function shows the content of a table in a grid.
343
+     * Should not be use to edit information (edit/delete rows) only.
344
+     **/
345 345
     public function display_grid()
346 346
     {
347 347
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
                 //$param[$tablename.'_direction'] = $_GET[$tablename.'_direction'];
791 791
                 $my_get_direction = $_GET[$tablename.'_direction'];
792 792
                 if (!in_array($my_get_direction, array('ASC', 'DESC'))) {
793
-                     $param[$tablename.'_direction'] =  'ASC';
793
+                        $param[$tablename.'_direction'] =  'ASC';
794 794
                 } else {
795 795
                     $param[$tablename.'_direction'] = $my_get_direction;
796 796
                 }
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
         if (is_array($row)) {
918 918
             foreach ($row as & $value) {
919 919
                 if (empty($value)) {
920
-                     $value = '-';
920
+                        $value = '-';
921 921
                 }
922 922
             }
923 923
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -808,8 +808,9 @@
 block discarded – undo
808 808
             foreach ($param as $key => & $value) {
809 809
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
810 810
             }
811
-            if (count($param_string_parts) > 0)
812
-                $result .= '&amp;'.implode('&amp;', $param_string_parts);
811
+            if (count($param_string_parts) > 0) {
812
+                            $result .= '&amp;'.implode('&amp;', $param_string_parts);
813
+            }
813 814
         }
814 815
         return $result;
815 816
     }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
         $this->per_page = isset($_GET[$this->param_prefix.'per_page']) ? intval($_GET[$this->param_prefix.'per_page']) : $this->per_page;
176 176
 
177 177
         $_SESSION[$this->param_prefix.'per_page']  = $this->per_page;
178
-        $_SESSION[$this->param_prefix.'direction'] = $this->direction ;
178
+        $_SESSION[$this->param_prefix.'direction'] = $this->direction;
179 179
         $_SESSION[$this->param_prefix.'page_nr']   = $this->page_nr;
180 180
         $_SESSION[$this->param_prefix.'column']    = $this->column;
181 181
         $this->pager                               = null;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
             $params['spacesBeforeSeparator'] = '';
216 216
             $params['spacesAfterSeparator']  = '';
217 217
             $query_vars = array_keys($_GET);
218
-            $query_vars_needed = array ($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page');
218
+            $query_vars_needed = array($this->param_prefix.'column', $this->param_prefix.'direction', $this->param_prefix.'per_page');
219 219
             if (count($this->additional_parameters) > 0) {
220 220
                 $query_vars_needed = array_merge($query_vars_needed, array_keys($this->additional_parameters));
221 221
             }
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         if (!$empty_table) {
291 291
             if (!empty($this->additional_parameters)) {
292
-                foreach($this->additional_parameters as $key => $value) {
292
+                foreach ($this->additional_parameters as $key => $value) {
293 293
                     $html .= '<input type="hidden" name ="'.Security::remove_XSS($key).'" value ="'.Security::remove_XSS($value).'" />';
294 294
                 }
295 295
             }
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                         $html .= '<li><a data-action ="'.$action.'" href="#" onclick="javascript:action_click(this, \''.$table_id.'\');">'.$label.'</a></li>';
315 315
                     }
316 316
                     $html .= '</ul>';
317
-                    $html .= '</div>';//btn-group
317
+                    $html .= '</div>'; //btn-group
318 318
                 $html .= '</div>'; //toolbar
319 319
             } else {
320 320
                 $html .= $form;
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
             }
339 339
         }
340 340
         
341
-        return '<div class="table-responsive">' . $html . '</div>';
341
+        return '<div class="table-responsive">'.$html.'</div>';
342 342
     }
343 343
 
344 344
     /**
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 
394 394
             $html .= '<div class="clear"></div>';
395 395
             if (count($this->form_actions) > 0) {
396
-                $script= '<script>
396
+                $script = '<script>
397 397
                             /*<![CDATA[*/
398 398
                             function setCheckbox(value) {
399 399
                                  d = document.form_'.$this->table_name.';
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
             }
416 416
         }
417 417
         // Getting the items of the table
418
-        $items = $this->get_clean_html(false);    //no sort
418
+        $items = $this->get_clean_html(false); //no sort
419 419
 
420 420
         // Generation of style classes must be improved. Maybe we need a a table name to create style on the fly:
421 421
         // i.e: .whoisonline_table_grid_container instead of  .grid_container
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
 
484 484
             $html .= '<div class="clear"></div>';
485 485
             if (count($this->form_actions) > 0) {
486
-                $script= '<script>
486
+                $script = '<script>
487 487
                             /*<![CDATA[*/
488 488
                             function setCheckbox(value) {
489 489
                                  d = document.form_'.$this->table_name.';
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
                     $counter = 0;
590 590
                     foreach ($row as $index => $rowInfo) {
591 591
                         if (!isset($this->columnsToHide[$index])) {
592
-                            $newRow[$counter] = $rowInfo ;
592
+                            $newRow[$counter] = $rowInfo;
593 593
                             $counter++;
594 594
                         }
595 595
                     }
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
         }
605 605
 
606 606
         if ($this->odd_even_rows_enabled == true) {
607
-            $this->altRowAttributes(0, array ('class' => 'row_odd'), array ('class' => 'row_even'), true);
607
+            $this->altRowAttributes(0, array('class' => 'row_odd'), array('class' => 'row_even'), true);
608 608
         }
609 609
 
610 610
         foreach ($this->th_attributes as $column => $attributes) {
@@ -664,11 +664,11 @@  discard block
 block discarded – undo
664 664
         }
665 665
         $result[] = '<select name="'.$this->param_prefix.'per_page" onchange="javascript: this.form.submit();">';
666 666
         for ($nr = 10; $nr <= min(50, $total_number_of_items); $nr += 10) {
667
-            $result[] = '<option value="'.$nr.'" '. ($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
667
+            $result[] = '<option value="'.$nr.'" '.($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
668 668
         }
669 669
         // @todo no limits
670 670
         //if ($total_number_of_items < 500) {
671
-            $result[] = '<option value="'.$total_number_of_items.'" '. ($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
671
+            $result[] = '<option value="'.$total_number_of_items.'" '.($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
672 672
         //}
673 673
         $result[] = '</select>';
674 674
         $result[] = '<noscript>';
@@ -780,7 +780,7 @@  discard block
 block discarded – undo
780 780
      */
781 781
     public function get_additional_url_paramstring()
782 782
     {
783
-        $param_string_parts = array ();
783
+        $param_string_parts = array();
784 784
         if (is_array($this->additional_parameters) && count($this->additional_parameters) > 0) {
785 785
             foreach ($this->additional_parameters as $key => & $value) {
786 786
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
                 //$param[$tablename.'_direction'] = $_GET[$tablename.'_direction'];
794 794
                 $my_get_direction = $_GET[$tablename.'_direction'];
795 795
                 if (!in_array($my_get_direction, array('ASC', 'DESC'))) {
796
-                     $param[$tablename.'_direction'] =  'ASC';
796
+                     $param[$tablename.'_direction'] = 'ASC';
797 797
                 } else {
798 798
                     $param[$tablename.'_direction'] = $my_get_direction;
799 799
                 }
@@ -807,7 +807,7 @@  discard block
 block discarded – undo
807 807
             if (isset($_GET[$tablename.'_column'])) {
808 808
                 $param[$tablename.'_column'] = intval($_GET[$tablename.'_column']);
809 809
             }
810
-            $param_string_parts = array ();
810
+            $param_string_parts = array();
811 811
             foreach ($param as $key => & $value) {
812 812
                 $param_string_parts[] = urlencode($key).'='.urlencode($value);
813 813
             }
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
         $param[$this->param_prefix.'page_nr'] = $this->page_nr;
828 828
         $param[$this->param_prefix.'per_page'] = $this->per_page;
829 829
         $param[$this->param_prefix.'column'] = $this->column;
830
-        $param_string_parts = array ();
830
+        $param_string_parts = array();
831 831
         foreach ($param as $key => & $value) {
832 832
             $param_string_parts[] = urlencode($key).'='.urlencode($value);
833 833
         }
Please login to merge, or discard this patch.
main/inc/lib/specific_fields_manager.lib.php 3 patches
Doc Comments   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
 /**
102 102
  * @param array $conditions a list of condition (exemple : status=>STUDENT)
103
- * @param array $order_by a list of fields on which sort
103
+ * @param string[] $order_by a list of fields on which sort
104 104
  * @return array An array with all users of the platform.
105 105
  */
106 106
 function get_specific_field_values_list(
@@ -235,6 +235,7 @@  discard block
 block discarded – undo
235 235
  * @param   string  Course code
236 236
  * @param   string  Tool ID
237 237
  * @param   int     Internal ID used in specific tool table
238
+ * @param string $tool_id
238 239
  */
239 240
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240 241
   $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
@@ -248,6 +249,7 @@  discard block
 block discarded – undo
248 249
  * Defaults to the first letter of the name, otherwise iterate through available
249 250
  * letters
250 251
  * @param   string  Name
252
+ * @param string $name
251 253
  * @return  string  One-letter code, upper-case
252 254
  */
253 255
 function get_specific_field_code_from_name($name) {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 function delete_specific_field($id)
43 43
 {
44 44
     $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
45
-    $id = (int)$id;
45
+    $id = (int) $id;
46 46
     if (!is_numeric($id)) {
47 47
         return false;
48 48
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 function edit_specific_field($id, $name)
61 61
 {
62 62
     $table_sf = Database:: get_main_table(TABLE_MAIN_SPECIFIC_FIELD);
63
-    $id = (int)$id;
63
+    $id = (int) $id;
64 64
     if (!is_numeric($id)) {
65 65
         return false;
66 66
     }
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -237,10 +237,10 @@
 block discarded – undo
237 237
  * @param   int     Internal ID used in specific tool table
238 238
  */
239 239
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240
-  $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
-  $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
-  $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
-  Database::query($sql);
240
+    $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
+    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
+    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
+    Database::query($sql);
244 244
 }
245 245
 
246 246
 /**
Please login to merge, or discard this patch.
main/inc/lib/statsUtils.lib.inc.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -85,6 +85,7 @@
 block discarded – undo
85 85
     /**
86 86
      * @author Sebastien Piraux <[email protected]>
87 87
      * @param sql : a sql query (as a string)
88
+     * @param integer $X
88 89
      * @desc Return many results of a query in a X column tab
89 90
      * in $resu[$i][0], $resu[$i][1],$resu[$i][2],...
90 91
      * this function is more 'standard' but use a little
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -107,14 +107,14 @@
 block discarded – undo
107 107
         return $resu;
108 108
     }
109 109
 
110
-	/**
111
-	 * @author Sebastien Piraux <[email protected]>
112
-	 * @param sql : a sql query (as a string)
113
-	 * @return hours_array
114
-	 * @desc        Return an assoc array.  Keys are the hours, values are
115
-	 * the number of time this hours was found.
116
-	 * key 'total' return the sum of all number of time hours
117
-	 * appear
110
+    /**
111
+     * @author Sebastien Piraux <[email protected]>
112
+     * @param sql : a sql query (as a string)
113
+     * @return hours_array
114
+     * @desc        Return an assoc array.  Keys are the hours, values are
115
+     * the number of time this hours was found.
116
+     * key 'total' return the sum of all number of time hours
117
+     * appear
118 118
      */
119 119
     public static function hoursTab($sql)
120 120
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
             $last_day = -1;
156 156
             while ($row = Database::fetch_row($res)) {
157 157
                 $date_array = getdate($row[0]);
158
-                $display_date = $date_array['mday'] . ' ' . $MonthsShort[$date_array['mon'] - 1] . ' ' . $date_array['year'];
158
+                $display_date = $date_array['mday'].' '.$MonthsShort[$date_array['mon'] - 1].' '.$date_array['year'];
159 159
                 if ($date_array['mday'] == $last_day) {
160 160
                     $days_array[$display_date]++;
161 161
                 } else {
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
                     &nbsp;
222 222
                 </td>
223 223
                 <td width='10%'>
224
-                    <b>" . get_lang('Hits') . "</b>
224
+                    <b>".get_lang('Hits')."</b>
225 225
                 </td>
226 226
                 <td width='15%'>
227 227
                     <b>%</b>
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
                     echo "<img src='".Display::returnIconPath('bar_1m.gif')."' width='1' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />";
250 250
                 }
251 251
                 if ($pourcent != 100) {
252
-                    echo "<img src='".Display::returnIconPath('bar_1r.gif')."' width='" . ($maxSize - $barwidth) . "' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />";
252
+                    echo "<img src='".Display::returnIconPath('bar_1r.gif')."' width='".($maxSize - $barwidth)."' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />";
253 253
                 }
254 254
                 echo "<img src='".Display::returnIconPath('bar_1.gif')."' width='1' height='12' alt='$periodPiece : $cpt hits &ndash; $pourcent %' />
255 255
                     </td>
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
         }
266 266
         echo "<tr bgcolor='#E6E6E6'>
267 267
                 <td width='15%' align='center'>
268
-                    " . get_lang('Total') . "
268
+                    " . get_lang('Total')."
269 269
                 </td>
270 270
                 <td align='right' width='60%'>
271 271
                     &nbsp;
272 272
                 </td>
273 273
                 <td align='center' width='10%'>
274
-                    " . $period_array['total'] . "
274
+                    " . $period_array['total']."
275 275
                 </td>
276 276
                 <td width='15%'>
277 277
                     &nbsp;
Please login to merge, or discard this patch.
main/inc/lib/sub_language.class.php 3 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,6 +18,7 @@  discard block
 block discarded – undo
18 18
      * Get all files of lang folder (forum.inc.php,gradebook.inc.php,notebook.inc.php)
19 19
      * @param String The lang path folder  (/var/www/my_lms/main/lang/spanish)
20 20
      * @param bool true if we only want the "subname" trad4all instead of  trad4all.inc.php
21
+     * @param string $path
21 22
      *
22 23
      * @return Array All file of lang folder
23 24
      */
@@ -68,6 +69,7 @@  discard block
 block discarded – undo
68 69
     /**
69 70
      * Get all information of language
70 71
      * @param Integer The parent id(Language father id)
72
+     * @param integer $parent_id
71 73
      * @return Array All information about language
72 74
      */
73 75
     public static function get_all_information_of_language($parent_id)
@@ -86,6 +88,7 @@  discard block
 block discarded – undo
86 88
     /**
87 89
      * Get all information of chamilo file
88 90
      * @param String The chamilo path file (/var/www/chamilo/main/lang/spanish/gradebook.inc.php)
91
+     * @param string $system_path_file
89 92
      * @patam Bool Whether we want to remove the '$' prefix in the results or not
90 93
      * @return Array Contains all information of chamilo file
91 94
      */
@@ -345,7 +348,7 @@  discard block
 block discarded – undo
345 348
     /**
346 349
      * Make available the language
347 350
      * @param Integer The language id
348
-     * @return void
351
+     * @return boolean
349 352
      */
350 353
     public static function make_available_language($language_id)
351 354
     {
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,8 +29,9 @@
 block discarded – undo
29 29
                 while (($file = readdir($dh)) !== false) {
30 30
                     if ($file[0] <> '.' && substr($file, -4, strlen($file)) == '.php') {
31 31
                         if ($only_main_name) {
32
-                            if ($file != '' && strpos($file, '.inc.php'))
33
-                                $content_dir[] = substr($file, 0, strpos($file, '.inc.php'));
32
+                            if ($file != '' && strpos($file, '.inc.php')) {
33
+                                                            $content_dir[] = substr($file, 0, strpos($file, '.inc.php'));
34
+                            }
34 35
                         } else {
35 36
                             $content_dir[] = $file;
36 37
                         }
Please login to merge, or discard this patch.
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     public static function getAllLanguages($onlyActive = false)
24 24
     {
25 25
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
26
-        $sql = 'SELECT * FROM ' . $table;
26
+        $sql = 'SELECT * FROM '.$table;
27 27
         if ($onlyActive) {
28 28
             $sql .= ' WHERE available = 1';
29 29
         }
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
     public static function get_all_information_of_sub_language($parent_id, $sub_language_id)
76 76
     {
77 77
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
78
-        $sql = 'SELECT * FROM ' . $table . '
78
+        $sql = 'SELECT * FROM '.$table.'
79 79
                 WHERE
80 80
                     parent_id= ' . intval($parent_id).' AND
81
-                    id= ' . intval($sub_language_id) . '';
81
+                    id= ' . intval($sub_language_id).'';
82 82
         $rs = Database::query($sql);
83 83
         $all_information = array();
84 84
         while ($row = Database::fetch_array($rs, 'ASSOC')) {
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
     public static function get_all_information_of_language($parent_id)
97 97
     {
98 98
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
99
-        $sql = 'SELECT * FROM ' . $table . ' WHERE id = "' . intval($parent_id) . '"';
99
+        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
100 100
         $rs = Database::query($sql);
101 101
         $all_information = array();
102 102
         while ($row = Database::fetch_array($rs, 'ASSOC')) {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     public static function add_file_in_language_directory($system_path_file)
145 145
     {
146
-        $return_value = @file_put_contents($system_path_file, '<?php' . PHP_EOL);
146
+        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);
147 147
 
148 148
         return $return_value;
149 149
     }
@@ -158,10 +158,10 @@  discard block
 block discarded – undo
158 158
     public static function write_data_in_file($path_file, $new_term, $new_variable)
159 159
     {
160 160
         $return_value = false;
161
-        $new_data = $new_variable . '=' . $new_term;
161
+        $new_data = $new_variable.'='.$new_term;
162 162
         $resource = @fopen($path_file, "a");
163 163
         if (file_exists($path_file) && $resource) {
164
-            if (fwrite($resource, $new_data . PHP_EOL) === false) {
164
+            if (fwrite($resource, $new_data.PHP_EOL) === false) {
165 165
                 //not allow to write
166 166
                 $return_value = false;
167 167
             } else {
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         if (empty($sub_language_dir)) {
184 184
             return false;
185 185
         }
186
-        $dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir;
186
+        $dir = api_get_path(SYS_LANG_PATH).$sub_language_dir;
187 187
         if (is_dir($dir)) {
188 188
             return true;
189 189
         } //even if the dir already exists, we reach the objective of having the directory there
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
             return false;
208 208
         }
209 209
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
210
-        $sql = 'SELECT dokeos_folder FROM ' . $table . '
211
-                WHERE parent_id = ' . $parent_id . ' and id = ' . $sub_language_id;
210
+        $sql = 'SELECT dokeos_folder FROM '.$table.'
211
+                WHERE parent_id = ' . $parent_id.' and id = '.$sub_language_id;
212 212
         $res = Database::query($sql);
213 213
         if ($res === false or Database::num_rows($res) < 1) {
214 214
             return false;
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         if ($res === false) {
219 219
             return false;
220 220
         } //can't delete dir, so do not delete language record
221
-        $sql = 'DELETE FROM ' . $table . '
221
+        $sql = 'DELETE FROM '.$table.'
222 222
                 WHERE id= ' . intval($sub_language_id);
223 223
         $res = Database::query($sql);
224 224
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         if (empty($sub_language_dir)) {
236 236
             return false;
237 237
         }
238
-        $dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir;
238
+        $dir = api_get_path(SYS_LANG_PATH).$sub_language_dir;
239 239
         if (!is_dir($dir)) {
240 240
             return true;
241 241
         } //even if the dir does not exist, we reach the objective of not having the directory there
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
         if (count($content) > 0) {
245 245
             foreach ($content as $value_content) {
246
-                $path_file = $dir . '/' . $value_content;
246
+                $path_file = $dir.'/'.$value_content;
247 247
                 unlink($path_file);
248 248
             }
249 249
             return @rmdir($dir);
@@ -261,8 +261,8 @@  discard block
 block discarded – undo
261 261
     {
262 262
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
263 263
         $sql = 'SELECT count(*) as count
264
-                FROM ' . $table . '
265
-                WHERE id="' . intval($language_id) . '"';
264
+                FROM ' . $table.'
265
+                WHERE id="' . intval($language_id).'"';
266 266
         $rs = Database::query($sql);
267 267
         if (Database::num_rows($rs) > 0) {
268 268
             if (Database::result($rs, 0, 'count') == 1) {
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
     {
285 285
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
286 286
         $sql = 'SELECT original_name
287
-                FROM ' . $table . '
288
-                WHERE id= ' . intval($language_id) . '';
287
+                FROM ' . $table.'
288
+                WHERE id= ' . intval($language_id).'';
289 289
         $rs = Database::query($sql);
290 290
         if (Database::num_rows($rs) > 0) {
291 291
             return Database::result($rs, 0, 'original_name');
@@ -303,8 +303,8 @@  discard block
 block discarded – undo
303 303
     public static function check_if_language_is_sub_language($language_id)
304 304
     {
305 305
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
306
-        $sql = 'SELECT count(*) AS count FROM ' . $table . '
307
-                WHERE id = ' . intval($language_id) . ' AND NOT ISNULL(parent_id)';
306
+        $sql = 'SELECT count(*) AS count FROM '.$table.'
307
+                WHERE id = ' . intval($language_id).' AND NOT ISNULL(parent_id)';
308 308
         $rs = Database::query($sql);
309 309
 
310 310
         if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
     {
323 323
         $language_info = self::get_all_information_of_language($language_id);
324 324
         $table = Database :: get_main_table(TABLE_MAIN_USER);
325
-        $sql = 'SELECT count(*) AS count FROM ' . $table . '
325
+        $sql = 'SELECT count(*) AS count FROM '.$table.'
326 326
                 WHERE language ="' . Database::escape_string($language_info['english_name']).'"';
327 327
         $rs = Database::query($sql);
328 328
         if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') >= 1) {
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
     public static function check_if_language_is_father($language_id)
341 341
     {
342 342
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
343
-        $sql = 'SELECT count(*) AS count FROM ' . $table . '
344
-                WHERE parent_id= ' . intval($language_id) . ' AND NOT ISNULL(parent_id);';
343
+        $sql = 'SELECT count(*) AS count FROM '.$table.'
344
+                WHERE parent_id= ' . intval($language_id).' AND NOT ISNULL(parent_id);';
345 345
         $rs = Database::query($sql);
346 346
 
347 347
         if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
     {
361 361
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
362 362
         $sql = "UPDATE $tbl_admin_languages SET available='0'
363
-                WHERE id = " . intval($language_id) . "";
363
+                WHERE id = ".intval($language_id)."";
364 364
         $result = Database::query($sql);
365 365
 
366 366
         return $result !== false; //only return false on sql error
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     {
376 376
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
377 377
         $sql = "UPDATE $tbl_admin_languages SET available='1'
378
-                WHERE id = " . intval($language_id) . "";
378
+                WHERE id = ".intval($language_id)."";
379 379
         $result = Database::query($sql);
380 380
 
381 381
         return $result !== false; //only return false on sql error
@@ -393,11 +393,11 @@  discard block
 block discarded – undo
393 393
         }
394 394
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
395 395
         $tbl_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
396
-        $sql = "SELECT english_name FROM " . $tbl_admin_languages . "
397
-                WHERE id= " . intval($language_id) . "";
396
+        $sql = "SELECT english_name FROM ".$tbl_admin_languages."
397
+                WHERE id= " . intval($language_id)."";
398 398
         $result = Database::query($sql);
399 399
         $lang = Database::fetch_array($result);
400
-        $sql_update_2 = "UPDATE " . $tbl_settings_current . " SET selected_value='" . $lang['english_name'] . "'
400
+        $sql_update_2 = "UPDATE ".$tbl_settings_current." SET selected_value='".$lang['english_name']."'
401 401
                          WHERE variable='platformLanguage'";
402 402
         $result_2 = Database::query($sql_update_2);
403 403
         Event::addEvent(
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
     {
418 418
         $name = api_get_setting('platformLanguage');
419 419
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
420
-        $sql = "SELECT id FROM " . $tbl_admin_languages . " WHERE english_name ='$name'";
420
+        $sql = "SELECT id FROM ".$tbl_admin_languages." WHERE english_name ='$name'";
421 421
         $res = Database::query($sql);
422 422
         if (Database::num_rows($res) < 1) {
423 423
             return false;
@@ -436,10 +436,10 @@  discard block
 block discarded – undo
436 436
     {
437 437
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
438 438
         $sql = "SELECT dokeos_folder
439
-                FROM " . $tbl_admin_languages . "
439
+                FROM " . $tbl_admin_languages."
440 440
                 WHERE id = (
441
-                    SELECT parent_id FROM " . $tbl_admin_languages . "
442
-                    WHERE dokeos_folder = '" . Database::escape_string($language_path) . "'
441
+                    SELECT parent_id FROM " . $tbl_admin_languages."
442
+                    WHERE dokeos_folder = '" . Database::escape_string($language_path)."'
443 443
                 )
444 444
                 ";
445 445
         $result = Database::query($sql);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         $adminLanguagesTable = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
462 462
         // select language - if case several languages match, get the last (more recent) one
463 463
         $sql = "SELECT english_name
464
-                FROM " . $adminLanguagesTable . "
464
+                FROM " . $adminLanguagesTable."
465 465
                 WHERE
466 466
                     isocode ='$isocode' AND
467 467
                     available = 1
Please login to merge, or discard this patch.
main/inc/lib/system/web/request.class.php 3 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -31,6 +31,10 @@
 block discarded – undo
31 31
         return $method == 'GET';
32 32
     }
33 33
 
34
+    /**
35
+     * @param string $key
36
+     * @param string $default
37
+     */
34 38
     public static function post($key, $default = null)
35 39
     {
36 40
         return isset($_POST[$key]) ? $_POST[$key] : $default;
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 /**
4 4
  * Provides access to various HTTP request elements: GET, POST, FILE, etc paramaters.
5
-
6 5
  * @license see /license.txt
7 6
  * @deprecated
8 7
  * @author Laurent Opprecht <[email protected]> for the Univesity of Geneva
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default;
16 16
     }
17 17
 
18
-    public static function has($key){
18
+    public static function has($key) {
19 19
         return isset($_REQUEST[$key]);
20 20
     }
21 21
 
Please login to merge, or discard this patch.
main/inc/lib/table_sort.class.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@
 block discarded – undo
80 80
 	 * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
81 81
 	 * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column.
82 82
 	 * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3]
83
-	 * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
83
+	 * @param integer $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
84 84
 	 * @return array The sorted dataset
85 85
 	 * @author [email protected]
86 86
 	 */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
                 $new_data_order = array();
159 159
                 if (!empty($docs_to_sort)) {
160
-                    foreach($docs_to_sort as $id => $document) {
160
+                    foreach ($docs_to_sort as $id => $document) {
161 161
                         if (isset($new_data[$id])) {
162 162
                             $new_data_order[] = $new_data[$id];
163 163
                         }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
                 }
166 166
 
167 167
                 if (!empty($folder_to_sort)) {
168
-                    foreach($folder_to_sort as $id => $document) {
168
+                    foreach ($folder_to_sort as $id => $document) {
169 169
                         if (isset($new_data[$id])) {
170 170
                             $new_data_order[] = $new_data[$id];
171 171
                         }
Please login to merge, or discard this patch.
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -15,16 +15,16 @@  discard block
 block discarded – undo
15 15
 class TableSort
16 16
 {
17 17
     /**
18
-    * Sorts 2-dimensional table.
19
-    * @param array $data The data to be sorted.
20
-    * @param int $column The column on which the data should be sorted (default = 0)
21
-    * @param int $direction The direction to sort (SORT_ASC (default) or SORT_DESC)
22
-    * @param int $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC,
23
-    * SORT_STRING,SORT_DATE,SORT_IMAGE)
24
-    * @return array The sorted dataset
25
-    * @author [email protected]
26
-    */
27
-	public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR)
18
+     * Sorts 2-dimensional table.
19
+     * @param array $data The data to be sorted.
20
+     * @param int $column The column on which the data should be sorted (default = 0)
21
+     * @param int $direction The direction to sort (SORT_ASC (default) or SORT_DESC)
22
+     * @param int $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC,
23
+     * SORT_STRING,SORT_DATE,SORT_IMAGE)
24
+     * @return array The sorted dataset
25
+     * @author [email protected]
26
+     */
27
+    public static function sort_table($data, $column = 0, $direction = SORT_ASC, $type = SORT_REGULAR)
28 28
     {
29 29
         if (!is_array($data) || empty($data)) {
30 30
             return array();
@@ -71,20 +71,20 @@  discard block
 block discarded – undo
71 71
         usort($data, create_function('$a, $b', $compare_function));
72 72
 
73 73
         return $data;
74
-	}
74
+    }
75 75
 
76
-	/**
77
-	 * Sorts 2-dimensional table. It is possile changing the columns that will be shown and the way that the columns are to be sorted.
78
-	 * @param array $data The data to be sorted.
79
-	 * @param int $column The column on which the data should be sorted (default = 0)
80
-	 * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
81
-	 * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column.
82
-	 * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3]
83
-	 * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
84
-	 * @return array The sorted dataset
85
-	 * @author [email protected]
86
-	 */
87
-	public static function sort_table_config(
76
+    /**
77
+     * Sorts 2-dimensional table. It is possile changing the columns that will be shown and the way that the columns are to be sorted.
78
+     * @param array $data The data to be sorted.
79
+     * @param int $column The column on which the data should be sorted (default = 0)
80
+     * @param string $direction The direction to sort (SORT_ASC (default) orSORT_DESC)
81
+     * @param array $column_show The columns that we will show in the table i.e: $column_show = array('1','0','1') we will show the 1st and the 3th column.
82
+     * @param array $column_order Changes how the columns will be sorted ie. $column_order = array('0','3','2','3') The column [1] will be sorted like the column [3]
83
+     * @param constant $type How should data be sorted (SORT_REGULAR, SORT_NUMERIC, SORT_STRING, SORT_DATE, SORT_IMAGE)
84
+     * @return array The sorted dataset
85
+     * @author [email protected]
86
+     */
87
+    public static function sort_table_config(
88 88
         $data,
89 89
         $column = 0,
90 90
         $direction = SORT_ASC,
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
             if (!empty($data)) {
133 133
                 foreach ($data as $document) {
134 134
                     if ($document['type'] == 'folder') {
135
-                      $docs_to_sort[$document['id']]   = api_strtolower($document['name']);
135
+                        $docs_to_sort[$document['id']]   = api_strtolower($document['name']);
136 136
                     } else {
137
-                      $folder_to_sort[$document['id']] = api_strtolower($document['name']);
137
+                        $folder_to_sort[$document['id']] = api_strtolower($document['name']);
138 138
                     }
139 139
                     $new_data[$document['id']] = $document;
140 140
                 }
@@ -196,91 +196,91 @@  discard block
 block discarded – undo
196 196
             usort($data, create_function('$a, $b', $compare_function));
197 197
         }
198 198
 
199
-		if (is_array($column_show) && !empty($column_show)) {
199
+        if (is_array($column_show) && !empty($column_show)) {
200 200
 
201
-			// We show only the columns data that were set up on the $column_show array
202
-			$new_order_data = array();
203
-			$count_data = count($data);
204
-			$count_column_show = count($column_show);
205
-			for ($j = 0; $j < $count_data; $j++) {
206
-				$k = 0;
207
-				for ($i = 0; $i < $count_column_show; $i++) {
208
-					if ($column_show[$i]) {
209
-						$new_order_data[$j][$k] = $data[$j][$i];
210
-					}
211
-					$k++;
212
-				}
213
-			}
214
-			// Replace the multi-arrays
215
-			$data = $new_order_data;
216
-		}
201
+            // We show only the columns data that were set up on the $column_show array
202
+            $new_order_data = array();
203
+            $count_data = count($data);
204
+            $count_column_show = count($column_show);
205
+            for ($j = 0; $j < $count_data; $j++) {
206
+                $k = 0;
207
+                for ($i = 0; $i < $count_column_show; $i++) {
208
+                    if ($column_show[$i]) {
209
+                        $new_order_data[$j][$k] = $data[$j][$i];
210
+                    }
211
+                    $k++;
212
+                }
213
+            }
214
+            // Replace the multi-arrays
215
+            $data = $new_order_data;
216
+        }
217 217
 
218
-		return $data;
219
-	}
218
+        return $data;
219
+    }
220 220
 
221
-	/**
222
-	 * Checks whether a column of a 2D-array contains only numeric values
223
-	 * @param array $data		The data-array
224
-	 * @param int $column		The index of the column to check
225
-	 * @return bool				TRUE if column contains only dates, FALSE otherwise
226
-	 * @todo Take locale into account (eg decimal point or comma ?)
227
-	 * @author [email protected]
228
-	 */
229
-	private static function is_numeric_column(& $data, $column)
221
+    /**
222
+     * Checks whether a column of a 2D-array contains only numeric values
223
+     * @param array $data		The data-array
224
+     * @param int $column		The index of the column to check
225
+     * @return bool				TRUE if column contains only dates, FALSE otherwise
226
+     * @todo Take locale into account (eg decimal point or comma ?)
227
+     * @author [email protected]
228
+     */
229
+    private static function is_numeric_column(& $data, $column)
230 230
     {
231
-		$is_numeric = true;
232
-		foreach ($data as $index => & $row) {
233
-			$is_numeric &= is_numeric(strip_tags($row[$column]));
234
-			if (!$is_numeric) {
235
-				break;
236
-			}
237
-		}
238
-		return $is_numeric;
239
-	}
231
+        $is_numeric = true;
232
+        foreach ($data as $index => & $row) {
233
+            $is_numeric &= is_numeric(strip_tags($row[$column]));
234
+            if (!$is_numeric) {
235
+                break;
236
+            }
237
+        }
238
+        return $is_numeric;
239
+    }
240 240
 
241
-	/**
242
-	 * Checks whether a column of a 2D-array contains only dates (GNU date syntax)
243
-	 * @param array $data		The data-array
244
-	 * @param int $column		The index of the column to check
245
-	 * @return bool				TRUE if column contains only dates, FALSE otherwise
246
-	 * @author [email protected]
247
-	 */
248
-	private static function is_date_column(& $data, $column)
241
+    /**
242
+     * Checks whether a column of a 2D-array contains only dates (GNU date syntax)
243
+     * @param array $data		The data-array
244
+     * @param int $column		The index of the column to check
245
+     * @return bool				TRUE if column contains only dates, FALSE otherwise
246
+     * @author [email protected]
247
+     */
248
+    private static function is_date_column(& $data, $column)
249 249
     {
250
-		$is_date = true;
251
-		foreach ($data as $index => & $row) {
252
-			if (strlen(strip_tags($row[$column])) != 0) {
253
-				$check_date = strtotime(strip_tags($row[$column]));
254
-				// strtotime Returns a timestamp on success, FALSE otherwise.
255
-				// Previous to PHP 5.1.0, this function would return -1 on failure.
256
-				$is_date &= ($check_date != -1 && $check_date);
257
-			} else {
258
-				$is_date &= false;
259
-			}
260
-			if (!$is_date) {
261
-				break;
262
-			}
263
-		}
264
-		return $is_date;
265
-	}
250
+        $is_date = true;
251
+        foreach ($data as $index => & $row) {
252
+            if (strlen(strip_tags($row[$column])) != 0) {
253
+                $check_date = strtotime(strip_tags($row[$column]));
254
+                // strtotime Returns a timestamp on success, FALSE otherwise.
255
+                // Previous to PHP 5.1.0, this function would return -1 on failure.
256
+                $is_date &= ($check_date != -1 && $check_date);
257
+            } else {
258
+                $is_date &= false;
259
+            }
260
+            if (!$is_date) {
261
+                break;
262
+            }
263
+        }
264
+        return $is_date;
265
+    }
266 266
 
267
-	/**
268
-	 * Checks whether a column of a 2D-array contains only images (<img src="path/file.ext" alt=".."/>)
269
-	 * @param array $data		The data-array
270
-	 * @param int $column		The index of the column to check
271
-	 * @return bool				TRUE if column contains only images, FALSE otherwise
272
-	 * @author [email protected]
273
-	 */
274
-	private static function is_image_column(& $data, $column)
267
+    /**
268
+     * Checks whether a column of a 2D-array contains only images (<img src="path/file.ext" alt=".."/>)
269
+     * @param array $data		The data-array
270
+     * @param int $column		The index of the column to check
271
+     * @return bool				TRUE if column contains only images, FALSE otherwise
272
+     * @author [email protected]
273
+     */
274
+    private static function is_image_column(& $data, $column)
275 275
     {
276
-		$is_image = true;
277
-		foreach ($data as $index => & $row) {
278
-			$is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag
279
-			$is_image &= strlen(trim(strip_tags($row[$column]))) == 0; // and no text outside attribute-values
280
-			if (!$is_image) {
281
-				break;
282
-			}
283
-		}
284
-		return $is_image;
285
-	}
276
+        $is_image = true;
277
+        foreach ($data as $index => & $row) {
278
+            $is_image &= strlen(trim(strip_tags($row[$column], '<img>'))) > 0; // at least one img-tag
279
+            $is_image &= strlen(trim(strip_tags($row[$column]))) == 0; // and no text outside attribute-values
280
+            if (!$is_image) {
281
+                break;
282
+            }
283
+        }
284
+        return $is_image;
285
+    }
286 286
 }
Please login to merge, or discard this patch.
main/inc/lib/template.lib.php 2 patches
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -330,6 +330,7 @@  discard block
 block discarded – undo
330 330
     /**
331 331
      * Sets the footer visibility
332 332
      * @param bool true if we show the footer
333
+     * @param boolean $status
333 334
      */
334 335
     public function set_footer($status)
335 336
     {
@@ -370,6 +371,7 @@  discard block
 block discarded – undo
370 371
     /**
371 372
      * Sets the header visibility
372 373
      * @param bool true if we show the header
374
+     * @param boolean $status
373 375
      */
374 376
     public function set_header($status)
375 377
     {
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
                 $content = '<li class="help">';
265 265
                 $content .= Display::url(
266 266
                     Display::return_icon('help.large.png', get_lang('Help')),
267
-                    api_get_path(WEB_CODE_PATH) . 'help/help.php?open=' . $help,
267
+                    api_get_path(WEB_CODE_PATH).'help/help.php?open='.$help,
268 268
                     [
269 269
                         'class' => 'ajax',
270 270
                         'data-title' => get_lang('Help')
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
             'web_course' => api_get_path(WEB_COURSE_PATH),
479 479
             'web_main' => api_get_path(WEB_CODE_PATH),
480 480
             'web_css' => api_get_path(WEB_CSS_PATH),
481
-            'web_css_theme' => api_get_path(WEB_CSS_PATH) . 'themes/' . $this->theme . '/',
481
+            'web_css_theme' => api_get_path(WEB_CSS_PATH).'themes/'.$this->theme.'/',
482 482
             'web_ajax' => api_get_path(WEB_AJAX_PATH),
483 483
             'web_img' => api_get_path(WEB_IMG_PATH),
484 484
             'web_plugin' => api_get_path(WEB_PLUGIN_PATH),
@@ -536,12 +536,12 @@  discard block
 block discarded – undo
536 536
         foreach ($bowerCSSFiles as $file) {
537 537
             $css[] = api_get_path(WEB_PATH).'web/assets/'.$file;
538 538
         }
539
-        $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/bootstrap-select/css/bootstrap-select.min.css';
540
-        $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chosen/chosen.css';
541
-        $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/tag/style.css';
539
+        $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/bootstrap-select/css/bootstrap-select.min.css';
540
+        $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chosen/chosen.css';
541
+        $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css';
542 542
 
543 543
         if (api_is_global_chat_enabled()) {
544
-            $css[] = api_get_path(WEB_LIBRARY_PATH) . 'javascript/chat/css/chat.css';
544
+            $css[] = api_get_path(WEB_LIBRARY_PATH).'javascript/chat/css/chat.css';
545 545
         }
546 546
 
547 547
         //THEME CSS STYLE
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 
609 609
             $style_print = '';
610 610
             if (is_readable(api_get_path(SYS_CSS_PATH).$this->theme.'/print.css')) {
611
-                $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH) . $this->theme . '/print.css'),
611
+                $style_print = api_get_css(api_get_cdn_path(api_get_path(WEB_CSS_PATH).$this->theme.'/print.css'),
612 612
                     'print');
613 613
             }
614 614
             $this->assign('css_style_print', $style_print);
@@ -631,10 +631,10 @@  discard block
 block discarded – undo
631 631
 
632 632
         $isoCode = api_get_language_isocode();
633 633
 
634
-        $selectLink = 'bootstrap-select/js/i18n/defaults-' . $isoCode . '_' . strtoupper($isoCode) . '.min.js';
634
+        $selectLink = 'bootstrap-select/js/i18n/defaults-'.$isoCode.'_'.strtoupper($isoCode).'.min.js';
635 635
 
636 636
         if ($isoCode == 'en') {
637
-            $selectLink = 'bootstrap-select/js/i18n/defaults-' . $isoCode . '_US.min.js';
637
+            $selectLink = 'bootstrap-select/js/i18n/defaults-'.$isoCode.'_US.min.js';
638 638
         }
639 639
         // JS files
640 640
         $js_files = array(
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
         }
685 685
 
686 686
         if ($isoCode != 'en') {
687
-            $bowerJsFiles[] = 'jqueryui-timepicker-addon/dist/i18n/jquery-ui-timepicker-' . $isoCode . '.js';
688
-            $bowerJsFiles[] = 'jquery-ui/ui/minified/i18n/datepicker-' . $isoCode . '.min.js';
687
+            $bowerJsFiles[] = 'jqueryui-timepicker-addon/dist/i18n/jquery-ui-timepicker-'.$isoCode.'.js';
688
+            $bowerJsFiles[] = 'jquery-ui/ui/minified/i18n/datepicker-'.$isoCode.'.min.js';
689 689
         }
690 690
 
691 691
         foreach ($bowerJsFiles as $file) {
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
         }
767 767
 
768 768
         $this->assign('online_button', Display::return_icon('statusonline.png', null, null, ICON_SIZE_ATOM));
769
-        $this->assign('offline_button',Display::return_icon('statusoffline.png', null, null, ICON_SIZE_ATOM));
769
+        $this->assign('offline_button', Display::return_icon('statusoffline.png', null, null, ICON_SIZE_ATOM));
770 770
 
771 771
         // Get language iso-code for this page - ignore errors
772 772
         $this->assign('document_language', api_get_language_isocode());
@@ -825,15 +825,15 @@  discard block
 block discarded – undo
825 825
         $this->assign('section_name', 'section-'.$this_section);
826 826
 
827 827
         //Defaul root chamilo favicon
828
-        $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_PATH) . 'favicon.ico" type="image/x-icon" />';
828
+        $favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_PATH).'favicon.ico" type="image/x-icon" />';
829 829
 
830 830
         //Added to verify if in the current Chamilo Theme exist a favicon
831
-        $favicoThemeUrl = api_get_path(SYS_CSS_PATH) . 'themes/' . $this->theme . '/images/';
831
+        $favicoThemeUrl = api_get_path(SYS_CSS_PATH).'themes/'.$this->theme.'/images/';
832 832
 
833 833
         //If exist pick the current chamilo theme favicon
834
-        if (is_file($favicoThemeUrl . 'favicon.ico')) {
835
-            $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_CSS_PATH)
836
-                . 'themes/' . $this->theme . '/images/favicon.ico" type="image/x-icon" />';
834
+        if (is_file($favicoThemeUrl.'favicon.ico')) {
835
+            $favico = '<link rel="shortcut icon" href="'.api_get_path(WEB_CSS_PATH)
836
+                . 'themes/'.$this->theme.'/images/favicon.ico" type="image/x-icon" />';
837 837
         }
838 838
 
839 839
         if (api_is_multiple_url_enabled()) {
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
         if (api_get_setting('show_link_bug_notification') == 'true' && $this->user_is_logged_in) {
864 864
             $bug_notification_link = '<li class="report">
865 865
 		<a href="http://support.chamilo.org/projects/chamilo-18/wiki/How_to_report_bugs" target="_blank">
866
-                    '. $iconBug . '
866
+                    '. $iconBug.'
867 867
                 </a>
868 868
 		</li>';
869 869
         }
@@ -975,13 +975,13 @@  discard block
 block discarded – undo
975 975
         $socialMeta = '';
976 976
         $metaTitle = api_get_setting('meta_title');
977 977
         if (!empty($metaTitle)) {
978
-            $socialMeta .= '<meta name="twitter:card" content="summary" />' . "\n";
978
+            $socialMeta .= '<meta name="twitter:card" content="summary" />'."\n";
979 979
             $metaSite = api_get_setting('meta_twitter_site');
980 980
             if (!empty($metaSite)) {
981
-                $socialMeta .= '<meta name="twitter:site" content="' . $metaSite . '" />' . "\n";
981
+                $socialMeta .= '<meta name="twitter:site" content="'.$metaSite.'" />'."\n";
982 982
                 $metaCreator = api_get_setting('meta_twitter_creator');
983 983
                 if (!empty($metaCreator)) {
984
-                    $socialMeta .= '<meta name="twitter:creator" content="' . $metaCreator . '" />' . "\n";
984
+                    $socialMeta .= '<meta name="twitter:creator" content="'.$metaCreator.'" />'."\n";
985 985
                 }
986 986
             }
987 987
 
@@ -993,19 +993,19 @@  discard block
 block discarded – undo
993 993
             if (!$userId && !$skillId) {
994 994
                 // no combination of user and skill ID has been defined,
995 995
                 // so print the normal OpenGraph meta tags
996
-                $socialMeta .= '<meta property="og:title" content="' . $metaTitle . '" />' . "\n";
997
-                $socialMeta .= '<meta property="og:url" content="' . api_get_path(WEB_PATH) . '" />' . "\n";
996
+                $socialMeta .= '<meta property="og:title" content="'.$metaTitle.'" />'."\n";
997
+                $socialMeta .= '<meta property="og:url" content="'.api_get_path(WEB_PATH).'" />'."\n";
998 998
 
999 999
                 $metaDescription = api_get_setting('meta_description');
1000 1000
                 if (!empty($metaDescription)) {
1001
-                    $socialMeta .= '<meta property="og:description" content="' . $metaDescription . '" />' . "\n";
1001
+                    $socialMeta .= '<meta property="og:description" content="'.$metaDescription.'" />'."\n";
1002 1002
                 }
1003 1003
 
1004 1004
                 $metaImage = api_get_setting('meta_image_path');
1005 1005
                 if (!empty($metaImage)) {
1006
-                    if (is_file(api_get_path(SYS_PATH) . $metaImage)) {
1007
-                        $path = api_get_path(WEB_PATH) . $metaImage;
1008
-                        $socialMeta .= '<meta property="og:image" content="' . $path . '" />' . "\n";
1006
+                    if (is_file(api_get_path(SYS_PATH).$metaImage)) {
1007
+                        $path = api_get_path(WEB_PATH).$metaImage;
1008
+                        $socialMeta .= '<meta property="og:image" content="'.$path.'" />'."\n";
1009 1009
                     }
1010 1010
                 }
1011 1011
             }
@@ -1039,7 +1039,7 @@  discard block
 block discarded – undo
1039 1039
         // Tutor name
1040 1040
         if (api_get_setting('show_tutor_data') == 'true') {
1041 1041
             // Course manager
1042
-            $courseId  = api_get_course_int_id();
1042
+            $courseId = api_get_course_int_id();
1043 1043
             $id_session = api_get_session_id();
1044 1044
             if (!empty($courseId)) {
1045 1045
                 $tutor_data = '';
@@ -1071,7 +1071,7 @@  discard block
 block discarded – undo
1071 1071
             $courseId = api_get_course_int_id();
1072 1072
             if (!empty($courseId)) {
1073 1073
                 $teacher_data = '';
1074
-                $mail= CourseManager::get_emails_of_tutors_to_course($courseId);
1074
+                $mail = CourseManager::get_emails_of_tutors_to_course($courseId);
1075 1075
                 if (!empty($mail)) {
1076 1076
                     $teachers_parsed = array();
1077 1077
                     foreach ($mail as $value) {
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
                     'sessionVar'   => basename(__FILE__, '.php'),
1306 1306
                     'imageOptions' => array(
1307 1307
                         'font_size' => 20,
1308
-                        'font_path' => api_get_path(SYS_FONTS_PATH) . 'opensans/',
1308
+                        'font_path' => api_get_path(SYS_FONTS_PATH).'opensans/',
1309 1309
                         'font_file' => 'OpenSans-Regular.ttf',
1310 1310
                         //'output' => 'gif'
1311 1311
                     )
Please login to merge, or discard this patch.