Completed
Push — 1.10.x ( 34fa34...b0da58 )
by Yannick
448:57 queued 407:31
created
main/inc/lib/pear/HTML/QuickForm/submit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      * @access    public
16 16
      * @return    void
17 17
      */
18
-    public function __construct($elementName=null, $value=null, $attributes=null)
18
+    public function __construct($elementName = null, $value = null, $attributes = null)
19 19
     {
20 20
         parent::__construct($elementName, null, $attributes);
21 21
         $this->setValue($value);
Please login to merge, or discard this patch.
main/inc/lib/access_url_edit_courses_to_url_functions.lib.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,17 +44,17 @@
 block discarded – undo
44 44
                     ORDER BY name, id
45 45
                     LIMIT 11';
46 46
             $rs = Database::query($sql);
47
-            $i=0;
47
+            $i = 0;
48 48
             while ($session = Database :: fetch_array($rs)) {
49 49
                 $i++;
50
-                if ($i<=10) {
50
+                if ($i <= 10) {
51 51
                      $return .= '<a href="#" onclick="add_user_to_url(\''.addslashes($session['id']).'\',\''.addslashes($session['name']).' ('.addslashes($session['id']).')'.'\')">'.$session['name'].' </a><br />';
52 52
                 } else {
53 53
                     $return .= '...<br />';
54 54
                 }
55 55
             }
56 56
         }
57
-        $xajax_response -> addAssign('ajax_list_courses','innerHTML',api_utf8_encode($return));
57
+        $xajax_response -> addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return));
58 58
         return $xajax_response;
59 59
     }
60 60
 }
Please login to merge, or discard this patch.
main/work/show_file.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
Please login to merge, or discard this patch.
main/work/add_document.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
Please login to merge, or discard this patch.
main/work/download.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
Please login to merge, or discard this patch.
main/work/upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use ChamiloSession as Session;
5 5
 
6 6
 require_once '../inc/global.inc.php';
7
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
7
+$current_course_tool = TOOL_STUDENTPUBLICATION;
8 8
 
9 9
 api_protect_course_script(true);
10 10
 
Please login to merge, or discard this patch.
main/inc/lib/sub_language.class.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     public static function getAllLanguages()
22 22
     {
23 23
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
24
-        $sql = 'SELECT * FROM ' . $table;
24
+        $sql = 'SELECT * FROM '.$table;
25 25
         $rs = Database::query($sql);
26 26
         $all_languages = [];
27 27
         while ($row = Database::fetch_array($rs, 'ASSOC')) {
@@ -70,10 +70,10 @@  discard block
 block discarded – undo
70 70
     public static function get_all_information_of_sub_language($parent_id, $sub_language_id)
71 71
     {
72 72
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
73
-        $sql = 'SELECT * FROM ' . $table . '
73
+        $sql = 'SELECT * FROM '.$table.'
74 74
                 WHERE
75 75
                     parent_id= ' . intval($parent_id).' AND
76
-                    id= ' . intval($sub_language_id) . '';
76
+                    id= ' . intval($sub_language_id).'';
77 77
         $rs = Database::query($sql);
78 78
         $all_information = array();
79 79
         while ($row = Database::fetch_array($rs, 'ASSOC')) {
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     public static function get_all_information_of_language($parent_id)
92 92
     {
93 93
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
94
-        $sql = 'SELECT * FROM ' . $table . ' WHERE id = "' . intval($parent_id) . '"';
94
+        $sql = 'SELECT * FROM '.$table.' WHERE id = "'.intval($parent_id).'"';
95 95
         $rs = Database::query($sql);
96 96
         $all_information = array();
97 97
         while ($row = Database::fetch_array($rs, 'ASSOC')) {
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
      */
138 138
     public static function add_file_in_language_directory($system_path_file)
139 139
     {
140
-        $return_value = @file_put_contents($system_path_file, '<?php' . PHP_EOL);
140
+        $return_value = @file_put_contents($system_path_file, '<?php'.PHP_EOL);
141 141
 
142 142
         return $return_value;
143 143
     }
@@ -152,10 +152,10 @@  discard block
 block discarded – undo
152 152
     public static function write_data_in_file($path_file, $new_term, $new_variable)
153 153
     {
154 154
         $return_value = false;
155
-        $new_data = $new_variable . '=' . $new_term;
155
+        $new_data = $new_variable.'='.$new_term;
156 156
         $resource = @fopen($path_file, "a");
157 157
         if (file_exists($path_file) && $resource) {
158
-            if (fwrite($resource, $new_data . PHP_EOL) === false) {
158
+            if (fwrite($resource, $new_data.PHP_EOL) === false) {
159 159
                 //not allow to write
160 160
                 $return_value = false;
161 161
             } else {
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         if (empty($sub_language_dir)) {
178 178
             return false;
179 179
         }
180
-        $dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir;
180
+        $dir = api_get_path(SYS_LANG_PATH).$sub_language_dir;
181 181
         if (is_dir($dir)) {
182 182
             return true;
183 183
         } //even if the dir already exists, we reach the objective of having the directory there
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
             return false;
202 202
         }
203 203
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
204
-        $sql = 'SELECT dokeos_folder FROM ' . $table . '
205
-                WHERE parent_id = ' . $parent_id . ' and id = ' . $sub_language_id;
204
+        $sql = 'SELECT dokeos_folder FROM '.$table.'
205
+                WHERE parent_id = ' . $parent_id.' and id = '.$sub_language_id;
206 206
         $res = Database::query($sql);
207 207
         if ($res === false or Database::num_rows($res) < 1) {
208 208
             return false;
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
         if ($res === false) {
213 213
             return false;
214 214
         } //can't delete dir, so do not delete language record
215
-        $sql = 'DELETE FROM ' . $table . '
215
+        $sql = 'DELETE FROM '.$table.'
216 216
                 WHERE id= ' . intval($sub_language_id);
217 217
         $res = Database::query($sql);
218 218
 
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         if (empty($sub_language_dir)) {
230 230
             return false;
231 231
         }
232
-        $dir = api_get_path(SYS_LANG_PATH) . $sub_language_dir;
232
+        $dir = api_get_path(SYS_LANG_PATH).$sub_language_dir;
233 233
         if (!is_dir($dir)) {
234 234
             return true;
235 235
         } //even if the dir does not exist, we reach the objective of not having the directory there
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
         if (count($content) > 0) {
239 239
             foreach ($content as $value_content) {
240
-                $path_file = $dir . '/' . $value_content;
240
+                $path_file = $dir.'/'.$value_content;
241 241
                 unlink($path_file);
242 242
             }
243 243
             return @rmdir($dir);
@@ -255,8 +255,8 @@  discard block
 block discarded – undo
255 255
     {
256 256
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
257 257
         $sql = 'SELECT count(*) as count
258
-                FROM ' . $table . '
259
-                WHERE id="' . intval($language_id) . '"';
258
+                FROM ' . $table.'
259
+                WHERE id="' . intval($language_id).'"';
260 260
         $rs = Database::query($sql);
261 261
         if (Database::num_rows($rs) > 0) {
262 262
             if (Database::result($rs, 0, 'count') == 1) {
@@ -278,8 +278,8 @@  discard block
 block discarded – undo
278 278
     {
279 279
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
280 280
         $sql = 'SELECT original_name
281
-                FROM ' . $table . '
282
-                WHERE id= ' . intval($language_id) . '';
281
+                FROM ' . $table.'
282
+                WHERE id= ' . intval($language_id).'';
283 283
         $rs = Database::query($sql);
284 284
         if (Database::num_rows($rs) > 0) {
285 285
             return Database::result($rs, 0, 'original_name');
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
     public static function check_if_language_is_sub_language($language_id)
298 298
     {
299 299
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
300
-        $sql = 'SELECT count(*) AS count FROM ' . $table . '
301
-                WHERE id = ' . intval($language_id) . ' AND NOT ISNULL(parent_id)';
300
+        $sql = 'SELECT count(*) AS count FROM '.$table.'
301
+                WHERE id = ' . intval($language_id).' AND NOT ISNULL(parent_id)';
302 302
         $rs = Database::query($sql);
303 303
 
304 304
         if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     {
317 317
         $language_info = self::get_all_information_of_language($language_id);
318 318
         $table = Database :: get_main_table(TABLE_MAIN_USER);
319
-        $sql = 'SELECT count(*) AS count FROM ' . $table . '
319
+        $sql = 'SELECT count(*) AS count FROM '.$table.'
320 320
                 WHERE language ="' . Database::escape_string($language_info['english_name']).'"';
321 321
         $rs = Database::query($sql);
322 322
         if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') >= 1) {
@@ -334,8 +334,8 @@  discard block
 block discarded – undo
334 334
     public static function check_if_language_is_father($language_id)
335 335
     {
336 336
         $table = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
337
-        $sql = 'SELECT count(*) AS count FROM ' . $table . '
338
-                WHERE parent_id= ' . intval($language_id) . ' AND NOT ISNULL(parent_id);';
337
+        $sql = 'SELECT count(*) AS count FROM '.$table.'
338
+                WHERE parent_id= ' . intval($language_id).' AND NOT ISNULL(parent_id);';
339 339
         $rs = Database::query($sql);
340 340
 
341 341
         if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
     {
355 355
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
356 356
         $sql = "UPDATE $tbl_admin_languages SET available='0'
357
-                WHERE id = " . intval($language_id) . "";
357
+                WHERE id = ".intval($language_id)."";
358 358
         $result = Database::query($sql);
359 359
 
360 360
         return $result !== false; //only return false on sql error
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     {
370 370
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
371 371
         $sql = "UPDATE $tbl_admin_languages SET available='1'
372
-                WHERE id = " . intval($language_id) . "";
372
+                WHERE id = ".intval($language_id)."";
373 373
         $result = Database::query($sql);
374 374
 
375 375
         return $result !== false; //only return false on sql error
@@ -387,11 +387,11 @@  discard block
 block discarded – undo
387 387
         }
388 388
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
389 389
         $tbl_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
390
-        $sql = "SELECT english_name FROM " . $tbl_admin_languages . "
391
-                WHERE id= " . intval($language_id) . "";
390
+        $sql = "SELECT english_name FROM ".$tbl_admin_languages."
391
+                WHERE id= " . intval($language_id)."";
392 392
         $result = Database::query($sql);
393 393
         $lang = Database::fetch_array($result);
394
-        $sql_update_2 = "UPDATE " . $tbl_settings_current . " SET selected_value='" . $lang['english_name'] . "'
394
+        $sql_update_2 = "UPDATE ".$tbl_settings_current." SET selected_value='".$lang['english_name']."'
395 395
                          WHERE variable='platformLanguage'";
396 396
         $result_2 = Database::query($sql_update_2);
397 397
         Event::addEvent(
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
     {
412 412
         $name = api_get_setting('platformLanguage');
413 413
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
414
-        $sql = "SELECT id FROM " . $tbl_admin_languages . " WHERE english_name ='$name'";
414
+        $sql = "SELECT id FROM ".$tbl_admin_languages." WHERE english_name ='$name'";
415 415
         $res = Database::query($sql);
416 416
         if (Database::num_rows($res) < 1) {
417 417
             return false;
@@ -430,10 +430,10 @@  discard block
 block discarded – undo
430 430
     {
431 431
         $tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
432 432
         $sql = "SELECT dokeos_folder
433
-                FROM " . $tbl_admin_languages . "
433
+                FROM " . $tbl_admin_languages."
434 434
                 WHERE id = (
435
-                    SELECT parent_id FROM " . $tbl_admin_languages . "
436
-                    WHERE dokeos_folder = '" . Database::escape_string($language_path) . "'
435
+                    SELECT parent_id FROM " . $tbl_admin_languages."
436
+                    WHERE dokeos_folder = '" . Database::escape_string($language_path)."'
437 437
                 )
438 438
                 ";
439 439
         $result = Database::query($sql);
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
         $adminLanguagesTable = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
456 456
         // select language - if case several languages match, get the last (more recent) one
457 457
         $sql = "SELECT english_name
458
-                FROM " . $adminLanguagesTable . "
458
+                FROM " . $adminLanguagesTable."
459 459
                 WHERE
460 460
                     isocode ='$isocode' AND
461 461
                     available = 1
Please login to merge, or discard this patch.
main/work/work.lib.php 1 patch
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -35,27 +35,27 @@  discard block
 block discarded – undo
35 35
 
36 36
     if (!empty($id)) {
37 37
         $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&id='.$my_back_id.'">'.
38
-            Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
38
+            Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
39 39
     }
40 40
 
41 41
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath') {
42 42
         // Create dir
43 43
         if (empty($id)) {
44 44
             $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=create_dir&origin='.$origin.'&gradebook='.$gradebook.'">';
45
-            $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'),'',ICON_SIZE_MEDIUM).'</a>';
45
+            $display_output .= Display::return_icon('new_work.png', get_lang('CreateAssignment'), '', ICON_SIZE_MEDIUM).'</a>';
46 46
         }
47 47
         if (empty($id)) {
48 48
             // Options
49 49
             $display_output .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&action=settings&origin='.$origin.'&gradebook='.$gradebook.'">';
50
-            $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'),'',ICON_SIZE_MEDIUM).'</a>';
50
+            $display_output .= Display::return_icon('settings.png', get_lang('EditToolOptions'), '', ICON_SIZE_MEDIUM).'</a>';
51 51
         }
52
-        $display_output .= '<a id="open-view-list" href="#">' . Display::return_icon('listwork.png', get_lang('ViewStudents'),'',ICON_SIZE_MEDIUM) . '</a>';
52
+        $display_output .= '<a id="open-view-list" href="#">'.Display::return_icon('listwork.png', get_lang('ViewStudents'), '', ICON_SIZE_MEDIUM).'</a>';
53 53
 
54 54
     }
55 55
 
56 56
     if (api_is_allowed_to_edit(null, true) && $origin != 'learnpath' && api_is_allowed_to_session_edit(false, true)) {
57 57
         // Delete all files
58
-        if (api_get_setting('permanently_remove_deleted_files') == 'true'){
58
+        if (api_get_setting('permanently_remove_deleted_files') == 'true') {
59 59
             $message = get_lang('ConfirmYourChoiceDeleteAllfiles');
60 60
         } else {
61 61
             $message = get_lang('ConfirmYourChoice');
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
  */
113 113
 function two_digits($number)
114 114
 {
115
-    $number = (int)$number;
115
+    $number = (int) $number;
116 116
     return ($number < 10) ? '0'.$number : $number;
117 117
 }
118 118
 
@@ -547,11 +547,11 @@  discard block
 block discarded – undo
547 547
     );
548 548
 
549 549
     $columnModel = array(
550
-        array('name'=>'type', 'index'=>'type', 'width'=>'30',   'align'=>'center', 'sortable' => 'false'),
551
-        array('name'=>'title', 'index'=>'title', 'width'=>'250',   'align'=>'left'),
552
-        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80',  'align'=>'center', 'sortable'=>'false'),
553
-        array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80',  'align'=>'center'),
554
-        array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125',  'align'=>'center'),
550
+        array('name'=>'type', 'index'=>'type', 'width'=>'30', 'align'=>'center', 'sortable' => 'false'),
551
+        array('name'=>'title', 'index'=>'title', 'width'=>'250', 'align'=>'left'),
552
+        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'80', 'align'=>'center', 'sortable'=>'false'),
553
+        array('name'=>'feedback', 'index'=>'feedback', 'width'=>'80', 'align'=>'center'),
554
+        array('name'=>'last_upload', 'index'=>'feedback', 'width'=>'125', 'align'=>'center'),
555 555
     );
556 556
 
557 557
     if ($courseInfo['show_score'] == 0) {
@@ -588,10 +588,10 @@  discard block
 block discarded – undo
588 588
 {
589 589
     $columnModel = array(
590 590
         array('name'=>'type', 'index'=>'type', 'width'=>'35', 'align'=>'center', 'sortable' => 'false'),
591
-        array('name'=>'title', 'index'=>'title',  'width'=>'300',   'align'=>'left', 'wrap_cell' => "true"),
592
-        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125',  'align'=>'center'),
593
-        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125',  'align'=>'center'),
594
-        array('name'=>'amount', 'index'=>'end_on', 'width'=>'110',  'align'=>'center'),
591
+        array('name'=>'title', 'index'=>'title', 'width'=>'300', 'align'=>'left', 'wrap_cell' => "true"),
592
+        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'125', 'align'=>'center'),
593
+        array('name'=>'expires_on', 'index'=>'expires_on', 'width'=>'125', 'align'=>'center'),
594
+        array('name'=>'amount', 'index'=>'end_on', 'width'=>'110', 'align'=>'center'),
595 595
         array('name'=>'actions', 'index'=>'actions', 'width'=>'110', 'align'=>'left', 'sortable'=>'false')
596 596
     );
597 597
 
@@ -793,7 +793,7 @@  discard block
 block discarded – undo
793 793
         return false;
794 794
     }
795 795
 
796
-    $base_work_dir = api_get_path(SYS_COURSE_PATH) .$_course['path'].'/work';
796
+    $base_work_dir = api_get_path(SYS_COURSE_PATH).$_course['path'].'/work';
797 797
     $work_data_url = $base_work_dir.$work_data['url'];
798 798
     $check = Security::check_abs_path($work_data_url.'/', $base_work_dir.'/');
799 799
 
@@ -863,7 +863,7 @@  discard block
 block discarded – undo
863 863
 function get_work_path($id)
864 864
 {
865 865
     $table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
866
-    $course_id  = api_get_course_int_id();
866
+    $course_id = api_get_course_int_id();
867 867
     $sql = 'SELECT url FROM '.$table.'
868 868
             WHERE c_id = '.$course_id.' AND id='.intval($id);
869 869
     $res = Database::query($sql);
@@ -984,9 +984,9 @@  discard block
 block discarded – undo
984 984
     if ($handle = @opendir($directory)) {
985 985
         while (false !== ($file = readdir($handle))) {
986 986
             if ($file != '.' && $file != '..') {
987
-                if (is_dir($directory. '/' . $file)) {
988
-                    $array_items = array_merge($array_items, directory_to_array($directory. '/' . $file));
989
-                    $file = $directory . '/' . $file;
987
+                if (is_dir($directory.'/'.$file)) {
988
+                    $array_items = array_merge($array_items, directory_to_array($directory.'/'.$file));
989
+                    $file = $directory.'/'.$file;
990 990
                     $array_items[] = preg_replace("/\/\//si", '/', $file);
991 991
                 }
992 992
             }
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
 
1019 1019
     $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
1020 1020
 
1021
-    for($i = 0; $i < count($only_dir); $i++) {
1021
+    for ($i = 0; $i < count($only_dir); $i++) {
1022 1022
         $url = $only_dir[$i];
1023 1023
 
1024 1024
         $params = [
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
             if (is_dir($path_dir.'/'.$entry)) {
1059 1059
                 $count_dir++;
1060 1060
                 if ($recurse) {
1061
-                    $count += count_dir($path_dir . '/' . $entry, $recurse);
1061
+                    $count += count_dir($path_dir.'/'.$entry, $recurse);
1062 1062
                 }
1063 1063
             } else {
1064 1064
                 $count++;
@@ -1323,11 +1323,11 @@  discard block
 block discarded – undo
1323 1323
         $courseInfo
1324 1324
     );
1325 1325
 
1326
-    if (!in_array($direction, array('asc','desc'))) {
1326
+    if (!in_array($direction, array('asc', 'desc'))) {
1327 1327
         $direction = 'desc';
1328 1328
     }
1329 1329
     if (!empty($where_condition)) {
1330
-        $where_condition = ' AND ' . $where_condition;
1330
+        $where_condition = ' AND '.$where_condition;
1331 1331
     }
1332 1332
 
1333 1333
     $column = !empty($column) ? Database::escape_string($column) : 'sent_date';
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
         $direction = 'desc';
1471 1471
     }
1472 1472
     if (!empty($where_condition)) {
1473
-        $where_condition = ' AND ' . $where_condition;
1473
+        $where_condition = ' AND '.$where_condition;
1474 1474
     }
1475 1475
 
1476 1476
     $column = !empty($column) ? Database::escape_string($column) : 'sent_date';
@@ -1527,7 +1527,7 @@  discard block
 block discarded – undo
1527 1527
             );
1528 1528
 
1529 1529
             $work['amount'] = Display::label(
1530
-                $countUniqueAttempts . '/' .
1530
+                $countUniqueAttempts.'/'.
1531 1531
                 $totalUsers,
1532 1532
                 'success'
1533 1533
             );
@@ -1576,7 +1576,7 @@  discard block
 block discarded – undo
1576 1576
                         array(),
1577 1577
                         ICON_SIZE_SMALL
1578 1578
                     ),
1579
-                    api_get_path(WEB_CODE_PATH) . 'work/downloadfolder.inc.php?id=' . $workId . '&' . api_get_cidreq()
1579
+                    api_get_path(WEB_CODE_PATH).'work/downloadfolder.inc.php?id='.$workId.'&'.api_get_cidreq()
1580 1580
                 );
1581 1581
             } else {
1582 1582
                 $downloadLink = Display::url(
@@ -1660,7 +1660,7 @@  discard block
 block discarded – undo
1660 1660
     $userCondition = " AND u.user_id = $studentId ";
1661 1661
     $sessionCondition = " AND w.session_id = $sessionId ";
1662 1662
     $workCondition = " AND w_rel.work_id = $workId";
1663
-    $workParentCondition  = " AND w.parent_id = $workId";
1663
+    $workParentCondition = " AND w.parent_id = $workId";
1664 1664
 
1665 1665
     $sql = "(
1666 1666
                 $select1 FROM $userTable u
@@ -1768,7 +1768,7 @@  discard block
 block discarded – undo
1768 1768
         }
1769 1769
 
1770 1770
         if ($allowEdition && !empty($itemId)) {
1771
-            $deleteLink  = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId);
1771
+            $deleteLink = Display::url($deleteIcon, $urlDelete.'&item_id='.$itemId.'&id='.$workId);
1772 1772
         } else {
1773 1773
             $deleteLink = null;
1774 1774
         }
@@ -1849,7 +1849,7 @@  discard block
 block discarded – undo
1849 1849
     $start = intval($start);
1850 1850
     $limit = intval($limit);
1851 1851
 
1852
-    if (!in_array($direction, array('asc','desc'))) {
1852
+    if (!in_array($direction, array('asc', 'desc'))) {
1853 1853
         $direction = 'desc';
1854 1854
     }
1855 1855
 
@@ -1917,13 +1917,13 @@  discard block
 block discarded – undo
1917 1917
         $work_assignment = get_work_assignment_by_id($work_id);
1918 1918
 
1919 1919
         if (!empty($studentId)) {
1920
-            $where_condition.= " AND u.user_id = ".intval($studentId);
1920
+            $where_condition .= " AND u.user_id = ".intval($studentId);
1921 1921
         }
1922 1922
 
1923 1923
         $sql = " $select
1924 1924
                 FROM $work_condition  $user_condition
1925 1925
                 WHERE $extra_conditions $where_condition $condition_session
1926
-                    AND u.status != " . INVITEE . "
1926
+                    AND u.status != ".INVITEE."
1927 1927
                 ORDER BY $column $direction";
1928 1928
 
1929 1929
         if (!empty($start) && !empty($limit)) {
@@ -1980,7 +1980,7 @@  discard block
 block discarded – undo
1980 1980
                     $qualification_string = Display::label('-');
1981 1981
                 } else {
1982 1982
                     $label = 'info';
1983
-                    $relativeScore = $work['qualification']/$work_data['qualification'];
1983
+                    $relativeScore = $work['qualification'] / $work_data['qualification'];
1984 1984
                     if ($relativeScore < 0.5) {
1985 1985
                         $label = 'important';
1986 1986
                     } elseif ($relativeScore < 0.75) {
@@ -2036,10 +2036,10 @@  discard block
 block discarded – undo
2036 2036
                 // If URL is present then there's a file to download keep BC.
2037 2037
                 if ($work['contains_file'] || !empty($work['url'])) {
2038 2038
                     $link_to_download = '<a href="'.$url.'download.php?id='.$item_id.'&'.api_get_cidreq().'">'.
2039
-                        Display::return_icon('save.png', get_lang('Save'),array(), ICON_SIZE_SMALL).'</a> ';
2039
+                        Display::return_icon('save.png', get_lang('Save'), array(), ICON_SIZE_SMALL).'</a> ';
2040 2040
                 }
2041 2041
 
2042
-                $send_to = Portfolio::share('work', $work['id'],  array('style' => 'white-space:nowrap;'));
2042
+                $send_to = Portfolio::share('work', $work['id'], array('style' => 'white-space:nowrap;'));
2043 2043
 
2044 2044
                 $feedback = null;
2045 2045
                 $count = getWorkCommentCount($item_id, $course_info);
@@ -2058,7 +2058,7 @@  discard block
 block discarded – undo
2058 2058
                 $work_date = api_convert_and_format_date($work['sent_date']);
2059 2059
 
2060 2060
                 $work['sent_date_from_db'] = $work['sent_date'];
2061
-                $work['sent_date'] = '<div class="date-time">' . date_to_str_ago(api_get_local_time($work['sent_date'])) . ' ' . $add_string . ' ' . $work_date . '</div>';
2061
+                $work['sent_date'] = '<div class="date-time">'.date_to_str_ago(api_get_local_time($work['sent_date'])).' '.$add_string.' '.$work_date.'</div>';
2062 2062
 
2063 2063
                 // Actions.
2064 2064
                 $correction = '';
@@ -2076,8 +2076,8 @@  discard block
 block discarded – undo
2076 2076
                         Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a> ';
2077 2077
 
2078 2078
                     if ($unoconv && empty($work['contains_file'])) {
2079
-                        $action .=  '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
2080
-                            Display::return_icon('export_doc.png', get_lang('ExportToDoc'),array(), ICON_SIZE_SMALL).'</a> ';
2079
+                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=export_to_doc&item_id='.$item_id.'" title="'.get_lang('ExportToDoc').'" >'.
2080
+                            Display::return_icon('export_doc.png', get_lang('ExportToDoc'), array(), ICON_SIZE_SMALL).'</a> ';
2081 2081
                     }
2082 2082
 
2083 2083
                     $correction = '
@@ -2120,9 +2120,9 @@  discard block
 block discarded – undo
2120 2120
 
2121 2121
                     if ($locked) {
2122 2122
                         if ($qualification_exists) {
2123
-                            $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'),array(), ICON_SIZE_SMALL);
2123
+                            $action .= Display::return_icon('rate_work_na.png', get_lang('CorrectAndRate'), array(), ICON_SIZE_SMALL);
2124 2124
                         } else {
2125
-                            $action .= Display::return_icon('edit_na.png', get_lang('Comment'),array(), ICON_SIZE_SMALL);
2125
+                            $action .= Display::return_icon('edit_na.png', get_lang('Comment'), array(), ICON_SIZE_SMALL);
2126 2126
                         }
2127 2127
                     } else {
2128 2128
                         if ($qualification_exists) {
@@ -2136,45 +2136,45 @@  discard block
 block discarded – undo
2136 2136
 
2137 2137
                     if ($work['contains_file']) {
2138 2138
                         if ($locked) {
2139
-                            $action .= Display::return_icon('move_na.png', get_lang('Move'),array(), ICON_SIZE_SMALL);
2139
+                            $action .= Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
2140 2140
                         } else {
2141 2141
                             $action .= '<a href="'.$url.'work.php?'.api_get_cidreq().'&action=move&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Move').'">'.
2142
-                                Display::return_icon('move.png', get_lang('Move'),array(), ICON_SIZE_SMALL).'</a>';
2142
+                                Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
2143 2143
                         }
2144 2144
                     }
2145 2145
 
2146 2146
                     if ($work['accepted'] == '1') {
2147 2147
                         $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_invisible&item_id='.$item_id.'" title="'.get_lang('Invisible').'" >'.
2148
-                            Display::return_icon('visible.png', get_lang('Invisible'),array(), ICON_SIZE_SMALL).'</a>';
2148
+                            Display::return_icon('visible.png', get_lang('Invisible'), array(), ICON_SIZE_SMALL).'</a>';
2149 2149
                     } else {
2150 2150
                         $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=make_visible&item_id='.$item_id.'" title="'.get_lang('Visible').'" >'.
2151
-                            Display::return_icon('invisible.png', get_lang('Visible'),array(), ICON_SIZE_SMALL).'</a> ';
2151
+                            Display::return_icon('invisible.png', get_lang('Visible'), array(), ICON_SIZE_SMALL).'</a> ';
2152 2152
                     }
2153 2153
 
2154 2154
                     if ($locked) {
2155 2155
                         $action .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
2156 2156
                     } else {
2157
-                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
2158
-                            Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
2157
+                        $action .= '<a href="'.$url.'work_list_all.php?'.api_get_cidreq().'&id='.$work_id.'&action=delete&item_id='.$item_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'" >'.
2158
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
2159 2159
                     }
2160 2160
                 } elseif ($is_author && (empty($work['qualificator_id']) || $work['qualificator_id'] == 0)) {
2161 2161
                     $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
2162
-                        Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a>';
2162
+                        Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a>';
2163 2163
 
2164 2164
                     if (api_get_course_setting('student_delete_own_publication') == 1) {
2165 2165
                         if (api_is_allowed_to_session_edit(false, true)) {
2166 2166
                             $action .= '<a href="'.$url.'edit.php?'.api_get_cidreq().'&item_id='.$item_id.'&id='.$work['parent_id'].'" title="'.get_lang('Modify').'">'.
2167
-                                Display::return_icon('edit.png', get_lang('Comment'),array(), ICON_SIZE_SMALL).'</a>';
2167
+                                Display::return_icon('edit.png', get_lang('Comment'), array(), ICON_SIZE_SMALL).'</a>';
2168 2168
                         }
2169
-                        $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'"  >'.
2170
-                            Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>';
2169
+                        $action .= ' <a href="'.$url.'work_list.php?'.api_get_cidreq().'&action=delete&item_id='.$item_id.'&id='.$work['parent_id'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'"  >'.
2170
+                            Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
2171 2171
                     } else {
2172
-                        $action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL);
2172
+                        $action .= Display::return_icon('edit_na.png', get_lang('Modify'), array(), ICON_SIZE_SMALL);
2173 2173
                     }
2174 2174
                 } else {
2175 2175
                     $action .= '<a href="'.$url.'view.php?'.api_get_cidreq().'&id='.$item_id.'" title="'.get_lang('View').'">'.
2176
-                        Display::return_icon('default.png', get_lang('View'),array(), ICON_SIZE_SMALL).'</a>';
2177
-                    $action .= Display::return_icon('edit_na.png', get_lang('Modify'),array(), ICON_SIZE_SMALL);
2176
+                        Display::return_icon('default.png', get_lang('View'), array(), ICON_SIZE_SMALL).'</a>';
2177
+                    $action .= Display::return_icon('edit_na.png', get_lang('Modify'), array(), ICON_SIZE_SMALL);
2178 2178
                 }
2179 2179
 
2180 2180
                 // Status.
@@ -2207,7 +2207,7 @@  discard block
 block discarded – undo
2207 2207
     $_course = api_get_course_info();
2208 2208
     $task_id = $task_data['id'];
2209 2209
     $task_title = !empty($task_data['title']) ? $task_data['title'] : basename($task_data['url']);
2210
-    $subject = '[' . api_get_setting('siteName') . '] ';
2210
+    $subject = '['.api_get_setting('siteName').'] ';
2211 2211
 
2212 2212
     // The body can be as long as you wish, and any combination of text and variables
2213 2213
     $content = get_lang('ReminderToSubmitPendingTask')."\n".get_lang('CourseName').' : '.$_course['name']."\n";
@@ -2218,7 +2218,7 @@  discard block
 block discarded – undo
2218 2218
     $mails_sent_to = array();
2219 2219
     foreach ($list_users as $user) {
2220 2220
         $name_user = api_get_person_name($user[1], $user[0], null, PERSON_NAME_EMAIL_ADDRESS);
2221
-        $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]) .", \n\n";
2221
+        $dear_line = get_lang('Dear')." ".api_get_person_name($user[1], $user[0]).", \n\n";
2222 2222
         $body      = $dear_line.$content;
2223 2223
         MessageManager::send_message($user[3], $subject, $body);
2224 2224
         $mails_sent_to[] = $name_user;
@@ -2247,22 +2247,22 @@  discard block
 block discarded – undo
2247 2247
     } else {
2248 2248
         $students = CourseManager::get_student_list_from_course_code($courseCode, true, $sessionId);
2249 2249
     }
2250
-    $emailsubject = '[' . api_get_setting('siteName') . '] '.get_lang('HomeworkCreated');
2250
+    $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('HomeworkCreated');
2251 2251
     $currentUser = api_get_user_info(api_get_user_id());
2252 2252
     if (!empty($students)) {
2253
-        foreach($students as $student) {
2253
+        foreach ($students as $student) {
2254 2254
             $user_info = api_get_user_info($student["user_id"]);
2255
-            if(!empty($user_info["mail"])) {
2255
+            if (!empty($user_info["mail"])) {
2256 2256
                 $name_user = api_get_person_name(
2257 2257
                     $user_info["firstname"],
2258 2258
                     $user_info["lastname"],
2259 2259
                     null,
2260 2260
                     PERSON_NAME_EMAIL_ADDRESS
2261 2261
                 );
2262
-                $link = api_get_path(WEB_CODE_PATH) . 'work/work_list_all.php?' . api_get_cidreq() . '&id=' . $workId;
2262
+                $link = api_get_path(WEB_CODE_PATH).'work/work_list_all.php?'.api_get_cidreq().'&id='.$workId;
2263 2263
                 $emailbody = get_lang('Dear')." ".$name_user.",\n\n";
2264 2264
                 $emailbody .= get_lang('HomeworkHasBeenCreatedForTheCourse')." ".$courseCode.". "."\n\n".
2265
-                    '<a href="'. $link . '">' . get_lang('PleaseCheckHomeworkPage') . '</a>';
2265
+                    '<a href="'.$link.'">'.get_lang('PleaseCheckHomeworkPage').'</a>';
2266 2266
                 $emailbody .= "\n\n".api_get_person_name($currentUser["firstname"], $currentUser["lastname"]);
2267 2267
 
2268 2268
                 $additionalParameters = array(
@@ -2304,7 +2304,7 @@  discard block
 block discarded – undo
2304 2304
     $url = Database::escape_string($url);
2305 2305
     $sql = "SELECT id FROM $work_table WHERE url='$url'";
2306 2306
     $result = Database::query($sql);
2307
-    if (Database::num_rows($result)> 0) {
2307
+    if (Database::num_rows($result) > 0) {
2308 2308
         $row = Database::fetch_row($result);
2309 2309
         if (empty($row)) {
2310 2310
             return false;
@@ -2326,7 +2326,7 @@  discard block
 block discarded – undo
2326 2326
 {
2327 2327
     $output = '<select name="'.$name.'" id="'.$name.'">';
2328 2328
     foreach ($values as $key => $value) {
2329
-        $output .= '<option value="'.$key.'" '.(($checked==$key) ? 'selected="selected"' : '').'>'.$value.'</option>';
2329
+        $output .= '<option value="'.$key.'" '.(($checked == $key) ? 'selected="selected"' : '').'>'.$value.'</option>';
2330 2330
     }
2331 2331
     $output .= '</select>';
2332 2332
     return $output;
@@ -2340,9 +2340,9 @@  discard block
 block discarded – undo
2340 2340
  */
2341 2341
 function make_checkbox($name, $checked = '', $label = null)
2342 2342
 {
2343
-    $check = '<input id ="'.$name.'" type="checkbox" value="1" name="'.$name.'" '.((!empty($checked))?'checked="checked"':'').'/>';
2343
+    $check = '<input id ="'.$name.'" type="checkbox" value="1" name="'.$name.'" '.((!empty($checked)) ? 'checked="checked"' : '').'/>';
2344 2344
     if (!empty($label)) {
2345
-        $check .="<label for ='$name'>$label</label>";
2345
+        $check .= "<label for ='$name'>$label</label>";
2346 2346
     }
2347 2347
     return $check;
2348 2348
 }
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
     }
2497 2497
 
2498 2498
     if (!empty($studentId)) {
2499
-        $sql_users.= " AND u.user_id = ".intval($studentId);
2499
+        $sql_users .= " AND u.user_id = ".intval($studentId);
2500 2500
     }
2501 2501
 
2502 2502
     $group_id = api_get_group_id();
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
     if ($group_id) {
2507 2507
         $group_user_list = GroupManager::get_subscribed_users($group_id);
2508 2508
         if (!empty($group_user_list)) {
2509
-            foreach($group_user_list as $group_user) {
2509
+            foreach ($group_user_list as $group_user) {
2510 2510
                 $new_group_user_list[] = $group_user['user_id'];
2511 2511
             }
2512 2512
         }
@@ -2927,7 +2927,7 @@  discard block
 block discarded – undo
2927 2927
 function getWorkComments($work)
2928 2928
 {
2929 2929
     $commentTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT_COMMENT);
2930
-    $userTable= Database::get_main_table(TABLE_MAIN_USER);
2930
+    $userTable = Database::get_main_table(TABLE_MAIN_USER);
2931 2931
 
2932 2932
     $courseId = intval($work['c_id']);
2933 2933
     $workId = intval($work['id']);
@@ -3610,7 +3610,7 @@  discard block
 block discarded – undo
3610 3610
             null,
3611 3611
             PERSON_NAME_EMAIL_ADDRESS
3612 3612
         );
3613
-        $subject = "[" . api_get_setting('siteName') . "] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']."  ";
3613
+        $subject = "[".api_get_setting('siteName')."] ".get_lang('SendMailBody')."\n ".get_lang('CourseName').": ".$courseInfo['name']."  ";
3614 3614
         foreach ($user_list as $user_data) {
3615 3615
             $to_user_id = $user_data['user_id'];
3616 3616
             $user_info = api_get_user_info($to_user_id);
@@ -3659,7 +3659,7 @@  discard block
 block discarded – undo
3659 3659
 
3660 3660
     $title = $values['title'];
3661 3661
     $description = $values['description'];
3662
-    $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']): 0;
3662
+    $contains_file = isset($values['contains_file']) && !empty($values['contains_file']) ? intval($values['contains_file']) : 0;
3663 3663
 
3664 3664
     $saveWork = true;
3665 3665
     $message = null;
@@ -4026,8 +4026,8 @@  discard block
 block discarded – undo
4026 4026
                     LINK_STUDENTPUBLICATION,
4027 4027
                     $workId,
4028 4028
                     $params['new_dir'],
4029
-                    (float)$params['weight'],
4030
-                    (float)$params['qualification'],
4029
+                    (float) $params['weight'],
4030
+                    (float) $params['qualification'],
4031 4031
                     $params['description'],
4032 4032
                     1,
4033 4033
                     api_get_session_id()
@@ -4287,15 +4287,15 @@  discard block
 block discarded – undo
4287 4287
     // changing the tool setting: is a student allowed to delete his/her own document
4288 4288
 
4289 4289
     // counting the number of occurrences of this setting (if 0 => add, if 1 => update)
4290
-    $query = "SELECT * FROM " . $table_course_setting . "
4290
+    $query = "SELECT * FROM ".$table_course_setting."
4291 4291
               WHERE c_id = $courseId AND variable = 'student_delete_own_publication'";
4292 4292
 
4293 4293
     $result = Database::query($query);
4294 4294
     $number_of_setting = Database::num_rows($result);
4295 4295
 
4296 4296
     if ($number_of_setting == 1) {
4297
-        $query = "UPDATE " . $table_course_setting . " SET
4298
-                  value='" . Database::escape_string($studentDeleteOwnPublication) . "'
4297
+        $query = "UPDATE ".$table_course_setting." SET
4298
+                  value='" . Database::escape_string($studentDeleteOwnPublication)."'
4299 4299
                   WHERE variable = 'student_delete_own_publication' AND c_id = $courseId";
4300 4300
         Database::query($query);
4301 4301
     } else {
@@ -4334,9 +4334,9 @@  discard block
 block discarded – undo
4334 4334
     $work_table = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
4335 4335
     $item_id = intval($item_id);
4336 4336
     $course_id = $course_info['real_id'];
4337
-    $sql = "UPDATE  " . $work_table . "
4337
+    $sql = "UPDATE  ".$work_table."
4338 4338
             SET accepted = 0
4339
-            WHERE c_id = $course_id AND id = '" . $item_id . "'";
4339
+            WHERE c_id = $course_id AND id = '".$item_id."'";
4340 4340
     Database::query($sql);
4341 4341
     api_item_property_update(
4342 4342
         $course_info,
@@ -4480,7 +4480,7 @@  discard block
 block discarded – undo
4480 4480
                 $courseCode,
4481 4481
                 $sessionId,
4482 4482
                 $limitString,
4483
-                $orderBy ,
4483
+                $orderBy,
4484 4484
                 STUDENT,
4485 4485
                 $getCount
4486 4486
             );
@@ -4817,8 +4817,8 @@  discard block
 block discarded – undo
4817 4817
     if (!empty($sessionId)) {
4818 4818
         $sessionInfo = api_get_session_info($sessionId);
4819 4819
         if (!empty($sessionInfo)) {
4820
-            $header .= ' - ' . $sessionInfo['name'];
4821
-            $header .= '<br />' . $sessionInfo['description'];
4820
+            $header .= ' - '.$sessionInfo['name'];
4821
+            $header .= '<br />'.$sessionInfo['description'];
4822 4822
             $teachers = SessionManager::getCoachesByCourseSessionToString(
4823 4823
                 $sessionId,
4824 4824
                 $courseInfo['real_id']
@@ -4834,12 +4834,12 @@  discard block
 block discarded – undo
4834 4834
     $expiresOn = null;
4835 4835
 
4836 4836
     if (!empty($assignment) && isset($assignment['expires_on'])) {
4837
-        $content .= '<br /><strong>' . get_lang('ExpirationDate') . '</strong>: ' . api_get_local_time($assignment['expires_on']);
4837
+        $content .= '<br /><strong>'.get_lang('ExpirationDate').'</strong>: '.api_get_local_time($assignment['expires_on']);
4838 4838
         $expiresOn = api_get_local_time($assignment['expires_on']);
4839 4839
     }
4840 4840
 
4841 4841
     if (!empty($workData['description'])) {
4842
-        $content .= '<br /><strong>' . get_lang('Description') . '</strong>: ' . $workData['description'];
4842
+        $content .= '<br /><strong>'.get_lang('Description').'</strong>: '.$workData['description'];
4843 4843
     }
4844 4844
 
4845 4845
     $workList = get_work_user_list(null, null, null, null, $workId);
@@ -4860,7 +4860,7 @@  discard block
 block discarded – undo
4860 4860
                 );
4861 4861
 
4862 4862
                 $column = 0;
4863
-                foreach($headers as $header) {
4863
+                foreach ($headers as $header) {
4864 4864
                     $table->setHeaderContents(0, $column, $header);
4865 4865
                     $column++;
4866 4866
                 }
@@ -4908,7 +4908,7 @@  discard block
 block discarded – undo
4908 4908
 
4909 4909
                 if (!empty($content)) {
4910 4910
                     $params = array(
4911
-                        'filename' => $workData['title'] . '_' . api_get_local_time(),
4911
+                        'filename' => $workData['title'].'_'.api_get_local_time(),
4912 4912
                         'pdf_title' => api_replace_dangerous_char($workData['title']),
4913 4913
                         'course_code' => $courseInfo['code'],
4914 4914
                         'add_signatures' => false
@@ -4939,7 +4939,7 @@  discard block
 block discarded – undo
4939 4939
     $tempZipFile = api_get_path(SYS_ARCHIVE_PATH).api_get_unique_id().".zip";
4940 4940
     $coursePath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/work/';
4941 4941
 
4942
-    $zip  = new PclZip($tempZipFile);
4942
+    $zip = new PclZip($tempZipFile);
4943 4943
 
4944 4944
     $workPerUser = getWorkPerUser($userId);
4945 4945
 
Please login to merge, or discard this patch.
main/work/work_list_others.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 /* For licensing terms, see /license.txt */
3 3
 
4 4
 //require_once '../inc/global.inc.php';
5
-$current_course_tool  = TOOL_STUDENTPUBLICATION;
5
+$current_course_tool = TOOL_STUDENTPUBLICATION;
6 6
 
7 7
 api_protect_course_script(true);
8 8
 
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 $htmlHeadXtra[] = api_get_jqgrid_js();
37 37
 
38 38
 if (!empty($group_id)) {
39
-    $group_properties  = GroupManager :: get_group_properties($group_id);
39
+    $group_properties = GroupManager :: get_group_properties($group_id);
40 40
     $show_work = false;
41 41
 
42 42
     if (api_is_allowed_to_edit(false, true)) {
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 
72 72
 echo '<div class="actions">';
73 73
 echo '<a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq().'>'.
74
-    Display::return_icon('back.png', get_lang('BackToWorksList'),'',ICON_SIZE_MEDIUM).'</a>';
74
+    Display::return_icon('back.png', get_lang('BackToWorksList'), '', ICON_SIZE_MEDIUM).'</a>';
75 75
 echo '</div>';
76 76
 
77 77
 if (!empty($my_folder_data['description'])) {
@@ -93,27 +93,27 @@  discard block
 block discarded – undo
93 93
         get_lang('Actions')
94 94
     );
95 95
     $column_model = array(
96
-        array('name'=>'type',           'index'=>'file',            'width'=>'12',   'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
97
-        array('name'=>'firstname',      'index'=>'firstname',       'width'=>'35',   'align'=>'left', 'search' => 'true'),
98
-        array('name'=>'lastname',		'index'=>'lastname',        'width'=>'35',   'align'=>'left', 'search' => 'true'),
99
-        array('name'=>'title',          'index'=>'title',           'width'=>'40',   'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
100
-        array('name'=>'qualification',	'index'=>'qualification',	'width'=>'20',   'align'=>'left', 'search' => 'true'),
101
-        array('name'=>'sent_date',       'index'=>'sent_date',            'width'=>'50',   'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
102
-        array('name'=>'qualificator_id','index'=>'qualificator_id', 'width'=>'30',   'align'=>'left', 'search' => 'true'),
103
-        array('name'=>'actions',        'index'=>'actions',         'width'=>'40',   'align'=>'left', 'search' => 'false', 'sortable'=>'false')
96
+        array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
97
+        array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
98
+        array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
99
+        array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => 'true'),
100
+        array('name'=>'qualification', 'index'=>'qualification', 'width'=>'20', 'align'=>'left', 'search' => 'true'),
101
+        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
102
+        array('name'=>'qualificator_id', 'index'=>'qualificator_id', 'width'=>'30', 'align'=>'left', 'search' => 'true'),
103
+        array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
104 104
     );
105 105
 } else {
106 106
     $type = 'complex';
107
-    $columns  = array(
108
-        get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Date'),  get_lang('Actions')
107
+    $columns = array(
108
+        get_lang('Type'), get_lang('FirstName'), get_lang('LastName'), get_lang('Title'), get_lang('Date'), get_lang('Actions')
109 109
     );
110 110
     $column_model = array(
111
-        array('name'=>'type',           'index'=>'file',            'width'=>'12',   'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
112
-        array('name'=>'firstname',      'index'=>'firstname',       'width'=>'35',   'align'=>'left', 'search' => 'true'),
113
-        array('name'=>'lastname',		'index'=>'lastname',        'width'=>'35',   'align'=>'left', 'search' => 'true'),
114
-        array('name'=>'title',          'index'=>'title',           'width'=>'40',   'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
115
-        array('name'=>'sent_date',       'index'=>'sent_date',            'width'=>'50',   'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
116
-        array('name'=>'actions',        'index'=>'actions',         'width'=>'40',   'align'=>'left', 'search' => 'false', 'sortable'=>'false')
111
+        array('name'=>'type', 'index'=>'file', 'width'=>'12', 'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
112
+        array('name'=>'firstname', 'index'=>'firstname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
113
+        array('name'=>'lastname', 'index'=>'lastname', 'width'=>'35', 'align'=>'left', 'search' => 'true'),
114
+        array('name'=>'title', 'index'=>'title', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
115
+        array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'50', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true'),
116
+        array('name'=>'actions', 'index'=>'actions', 'width'=>'40', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
117 117
     );
118 118
 }
119 119
 
Please login to merge, or discard this patch.