Completed
Push — 1.11.x ( 6c3085...b368fe )
by José
83:26 queued 56:20
created
main/inc/local.inc.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -758,7 +758,7 @@
 block discarded – undo
758 758
     //    $gidReset = true;
759 759
 } // end else
760 760
 
761
- // Now check for anonymous user mode
761
+    // Now check for anonymous user mode
762 762
 if (isset($use_anonymous) && $use_anonymous) {
763 763
     //if anonymous mode is set, then try to set the current user as anonymous
764 764
     //if he doesn't have a login yet
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
             // is necessary verify check
218 218
             if ($legal_type == 1) {
219
-                if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) {
219
+                if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) {
220 220
                     $legal_option = true;
221 221
                 } else {
222 222
                     $legal_option = false;
@@ -504,7 +504,7 @@  discard block
 block discarded – undo
504 504
                  * Process external authentication
505 505
                  * on the basis of the given login name
506 506
                  */
507
-                $loginFailed = true;  // Default initialisation. It could
507
+                $loginFailed = true; // Default initialisation. It could
508 508
                 // change after the external authentication
509 509
                 $key = $uData['auth_source']; //'ldap','shibboleth'...
510 510
 
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                      * Process external authentication
550 550
                      * on the basis of the given login name
551 551
                      */
552
-                    $loginFailed = true;  // Default initialisation. It could
552
+                    $loginFailed = true; // Default initialisation. It could
553 553
                     // change after the external authentication
554 554
                     $key = $uData['auth_source']; //'ldap','shibboleth'...
555 555
 
@@ -560,11 +560,11 @@  discard block
 block discarded – undo
560 560
             } else {
561 561
                 // change after the external authentication
562 562
                 // login failed, Database::num_rows($result) <= 0
563
-                $loginFailed = true;  // Default initialisation. It could
563
+                $loginFailed = true; // Default initialisation. It could
564 564
             }
565 565
 
566 566
             // login failed, Database::num_rows($result) <= 0
567
-            $loginFailed = true;  // Default initialisation. It could
567
+            $loginFailed = true; // Default initialisation. It could
568 568
             // change after the external authentication
569 569
 
570 570
             /*
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
                         include_once($thisAuthSource['newUser']);
594 594
                     } else {
595 595
                         error_log(
596
-                            'Chamilo Authentication external file' .
596
+                            'Chamilo Authentication external file'.
597 597
                             ' could not be found - this might prevent your system from using'.
598 598
                             ' the authentication process in the user creation process',
599 599
                             0
@@ -705,7 +705,7 @@  discard block
 block discarded – undo
705 705
             online_logout(null, false);
706 706
             $osso->logout(); //redirects and exits
707 707
         }
708
-    } elseif (api_get_setting('openid_authentication')=='true') {
708
+    } elseif (api_get_setting('openid_authentication') == 'true') {
709 709
         if (!empty($_POST['openid_url'])) {
710 710
             include api_get_path(SYS_CODE_PATH).'auth/openid/login.php';
711 711
             openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php');
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
             if ($res['status'] == 'success') {
719 719
                 $id1 = Database::escape_string($res['openid.identity']);
720 720
                 //have another id with or without the final '/'
721
-                $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/');
721
+                $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/');
722 722
                 //lookup the user in the main database
723 723
                 $user_table = Database::get_main_table(TABLE_MAIN_USER);
724 724
                 $sql = "SELECT user_id, username, password, auth_source, active, expiration_date
@@ -727,14 +727,14 @@  discard block
 block discarded – undo
727 727
                         OR openid = '$id2' ";
728 728
                 $result = Database::query($sql);
729 729
                 if ($result !== false) {
730
-                    if (Database::num_rows($result)>0) {
730
+                    if (Database::num_rows($result) > 0) {
731 731
                         $uData = Database::fetch_array($result);
732 732
 
733 733
                         if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
734 734
                             //the authentification of this user is managed by Chamilo itself
735 735
 
736 736
                             // check if the account is active (not locked)
737
-                            if ($uData['active']=='1') {
737
+                            if ($uData['active'] == '1') {
738 738
                                 // check if the expiration date has not been reached
739 739
                                 if ($uData['expiration_date'] > date('Y-m-d H:i:s')
740 740
                                     || empty($uData['expiration_date'])
@@ -813,7 +813,7 @@  discard block
 block discarded – undo
813 813
     (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
814 814
 ) {
815 815
     $cidReset = true;
816
-    $gidReset = true;    // As groups depend from courses, group id is reset
816
+    $gidReset = true; // As groups depend from courses, group id is reset
817 817
 }
818 818
 
819 819
 /* USER INIT */
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
             $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
958 958
 
959 959
             if (!empty($_GET['id_session'])) {
960
-                $sql = 'SELECT name FROM '.$tbl_session . '
961
-                        WHERE id="'.intval($_GET['id_session']) . '"';
960
+                $sql = 'SELECT name FROM '.$tbl_session.'
961
+                        WHERE id="'.intval($_GET['id_session']).'"';
962 962
                 $rs = Database::query($sql);
963 963
                 if (Database::num_rows($rs)) {
964 964
                     list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
         // Moreover, if we want to track a course with another session it can be usefull
1046 1046
         if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) {
1047 1047
             $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1048
-            $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"';
1048
+            $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"';
1049 1049
             $rs = Database::query($sql);
1050 1050
             if (Database::num_rows($rs)) {
1051 1051
                 list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
                     }
1170 1170
                 }
1171 1171
                 $url = api_get_path(WEB_CODE_PATH).'auth/inscription.php';
1172
-                header("Location:". $url);
1172
+                header("Location:".$url);
1173 1173
                 exit;
1174 1174
             }
1175 1175
         }
@@ -1189,8 +1189,8 @@  discard block
 block discarded – undo
1189 1189
         if (Database::num_rows($result) > 0) { // this  user have a recorded state for this course
1190 1190
             $cuData = Database::fetch_array($result, 'ASSOC');
1191 1191
 
1192
-            $is_courseAdmin = (bool)($cuData['status'] == 1);
1193
-            $is_courseTutor = (bool)($cuData['is_tutor'] == 1);
1192
+            $is_courseAdmin = (bool) ($cuData['status'] == 1);
1193
+            $is_courseTutor = (bool) ($cuData['is_tutor'] == 1);
1194 1194
             $is_courseMember = true;
1195 1195
         }
1196 1196
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
                 // This user has no status related to this course
1202 1202
                 // The user is subscribed in a session? The user is a Session coach a Session admin ?
1203 1203
 
1204
-                $tbl_session  = Database :: get_main_table(TABLE_MAIN_SESSION);
1204
+                $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1205 1205
                 $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
1206 1206
                 $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1207 1207
 
@@ -1506,12 +1506,12 @@  discard block
 block discarded – undo
1506 1506
     ($logging_in && exist_firstpage_parameter())
1507 1507
 ) {
1508 1508
     $redirectCourseDir = api_get_firstpage_parameter();
1509
-    api_delete_firstpage_parameter();    // delete the cookie
1509
+    api_delete_firstpage_parameter(); // delete the cookie
1510 1510
 
1511 1511
     if (!isset($_SESSION['request_uri'])) {
1512 1512
         if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1513 1513
             $_SESSION['noredirection'] = false;
1514
-            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1514
+            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1515 1515
         }
1516 1516
     }
1517 1517
 } elseif (api_user_is_login() && exist_firstpage_parameter()) {
@@ -1519,7 +1519,7 @@  discard block
 block discarded – undo
1519 1519
     api_delete_firstpage_parameter(); // delete the cookie
1520 1520
     if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1521 1521
         $_SESSION['noredirection'] = false;
1522
-        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1522
+        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1523 1523
     }
1524 1524
 }
1525 1525
 
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
      *
197 197
      * @return array
198 198
      */
199
-    public function sender($key = '',  $userId = '')
199
+    public function sender($key = '', $userId = '')
200 200
     {
201 201
         $_user = api_get_user_info($userId);
202 202
 
Please login to merge, or discard this patch.
main/inc/lib/custom_pages.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function path($name = '')
37 37
     {
38
-        return api_get_path(SYS_PATH) . 'custompages/' . $name;
38
+        return api_get_path(SYS_PATH).'custompages/'.$name;
39 39
     }
40 40
 
41 41
     /**
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
             return false;
51 51
         }
52 52
 
53
-        $file = self::path($page_name . '.php');
53
+        $file = self::path($page_name.'.php');
54 54
         if (file_exists($file)) {
55 55
             include($file);
56 56
             exit;
57 57
         } else {
58
-            error_log('CustomPages::displayPage : could not read file ' . $file);
58
+            error_log('CustomPages::displayPage : could not read file '.$file);
59 59
         }
60 60
     }
61 61
 
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
     public static function getURLImages($url_id = null)
70 70
     {
71 71
         if (is_null($url_id)) {
72
-            $url = 'http://' . $_SERVER['HTTP_HOST'] . '/';
72
+            $url = 'http://'.$_SERVER['HTTP_HOST'].'/';
73 73
             $url_id = UrlManager::get_url_id($url);
74 74
         }
75
-        $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
75
+        $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
76 76
         $images = array();
77 77
         for ($img_id = 1; $img_id <= 3; $img_id++) {
78
-            if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) {
79
-                $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png';
78
+            if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) {
79
+                $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png';
80 80
             }
81 81
         }
82 82
 
Please login to merge, or discard this patch.
main/inc/lib/sub_language.class.php 3 patches
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.
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,6 +41,7 @@  discard block
 block discarded – undo
41 41
      * Get all files of lang folder (forum.inc.php,gradebook.inc.php,notebook.inc.php)
42 42
      * @param string The lang path folder  (/var/www/my_lms/main/lang/spanish)
43 43
      * @param bool true if we only want the "subname" trad4all instead of  trad4all.inc.php
44
+     * @param string $path
44 45
      *
45 46
      * @return array All file of lang folder
46 47
      */
@@ -91,6 +92,7 @@  discard block
 block discarded – undo
91 92
     /**
92 93
      * Get all information of language
93 94
      * @param Integer The parent id(Language father id)
95
+     * @param integer $parent_id
94 96
      * @return array All information about language
95 97
      */
96 98
     public static function get_all_information_of_language($parent_id)
@@ -109,6 +111,7 @@  discard block
 block discarded – undo
109 111
     /**
110 112
      * Get all information of chamilo file
111 113
      * @param string The chamilo path file (/var/www/chamilo/main/lang/spanish/gradebook.inc.php)
114
+     * @param string $system_path_file
112 115
      * @patam Bool Whether we want to remove the '$' prefix in the results or not
113 116
      * @return array Contains all information of chamilo file
114 117
      */
@@ -369,7 +372,7 @@  discard block
 block discarded – undo
369 372
     /**
370 373
      * Make available the language
371 374
      * @param int The language id
372
-     * @return void
375
+     * @return boolean
373 376
      */
374 377
     public static function make_available_language($language_id)
375 378
     {
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/redirect.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             self::navigate($url);
35 35
         }
36 36
 
37
-        $url = self::www() . $url;
37
+        $url = self::www().$url;
38 38
         self::navigate($url);
39 39
     }
40 40
 
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
                     case COURSEMANAGER:
68 68
                         $redir = api_get_setting('teacher_page_after_login');
69 69
                         if (!empty($redir)) {
70
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
70
+                            self::navigate(api_get_path(WEB_PATH).$redir);
71 71
                         }
72 72
                         break;
73 73
                     case STUDENT:
74 74
                         $redir = api_get_setting('student_page_after_login');
75 75
                         if (!empty($redir)) {
76
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
76
+                            self::navigate(api_get_path(WEB_PATH).$redir);
77 77
                         }
78 78
                         break;
79 79
                     case DRH:
80 80
                         $redir = api_get_setting('drh_page_after_login');
81 81
                         if (!empty($redir)) {
82
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
82
+                            self::navigate(api_get_path(WEB_PATH).$redir);
83 83
                         }
84 84
                         break;
85 85
                     case SESSIONADMIN:
86 86
                         $redir = api_get_setting('sessionadmin_page_after_login');
87 87
                         if (!empty($redir)) {
88
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
88
+                            self::navigate(api_get_path(WEB_PATH).$redir);
89 89
                         }
90 90
                         break;
91 91
                     default:
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             }
112 112
             $page_after_login = api_get_setting('page_after_login');
113 113
             if (!empty($page_after_login)) {
114
-                self::navigate(api_get_path(WEB_PATH) . $page_after_login);
114
+                self::navigate(api_get_path(WEB_PATH).$page_after_login);
115 115
             }
116 116
         }
117 117
     }
Please login to merge, or discard this patch.
main/inc/lib/diagnoser.lib.php 4 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -401,19 +401,19 @@
 block discarded – undo
401 401
 
402 402
     public function format_yes_no_optional($value)
403 403
     {
404
-    	$return = '';
405
-    	switch($value) {
406
-     		case 0:
407
-     			$return = get_lang('No');
408
-     			break;
409
-     		case 1:
410
-     			$return = get_lang('Yes');
411
-     			break;
412
-			case 2:
413
-				$return = get_lang('Optional');
414
-				break;
415
-    	}
416
-    	return $return;
404
+        $return = '';
405
+        switch($value) {
406
+                case 0:
407
+                 $return = get_lang('No');
408
+                    break;
409
+                case 1:
410
+                 $return = get_lang('Yes');
411
+                    break;
412
+            case 2:
413
+                $return = get_lang('Optional');
414
+                break;
415
+        }
416
+        return $return;
417 417
 
418 418
     }
419 419
 
Please login to merge, or discard this patch.
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -158,8 +158,9 @@  discard block
 block discarded – undo
158 158
         $array[] = $this->build_setting($status, '[INI]', 'display_errors', 'http://www.php.net/manual/en/ini.core.php#ini.display_errors', $setting, $req_setting, 'on_off', get_lang('DisplayErrorsInfo'));
159 159
 
160 160
         $setting = ini_get('default_charset');
161
-        if ($setting == '')
162
-            $setting = null;
161
+        if ($setting == '') {
162
+                    $setting = null;
163
+        }
163 164
         $req_setting = null;
164 165
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_ERROR;
165 166
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
@@ -177,22 +178,25 @@  discard block
 block discarded – undo
177 178
         $setting = ini_get('memory_limit');
178 179
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
179 180
         $status = self :: STATUS_ERROR;
180
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
181
-            $status = self :: STATUS_OK;
181
+        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT) {
182
+                    $status = self :: STATUS_OK;
183
+        }
182 184
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
183 185
 
184 186
         $setting = ini_get('post_max_size');
185 187
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
186 188
         $status = self :: STATUS_ERROR;
187
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
188
-            $status = self :: STATUS_OK;
189
+        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE) {
190
+                    $status = self :: STATUS_OK;
191
+        }
189 192
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
190 193
 
191 194
         $setting = ini_get('upload_max_filesize');
192 195
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
193 196
         $status = self :: STATUS_ERROR;
194
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
195
-            $status = self :: STATUS_OK;
197
+        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE) {
198
+                    $status = self :: STATUS_OK;
199
+        }
196 200
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
197 201
 
198 202
         $setting = ini_get('variables_order');
@@ -205,7 +209,7 @@  discard block
 block discarded – undo
205 209
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
206 210
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
207 211
 
208
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
212
+        if (api_check_browscap()){$setting = true;} else{$setting=false;}
209 213
         $req_setting = true;
210 214
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
211 215
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     const STATUS_OK = 1;
17 17
     const STATUS_WARNING = 2;
18
-    const STATUS_ERROR 	= 3;
18
+    const STATUS_ERROR = 3;
19 19
     const STATUS_INFORMATION = 4;
20 20
 
21 21
     /**
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
                 $html .= '<li>';
43 43
             }
44 44
             $params['section'] = $section;
45
-            $html .='<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
45
+            $html .= '<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
46 46
         }
47 47
 
48 48
         $html .= '</ul><div class="tab-pane">';
49 49
 
50
-        $data = call_user_func(array($this, 'get_' . $currentSection . '_data'));
50
+        $data = call_user_func(array($this, 'get_'.$currentSection.'_data'));
51 51
         echo $html;
52 52
 
53 53
         if ($currentSection != 'paths') {
@@ -114,11 +114,11 @@  discard block
 block discarded – undo
114 114
     {
115 115
         $array = array();
116 116
         $writable_folders = array(
117
-            api_get_path(SYS_APP_PATH) .'cache',
117
+            api_get_path(SYS_APP_PATH).'cache',
118 118
             api_get_path(SYS_COURSE_PATH),
119
-            api_get_path(SYS_APP_PATH) .'home',
120
-            api_get_path(SYS_APP_PATH) .'upload/users/',
121
-            api_get_path(SYS_PATH) .'main/default_course_document/images/',
119
+            api_get_path(SYS_APP_PATH).'home',
120
+            api_get_path(SYS_APP_PATH).'upload/users/',
121
+            api_get_path(SYS_PATH).'main/default_course_document/images/',
122 122
         );
123 123
         foreach ($writable_folders as $index => $folder) {
124 124
             $writable = is_writable($folder);
@@ -137,10 +137,10 @@  discard block
 block discarded – undo
137 137
 
138 138
         $exists = file_exists(api_get_path(SYS_CODE_PATH).'install');
139 139
         $status = $exists ? self :: STATUS_WARNING : self :: STATUS_OK;
140
-        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists') . ': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
140
+        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists').': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
141 141
 
142 142
         $app_version = api_get_setting('chamilo_database_version');
143
-        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null,  'Chamilo DB version');
143
+        $array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null, 'Chamilo DB version');
144 144
 
145 145
         $access_url_id = api_get_current_access_url_id();
146 146
 
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                     $message2 .= get_lang('SpaceUsedOnSystemCannotBeMeasuredOnWindows');
153 153
                 } else {
154 154
                     $dir = api_get_path(SYS_PATH);
155
-                    $du = exec('du -sh ' . $dir, $err);
155
+                    $du = exec('du -sh '.$dir, $err);
156 156
                     list($size, $none) = explode("\t", $du);
157 157
                     $limit = $_configuration[$access_url_id]['hosting_limit_disk_space'];
158 158
                     $message2 .= sprintf(get_lang('TotalSpaceUsedByPortalXLimitIsYMB'), $size, $limit);
@@ -236,33 +236,33 @@  discard block
 block discarded – undo
236 236
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
237 237
 
238 238
         $setting = ini_get('max_execution_time');
239
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
239
+        $req_setting = '300 ('.get_lang('Minimum').')';
240 240
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
241 241
         $array[] = $this->build_setting($status, '[INI]', 'max_execution_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-execution-time', $setting, $req_setting, null, get_lang('MaxExecutionTimeInfo'));
242 242
 
243 243
         $setting = ini_get('max_input_time');
244
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
244
+        $req_setting = '300 ('.get_lang('Minimum').')';
245 245
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
246 246
         $array[] = $this->build_setting($status, '[INI]', 'max_input_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-input-time', $setting, $req_setting, null, get_lang('MaxInputTimeInfo'));
247 247
 
248 248
         $setting = ini_get('memory_limit');
249 249
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
250 250
         $status = self :: STATUS_ERROR;
251
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
251
+        if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT)
252 252
             $status = self :: STATUS_OK;
253 253
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
254 254
 
255 255
         $setting = ini_get('post_max_size');
256 256
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
257 257
         $status = self :: STATUS_ERROR;
258
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
258
+        if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE)
259 259
             $status = self :: STATUS_OK;
260 260
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
261 261
 
262 262
         $setting = ini_get('upload_max_filesize');
263 263
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
264 264
         $status = self :: STATUS_ERROR;
265
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
265
+        if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
266 266
             $status = self :: STATUS_OK;
267 267
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
268 268
 
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
277 277
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
278 278
 
279
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
279
+        if (api_check_browscap()) {$setting = true; } else {$setting = false; }
280 280
         $req_setting = true;
281 281
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
282 282
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
             $loaded = extension_loaded($extension);
334 334
             $status = $loaded ? self :: STATUS_OK : self :: STATUS_ERROR;
335
-            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension') . ': ' . $extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
335
+            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension').': '.$extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
336 336
         }
337 337
 
338 338
         return $array;
@@ -455,9 +455,9 @@  discard block
 block discarded – undo
455 455
         $formatted_expected_value = $expected_value;
456 456
 
457 457
         if ($formatter) {
458
-            if (method_exists($this, 'format_' . $formatter)) {
459
-                $formatted_current_value = call_user_func(array($this, 'format_' . $formatter), $current_value);
460
-                $formatted_expected_value = call_user_func(array($this, 'format_' . $formatter), $expected_value);
458
+            if (method_exists($this, 'format_'.$formatter)) {
459
+                $formatted_current_value = call_user_func(array($this, 'format_'.$formatter), $current_value);
460
+                $formatted_expected_value = call_user_func(array($this, 'format_'.$formatter), $expected_value);
461 461
             }
462 462
         }
463 463
 
@@ -472,13 +472,13 @@  discard block
 block discarded – undo
472 472
      */
473 473
     public function get_link($title, $url)
474 474
     {
475
-        return '<a href="' . $url . '" target="about:bank">' . $title . '</a>';
475
+        return '<a href="'.$url.'" target="about:bank">'.$title.'</a>';
476 476
     }
477 477
 
478 478
     public function format_yes_no_optional($value)
479 479
     {
480 480
     	$return = '';
481
-    	switch($value) {
481
+    	switch ($value) {
482 482
      		case 0:
483 483
      			$return = get_lang('No');
484 484
      			break;
Please login to merge, or discard this patch.
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -435,6 +435,12 @@
 block discarded – undo
435 435
 
436 436
     /**
437 437
      * Additional functions needed for fast integration
438
+     * @param integer $status
439
+     * @param string $section
440
+     * @param string $title
441
+     * @param string $url
442
+     * @param string|null $formatter
443
+     * @param string $comment
438 444
      */
439 445
     public function build_setting(
440 446
         $status,
Please login to merge, or discard this patch.
main/inc/lib/extra_field_value.lib.php 3 patches
Indentation   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -720,11 +720,11 @@  discard block
 block discarded – undo
720 720
         return false;
721 721
     }
722 722
 
723
-     /**
724
-     * @param int $itemId
725
-     * @param int $fieldId
726
-     * @return array
727
-     */
723
+        /**
724
+         * @param int $itemId
725
+         * @param int $fieldId
726
+         * @return array
727
+         */
728 728
     public function getAllValuesByItemAndField($itemId, $fieldId)
729 729
     {
730 730
         $fieldId = intval($fieldId);
@@ -847,7 +847,6 @@  discard block
 block discarded – undo
847 847
     /**
848 848
      * Deletes all values from an item
849 849
      * @param int $itemId (session id, course id, etc)
850
-
851 850
      * @assert (-1,-1) == null
852 851
      */
853 852
     public function deleteValuesByItem($itemId)
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      * This function is used with $extraField->addElements()
76 76
      * @param array $params array for the insertion into the *_field_values table
77 77
      * @param bool $showQuery
78
-     * @return mixed false on empty params, void otherwise
78
+     * @return false|null false on empty params, void otherwise
79 79
      * @assert (array()) === false
80 80
      */
81 81
     public function saveFieldValues($params, $showQuery = false)
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
      * @param int $item_id Item ID (It could be a session_id, course_id or user_id)
532 532
      * @param int $field_id Field ID (the ID from the *_field table)
533 533
      * @param bool $transform Whether to transform the result to a human readable strings
534
-     * @return mixed A structured array with the field_id and field_value, or false on error
534
+     * @return string A structured array with the field_id and field_value, or false on error
535 535
      * @assert (-1,-1) === false
536 536
      */
537 537
     public function get_values_by_handler_and_field_id($item_id, $field_id, $transform = false)
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
      * @param int $item_id Item ID from the original table
625 625
      * @param string $field_variable The name of the field we are looking for
626 626
      * @param bool $transform
627
-     * @param bool $allVisibility
627
+     * @param bool $visibility
628 628
      *
629 629
      * @return mixed Array of results, or false on error or not found
630 630
      * @assert (-1,'') === false
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                             break;
219 219
                     }
220 220
 
221
-                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE . "_{$params['item_id']}.png";
221
+                    $fileName = ExtraField::FIELD_TYPE_FILE_IMAGE."_{$params['item_id']}.png";
222 222
 
223 223
                     if (!file_exists($fileDir)) {
224 224
                         mkdir($fileDir, $dirPermissions, true);
@@ -227,15 +227,15 @@  discard block
 block discarded – undo
227 227
                     if ($value['error'] == 0) {
228 228
                         //Crop the image to adjust 16:9 ratio
229 229
                         $crop = new Image($value['tmp_name']);
230
-                        $crop->crop($params['extra_' . $field_variable . '_crop_result']);
230
+                        $crop->crop($params['extra_'.$field_variable.'_crop_result']);
231 231
 
232 232
                         $imageExtraField = new Image($value['tmp_name']);
233 233
                         $imageExtraField->resize(400);
234
-                        $imageExtraField->send_image($fileDir . $fileName, -1, 'png');
234
+                        $imageExtraField->send_image($fileDir.$fileName, -1, 'png');
235 235
                         $newParams = array(
236 236
                             'item_id' => $params['item_id'],
237 237
                             'field_id' => $extraFieldInfo['id'],
238
-                            'value' => $fileDirStored . $fileName,
238
+                            'value' => $fileDirStored.$fileName,
239 239
                             'comment' => $comment
240 240
                         );
241 241
                         self::save($newParams);
@@ -260,18 +260,18 @@  discard block
 block discarded – undo
260 260
                     }
261 261
 
262 262
                     $cleanedName = api_replace_dangerous_char($value['name']);
263
-                    $fileName = ExtraField::FIELD_TYPE_FILE . "_{$params['item_id']}_$cleanedName";
263
+                    $fileName = ExtraField::FIELD_TYPE_FILE."_{$params['item_id']}_$cleanedName";
264 264
                     if (!file_exists($fileDir)) {
265 265
                         mkdir($fileDir, $dirPermissions, true);
266 266
                     }
267 267
 
268 268
                     if ($value['error'] == 0) {
269
-                        moveUploadedFile($value, $fileDir . $fileName);
269
+                        moveUploadedFile($value, $fileDir.$fileName);
270 270
 
271 271
                         $new_params = array(
272 272
                             'item_id' => $params['item_id'],
273 273
                             'field_id' => $extraFieldInfo['id'],
274
-                            'value' => $fileDirStored . $fileName
274
+                            'value' => $fileDirStored.$fileName
275 275
                         );
276 276
 
277 277
                         if ($this->type !== 'session' && $this->type !== 'course') {
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
                 */
473 473
                 if (false) {
474 474
                     global $app;
475
-                    switch($this->type) {
475
+                    switch ($this->type) {
476 476
                         case 'question':
477 477
                             $extraFieldValue = $app['orm.ems']['db_write']->getRepository('ChamiloLMS\Entity\QuestionFieldValues')->find($field_values['id']);
478 478
                             $extraFieldValue->setUserId(api_get_user_id());
Please login to merge, or discard this patch.
main/inc/lib/export.lib.inc.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         }
100 100
         foreach ($data as $row) {
101 101
             $string = implode("</td><td>", $row);
102
-            $string = '<tr><td>' . $string . '</td></tr>';
102
+            $string = '<tr><td>'.$string.'</td></tr>';
103 103
             if ($encoding != 'utf-8') {
104 104
                 $string = api_convert_encoding($string, $encoding, $systemEncoding);
105 105
             }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             fwrite($handle, '<'.$wrapper_tagname.'>');
174 174
         }
175 175
         $s = self::_export_complex_table_xml_helper($data);
176
-        fwrite($handle,$s);
176
+        fwrite($handle, $s);
177 177
         if (!is_null($wrapper_tagname)) {
178 178
             fwrite($handle, '</'.$wrapper_tagname.'>'."\n");
179 179
         }
@@ -195,10 +195,10 @@  discard block
 block discarded – undo
195 195
         }
196 196
         $string = '';
197 197
         foreach ($data as $row) {
198
-            $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
198
+            $string .= "\n".str_repeat("\t", $level).'<'.$row['name'].'>';
199 199
             if (is_array($row['value'])) {
200
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
201
-                $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
200
+            	$string .= self::_export_complex_table_xml_helper($row['value'], $level + 1)."\n";
201
+                $string .= str_repeat("\t", $level).'</'.$row['name'].'>';
202 202
             } else {
203 203
                 $string .= $row['value'];
204 204
                 $string .= '</'.$row['name'].'>';
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
      * @param array $data
39 39
      * @param string $filename
40 40
      *
41
-     * @return mixed csv file | false if no data to export
41
+     * @return false|null csv file | false if no data to export
42 42
      */
43 43
     public static function arrayToCsv($data, $filename = 'export')
44 44
     {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
      * @param string Name of common tag to place each line in
161 161
      * @param string Name of the root element. A root element should always be given.
162 162
      * @param string Encoding in which the data is provided
163
-     * @return void  Prompts the user for a file download
163
+     * @return boolean  Prompts the user for a file download
164 164
      */
165 165
     public static function export_complex_table_xml(
166 166
         $data,
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
      * @param string $name
287 287
      * @param string $format
288 288
      *
289
-     * @return bool
289
+     * @return false|null
290 290
      */
291 291
     public static function htmlToOdt($html, $name, $format = 'odt')
292 292
     {
Please login to merge, or discard this patch.
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -115,13 +115,13 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     /**
118
-    * Export tabular data to XML-file
119
-    * @param array  Simple array of data to put in XML
120
-    * @param string Name of file to be given to the user
121
-    * @param string Name of common tag to place each line in
122
-    * @param string Name of the root element. A root element should always be given.
123
-    * @param string Encoding in which the data is provided
124
-    */
118
+     * Export tabular data to XML-file
119
+     * @param array  Simple array of data to put in XML
120
+     * @param string Name of file to be given to the user
121
+     * @param string Name of common tag to place each line in
122
+     * @param string Name of the root element. A root element should always be given.
123
+     * @param string Encoding in which the data is provided
124
+     */
125 125
     public static function arrayToXml(
126 126
         $data,
127 127
         $filename = 'export',
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
         foreach ($data as $row) {
201 201
             $string .= "\n".str_repeat("\t",$level).'<'.$row['name'].'>';
202 202
             if (is_array($row['value'])) {
203
-            	$string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
203
+                $string .= self::_export_complex_table_xml_helper($row['value'],$level+1)."\n";
204 204
                 $string .= str_repeat("\t",$level).'</'.$row['name'].'>';
205 205
             } else {
206 206
                 $string .= $row['value'];
Please login to merge, or discard this patch.
main/inc/lib/array.lib.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -108,24 +108,24 @@
 block discarded – undo
108 108
  */
109 109
 function utf8_sort($array)
110 110
 {
111
-	$old_locale = setlocale(LC_ALL, null);
112
-	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
-	$try_sort = false;
111
+    $old_locale = setlocale(LC_ALL, null);
112
+    $code = api_get_language_isocode();
113
+    $locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
114
+    $try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
117
-		$my_local = setlocale(LC_COLLATE, $locale);
118
-		if ($my_local) {
119
-			$try_sort = true;
120
-			break;
121
-		}
122
-	}
116
+    foreach($locale_list as $locale) {
117
+        $my_local = setlocale(LC_COLLATE, $locale);
118
+        if ($my_local) {
119
+            $try_sort = true;
120
+            break;
121
+        }
122
+    }
123 123
 
124
-	if ($try_sort) {
125
-		uasort($array, 'strcoll');
126
-	}
127
-	setlocale(LC_COLLATE, $old_locale);
128
-	return $array;
124
+    if ($try_sort) {
125
+        uasort($array, 'strcoll');
126
+    }
127
+    setlocale(LC_COLLATE, $old_locale);
128
+    return $array;
129 129
 }
130 130
 
131 131
 /**
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -110,10 +110,10 @@  discard block
 block discarded – undo
110 110
 {
111 111
 	$old_locale = setlocale(LC_ALL, null);
112 112
 	$code = api_get_language_isocode();
113
-	$locale_list = array($code.'.utf8', 'en.utf8','en_US.utf8','en_GB.utf8');
113
+	$locale_list = array($code.'.utf8', 'en.utf8', 'en_US.utf8', 'en_GB.utf8');
114 114
 	$try_sort = false;
115 115
 
116
-	foreach($locale_list as $locale) {
116
+	foreach ($locale_list as $locale) {
117 117
 		$my_local = setlocale(LC_COLLATE, $locale);
118 118
 		if ($my_local) {
119 119
 			$try_sort = true;
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
     $flatten = array();
152 152
     array_walk_recursive(
153 153
         $array,
154
-        function ($value) use (&$flatten) {
154
+        function($value) use (&$flatten) {
155 155
             $flatten[] = $value;
156 156
         }
157 157
     );
Please login to merge, or discard this patch.