Completed
Push — 1.10.x ( 6bc0e1...b7a253 )
by Angel Fernando Quiroz
45:49
created
main/newscorm/lp_final_item.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // Initialize context
9 9
 $_in_course = true;
10 10
 
11
-require_once __DIR__ . '/../inc/global.inc.php';
11
+require_once __DIR__.'/../inc/global.inc.php';
12 12
 
13 13
 $current_course_tool = TOOL_GRADEBOOK;
14 14
 
@@ -170,19 +170,19 @@  discard block
 block discarded – undo
170 170
                 <div class='row'>
171 171
                     <div class='col-md-2 col-xs-4'>
172 172
                         <div class='thumbnail'>
173
-                          <img class='skill-badge-img' src='" . $skill->getWebIconPath() . "' >
173
+                          <img class='skill-badge-img' src='" . $skill->getWebIconPath()."' >
174 174
                         </div>
175 175
                     </div>
176 176
                     <div class='col-md-8 col-xs-8'>
177
-                        <h5><b>" . $skill->getName() . "</b></h5>
178
-                        " . $skill->getDescription() . "
177
+                        <h5><b>" . $skill->getName()."</b></h5>
178
+                        " . $skill->getDescription()."
179 179
                     </div>
180 180
                     <div class='col-md-2 col-xs-12'>
181
-                        <h5><b>" . get_lang('ShareWithYourFriends') . "</b></h5>
182
-                        <a href='http://www.facebook.com/sharer.php?u=" . api_get_path(WEB_PATH) . "badge/" . $skill->getId() . "/user/" . $userId . "' target='_new'>
181
+                        <h5><b>" . get_lang('ShareWithYourFriends')."</b></h5>
182
+                        <a href='http://www.facebook.com/sharer.php?u=" . api_get_path(WEB_PATH)."badge/".$skill->getId()."/user/".$userId."' target='_new'>
183 183
                             <em class='fa fa-facebook-square fa-3x text-info' aria-hidden='true'></em>
184 184
                         </a>
185
-                        <a href='https://twitter.com/home?status=" . sprintf(get_lang('IHaveObtainedSkillXOnY'), '"' . $skill->getName() . '"', api_get_setting('siteName')) . ' - ' . api_get_path(WEB_PATH) . 'badge/' . $skill->getId() . '/user/' . $userId . "' target='_new'>
185
+                        <a href='https://twitter.com/home?status=" . sprintf(get_lang('IHaveObtainedSkillXOnY'), '"'.$skill->getName().'"', api_get_setting('siteName')).' - '.api_get_path(WEB_PATH).'badge/'.$skill->getId().'/user/'.$userId."' target='_new'>
186 186
                             <em class='fa fa-twitter-square fa-3x text-light' aria-hidden='true'></em>
187 187
                         </a>
188 188
                     </div>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $badgeLink .= "
193 193
             <div class='panel panel-default'>
194 194
                 <div class='panel-body'>
195
-                    <h3 class='text-center'>" . get_lang('AdditionallyYouHaveObtainedTheFollowingSkills') . "</h3>
195
+                    <h3 class='text-center'>" . get_lang('AdditionallyYouHaveObtainedTheFollowingSkills')."</h3>
196 196
                     $skillList
197 197
                 </div>
198 198
             </div>
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 function generateLPFinalItemTemplateCertificateLinks($certificate)
210 210
 {
211 211
     $downloadCertificateLink = Display::url(
212
-        Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadCertificatePdf'),
212
+        Display::returnFontAwesomeIcon('file-pdf-o').get_lang('DownloadCertificatePdf'),
213 213
         $certificate['pdf_url'],
214 214
         ['class' => 'btn btn-default']
215 215
     );
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     $downloadCertificateLink = "
218 218
         <div class='panel panel-default'>
219 219
             <div class='panel-body'>
220
-                <h3 class='text-center'>" . get_lang('NowDownloadYourCertificateClickHere') . "</h3>
220
+                <h3 class='text-center'>" . get_lang('NowDownloadYourCertificateClickHere')."</h3>
221 221
                 <div class='text-center'>$downloadCertificateLink $viewCertificateLink</div>
222 222
             </div>
223 223
         </div>
Please login to merge, or discard this patch.
main/inc/lib/document.lib.php 1 patch
Spacing   +335 added lines, -335 removed lines patch added patch discarded remove patch
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
             return true;
291 291
         } else {
292 292
             $tbl_document = Database::get_course_table(TABLE_DOCUMENT);
293
-            $tbl_item_property = $this_course . 'item_property';
293
+            $tbl_item_property = $this_course.'item_property';
294 294
             $doc_url = Database::escape_string($doc_url);
295 295
             $query = "SELECT 1 FROM $tbl_document AS docs,$tbl_item_property AS props
296 296
                       WHERE
@@ -340,18 +340,18 @@  discard block
 block discarded – undo
340 340
             }
341 341
 
342 342
             header('Content-type: application/octet-stream');
343
-            header('Content-length: ' . $len);
343
+            header('Content-length: '.$len);
344 344
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
345
-                header('Content-Disposition: filename= ' . $filename);
345
+                header('Content-Disposition: filename= '.$filename);
346 346
             } else {
347
-                header('Content-Disposition: attachment; filename= ' . $filename);
347
+                header('Content-Disposition: attachment; filename= '.$filename);
348 348
             }
349 349
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
350 350
                 header('Pragma: ');
351 351
                 header('Cache-Control: ');
352 352
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
353 353
             }
354
-            header('Content-Description: ' . $filename);
354
+            header('Content-Description: '.$filename);
355 355
             header('Content-Transfer-Encoding: binary');
356 356
 
357 357
             $res = fopen($full_file_name, 'r');
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
             $lpFixedEncoding = api_get_configuration_value('lp_fixed_encoding');
366 366
 
367 367
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
368
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
368
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
369 369
             // Commented to avoid double caching declaration when playing with IE and HTTPS
370 370
             //header('Cache-Control: no-cache, must-revalidate');
371 371
             //header('Pragma: no-cache');
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
                     } else {
377 377
                         $encoding = @api_detect_encoding_html(file_get_contents($full_file_name));
378 378
                         if (!empty($encoding)) {
379
-                            $content_type .= '; charset=' . $encoding;
379
+                            $content_type .= '; charset='.$encoding;
380 380
                         }
381 381
                     }
382 382
                     break;
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                     } else {
387 387
                         $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name)));
388 388
                         if (!empty($encoding)) {
389
-                            $content_type .= '; charset=' . $encoding;
389
+                            $content_type .= '; charset='.$encoding;
390 390
                         }
391 391
                     }
392 392
                     break;
@@ -395,13 +395,13 @@  discard block
 block discarded – undo
395 395
                     header('Content-type: application/octet-stream');
396 396
                     break;
397 397
             }
398
-            header('Content-type: ' . $content_type);
399
-            header('Content-Length: ' . $len);
398
+            header('Content-type: '.$content_type);
399
+            header('Content-Length: '.$len);
400 400
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
401 401
             if (strpos($user_agent, 'msie')) {
402
-                header('Content-Disposition: ; filename= ' . $filename);
402
+                header('Content-Disposition: ; filename= '.$filename);
403 403
             } else {
404
-                header('Content-Disposition: inline; filename= ' . $filename);
404
+                header('Content-Disposition: inline; filename= '.$filename);
405 405
             }
406 406
 
407 407
             if ($fixLinksHttpToHttps) {
@@ -442,18 +442,18 @@  discard block
 block discarded – undo
442 442
 
443 443
             header('Content-type: application/octet-stream');
444 444
             //header('Content-Type: application/force-download');
445
-            header('Content-length: ' . $len);
445
+            header('Content-length: '.$len);
446 446
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
447
-                header('Content-Disposition: filename= ' . $filename);
447
+                header('Content-Disposition: filename= '.$filename);
448 448
             } else {
449
-                header('Content-Disposition: attachment; filename= ' . $filename);
449
+                header('Content-Disposition: attachment; filename= '.$filename);
450 450
             }
451 451
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
452 452
                 header('Pragma: ');
453 453
                 header('Cache-Control: ');
454 454
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
455 455
             }
456
-            header('Content-Description: ' . $filename);
456
+            header('Content-Description: '.$filename);
457 457
             header('Content-transfer-encoding: binary');
458 458
             echo $full_string;
459 459
 
@@ -466,30 +466,30 @@  discard block
 block discarded – undo
466 466
 
467 467
             $content_type = self::file_get_mime_type($filename);
468 468
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
469
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
469
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
470 470
             header('Cache-Control: no-cache, must-revalidate');
471 471
             header('Pragma: no-cache');
472 472
             switch ($content_type) {
473 473
                 case 'text/html':
474 474
                     $encoding = @api_detect_encoding_html($full_string);
475 475
                     if (!empty($encoding)) {
476
-                        $content_type .= '; charset=' . $encoding;
476
+                        $content_type .= '; charset='.$encoding;
477 477
                     }
478 478
                     break;
479 479
                 case 'text/plain':
480 480
                     $encoding = @api_detect_encoding(strip_tags($full_string));
481 481
                     if (!empty($encoding)) {
482
-                        $content_type .= '; charset=' . $encoding;
482
+                        $content_type .= '; charset='.$encoding;
483 483
                     }
484 484
                     break;
485 485
             }
486
-            header('Content-type: ' . $content_type);
487
-            header('Content-Length: ' . $len);
486
+            header('Content-type: '.$content_type);
487
+            header('Content-Length: '.$len);
488 488
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
489 489
             if (strpos($user_agent, 'msie')) {
490
-                header('Content-Disposition: ; filename= ' . $filename);
490
+                header('Content-Disposition: ; filename= '.$filename);
491 491
             } else {
492
-                header('Content-Disposition: inline; filename= ' . $filename);
492
+                header('Content-Disposition: inline; filename= '.$filename);
493 493
             }
494 494
             echo($full_string);
495 495
             //You have to ensure that the calling script then stops processing (exit();)
@@ -582,9 +582,9 @@  discard block
 block discarded – undo
582 582
             if (!empty($students)) {
583 583
                 $conditionList = array();
584 584
                 foreach ($students as $studentId => $studentInfo) {
585
-                    $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
585
+                    $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
586 586
                 }
587
-                $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")';
587
+                $sharedCondition .= ' AND docs.path IN ("'.implode('","', $conditionList).'")';
588 588
             }
589 589
         }
590 590
 
@@ -610,8 +610,8 @@  discard block
 block discarded – undo
610 610
                     last.c_id = {$_course['real_id']}
611 611
                 )
612 612
                 WHERE
613
-                    docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND
614
-                    docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND
613
+                    docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND
614
+                    docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND
615 615
                     docs.path NOT LIKE '%_DELETED_%' AND
616 616
                     $userGroupFilter AND
617 617
                     last.visibility $visibility_bit
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
                     $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES);
653 653
                     $sql = "SELECT id FROM $table_template
654 654
                             WHERE
655
-                                course_code = '" . $_course['code'] . "' AND
655
+                                course_code = '".$_course['code']."' AND
656 656
                                 user_id = '".api_get_user_id()."' AND
657 657
                                 ref_doc = '".$row['id']."'";
658 658
                     $template_result = Database::query($sql);
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
         if (!empty($students)) {
763 763
             $conditionList = array();
764 764
             foreach ($students as $studentId => $studentInfo) {
765
-                $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
765
+                $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
766 766
             }
767 767
         }
768 768
 
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
                        INNER JOIN $TABLE_DOCUMENT  AS docs
787 787
                        ON (
788 788
                             docs.id = last.ref AND
789
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
789
+                            last.tool = '".TOOL_DOCUMENT."' AND
790 790
                             last.c_id = {$_course['real_id']} AND
791 791
                             docs.c_id = {$_course['real_id']}
792 792
                        )
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
                         INNER JOIN $TABLE_DOCUMENT  AS docs
804 804
                         ON (
805 805
                             docs.id = last.ref AND
806
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
806
+                            last.tool = '".TOOL_DOCUMENT."' AND
807 807
                             last.c_id = {$_course['real_id']} AND
808 808
                             docs.c_id = {$_course['real_id']}
809 809
                         )
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
                     WHERE
851 851
                         docs.id = last.ref AND
852 852
                         docs.filetype = 'folder' AND
853
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
853
+                        last.tool = '".TOOL_DOCUMENT."' AND
854 854
                         $groupCondition AND
855 855
                         last.visibility = 1
856 856
                         $condition_session AND
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
                     WHERE
872 872
                         docs.id = last.ref AND
873 873
                         docs.filetype = 'folder' AND
874
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
874
+                        last.tool = '".TOOL_DOCUMENT."' AND
875 875
                         $groupCondition AND
876 876
                         last.visibility = 0 $condition_session AND
877 877
                         last.c_id = {$_course['real_id']} AND
@@ -887,9 +887,9 @@  discard block
 block discarded – undo
887 887
                         FROM $TABLE_ITEMPROPERTY AS last, $TABLE_DOCUMENT AS docs
888 888
                         WHERE
889 889
                             docs.id = last.ref AND
890
-                            docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND
890
+                            docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND
891 891
                             docs.filetype = 'folder' AND
892
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
892
+                            last.tool = '" . TOOL_DOCUMENT."' AND
893 893
                             $groupCondition AND
894 894
                             last.visibility = 1 $condition_session AND
895 895
                             last.c_id = {$_course['real_id']} AND
@@ -966,7 +966,7 @@  discard block
 block discarded – undo
966 966
                                 tp.c_id = $course_id AND
967 967
                                 td.session_id = $sessionId AND
968 968
                                 tp.ref= td.id AND
969
-                                (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) ";
969
+                                (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
970 970
                     // Get all id's of documents that are deleted
971 971
                     $what_to_check_result = Database::query($sql);
972 972
 
@@ -1308,7 +1308,7 @@  discard block
 block discarded – undo
1308 1308
             $res = Database::query($sql);
1309 1309
             if (Database::num_rows($res) > 0) {
1310 1310
                 $row2 = Database::fetch_array($res);
1311
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
1311
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
1312 1312
                 $di = new ChamiloIndexer();
1313 1313
                 $di->remove_document((int) $row2['search_did']);
1314 1314
             }
@@ -1317,7 +1317,7 @@  discard block
 block discarded – undo
1317 1317
             Database::query($sql);
1318 1318
 
1319 1319
             // remove terms from db
1320
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
1320
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
1321 1321
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id);
1322 1322
         }
1323 1323
     }
@@ -1406,12 +1406,12 @@  discard block
 block discarded – undo
1406 1406
             $path = str_replace('%2F', '/', $url_path);
1407 1407
             $pathinfo = pathinfo($row['path']);
1408 1408
 
1409
-            $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id;
1410
-            $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id;
1411
-            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1412
-            $row['absolute_path_from_document'] = '/document' . $row['path'];
1413
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
1414
-            $row['direct_url'] = $www . $path;
1409
+            $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id;
1410
+            $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id;
1411
+            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1412
+            $row['absolute_path_from_document'] = '/document'.$row['path'];
1413
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/';
1414
+            $row['direct_url'] = $www.$path;
1415 1415
 
1416 1416
             if (dirname($row['path']) == '.') {
1417 1417
                 $row['parent_id'] = '0';
@@ -1430,7 +1430,7 @@  discard block
 block discarded – undo
1430 1430
                 $real_dir = '';
1431 1431
 
1432 1432
                 for ($i = 1; $i < $array_len; $i++) {
1433
-                    $real_dir .= '/' . $dir_array[$i];
1433
+                    $real_dir .= '/'.$dir_array[$i];
1434 1434
                     $parent_id = self::get_document_id($course_info, $real_dir);
1435 1435
                     if ($session_id != 0 && empty($parent_id)) {
1436 1436
                         $parent_id = self::get_document_id($course_info, $real_dir, 0);
@@ -1504,21 +1504,21 @@  discard block
 block discarded – undo
1504 1504
         $user_id = intval($user_id);
1505 1505
         $document_id = intval($document_id);
1506 1506
 
1507
-        $sql = 'SELECT id FROM ' . $table_template . '
1507
+        $sql = 'SELECT id FROM '.$table_template.'
1508 1508
                 WHERE
1509
-                    course_code="' . $course_code . '" AND
1510
-                    user_id="' . $user_id . '" AND
1511
-                    ref_doc="' . $document_id . '"';
1509
+                    course_code="' . $course_code.'" AND
1510
+                    user_id="' . $user_id.'" AND
1511
+                    ref_doc="' . $document_id.'"';
1512 1512
         $result = Database::query($sql);
1513 1513
         $template_id = Database::result($result, 0, 0);
1514 1514
 
1515
-        my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg');
1515
+        my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg');
1516 1516
 
1517
-        $sql = 'DELETE FROM ' . $table_template . '
1517
+        $sql = 'DELETE FROM '.$table_template.'
1518 1518
                 WHERE
1519
-                    course_code="' . $course_code . '" AND
1520
-                    user_id="' . $user_id . '" AND
1521
-                    ref_doc="' . $document_id . '"';
1519
+                    course_code="' . $course_code.'" AND
1520
+                    user_id="' . $user_id.'" AND
1521
+                    ref_doc="' . $document_id.'"';
1522 1522
 
1523 1523
         Database::query($sql);
1524 1524
     }
@@ -1578,9 +1578,9 @@  discard block
 block discarded – undo
1578 1578
                 INNER JOIN $propTable ip
1579 1579
                 ON (d.id = ip.ref AND d.c_id  = $course_id AND ip.c_id = $course_id)
1580 1580
         		WHERE
1581
-        		    ip.tool = '" . TOOL_DOCUMENT . "' $condition AND
1581
+        		    ip.tool = '".TOOL_DOCUMENT."' $condition AND
1582 1582
         			filetype = '$file_type' AND
1583
-        			locate(concat(path,'/'), '" . Database::escape_string($doc_path.'/'). "')=1
1583
+        			locate(concat(path,'/'), '".Database::escape_string($doc_path.'/')."')=1
1584 1584
                 ";
1585 1585
 
1586 1586
         $result = Database::query($sql);
@@ -1743,12 +1743,12 @@  discard block
 block discarded – undo
1743 1743
         if (empty($session_id)) {
1744 1744
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1745 1745
         } elseif ($session_id > 0) {
1746
-            $sql_session = 'AND session_id=' . intval($session_id);
1746
+            $sql_session = 'AND session_id='.intval($session_id);
1747 1747
         } else {
1748 1748
             $sql_session = '';
1749 1749
         }
1750
-        $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '"
1751
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1750
+        $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'"
1751
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1752 1752
         Database::query($sql);
1753 1753
     }
1754 1754
 
@@ -1770,12 +1770,12 @@  discard block
 block discarded – undo
1770 1770
         if (empty($session_id)) {
1771 1771
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1772 1772
         } elseif ($session_id > 0) {
1773
-            $sql_session = 'AND session_id=' . intval($session_id);
1773
+            $sql_session = 'AND session_id='.intval($session_id);
1774 1774
         } else {
1775 1775
             $sql_session = '';
1776 1776
         }
1777
-        $sql = 'SELECT document_id FROM ' . $tbl_category . '
1778
-                WHERE course_code="' . Database::escape_string($course_id) . '" ' . $sql_session;
1777
+        $sql = 'SELECT document_id FROM '.$tbl_category.'
1778
+                WHERE course_code="' . Database::escape_string($course_id).'" '.$sql_session;
1779 1779
 
1780 1780
         $rs = Database::query($sql);
1781 1781
         $num = Database::num_rows($rs);
@@ -1816,7 +1816,7 @@  discard block
 block discarded – undo
1816 1816
             $all_user_info = array();
1817 1817
             if (Database::num_rows($rs)) {
1818 1818
                 $row = Database::fetch_array($rs);
1819
-                $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1819
+                $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1820 1820
                 if (is_file($filepath)) {
1821 1821
                     $my_content_html = file_get_contents($filepath);
1822 1822
                 }
@@ -1899,9 +1899,9 @@  discard block
 block discarded – undo
1899 1899
             $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY);
1900 1900
         }
1901 1901
 
1902
-        $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id'];
1902
+        $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id'];
1903 1903
 
1904
-        $externalStyleFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/certificate.css';
1904
+        $externalStyleFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/certificate.css';
1905 1905
         $externalStyle = '';
1906 1906
 
1907 1907
         if (is_file($externalStyleFile)) {
@@ -1923,7 +1923,7 @@  discard block
 block discarded – undo
1923 1923
             $course_info['name'],
1924 1924
             $info_grade_certificate['grade'],
1925 1925
             $url,
1926
-            '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>',
1926
+            '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>',
1927 1927
             '((certificate_barcode))',
1928 1928
             $externalStyle
1929 1929
         );
@@ -1949,7 +1949,7 @@  discard block
 block discarded – undo
1949 1949
         if (!empty($extraFields)) {
1950 1950
             foreach ($extraFields as $extraField) {
1951 1951
                 $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : '';
1952
-                $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))';
1952
+                $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))';
1953 1953
                 $info_to_replace_in_content_html[] = $valueExtra;
1954 1954
             }
1955 1955
         }
@@ -1977,17 +1977,17 @@  discard block
 block discarded – undo
1977 1977
             $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
1978 1978
             $session_id = api_get_session_id();
1979 1979
             if ($session_id == 0 || is_null($session_id)) {
1980
-                $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) ';
1980
+                $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) ';
1981 1981
             } elseif ($session_id > 0) {
1982
-                $sql_session = 'AND session_id=' . intval($session_id);
1982
+                $sql_session = 'AND session_id='.intval($session_id);
1983 1983
             } else {
1984 1984
                 $sql_session = '';
1985 1985
             }
1986 1986
 
1987
-            $sql = 'UPDATE ' . $tbl_category . ' SET document_id=null
1987
+            $sql = 'UPDATE '.$tbl_category.' SET document_id=null
1988 1988
                     WHERE
1989
-                        course_code = "' . Database::escape_string($course_id) . '" AND
1990
-                        document_id="' . $default_certificate_id . '" ' . $sql_session;
1989
+                        course_code = "' . Database::escape_string($course_id).'" AND
1990
+                        document_id="' . $default_certificate_id.'" '.$sql_session;
1991 1991
             Database::query($sql);
1992 1992
         }
1993 1993
     }
@@ -2003,10 +2003,10 @@  discard block
 block discarded – undo
2003 2003
         if (!empty($courseInfo)) {
2004 2004
             $to_group_id = 0;
2005 2005
             $to_user_id = null;
2006
-            $course_dir = $courseInfo['path'] . "/document/";
2006
+            $course_dir = $courseInfo['path']."/document/";
2007 2007
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
2008
-            $base_work_dir = $sys_course_path . $course_dir;
2009
-            $base_work_dir_test = $base_work_dir . 'certificates';
2008
+            $base_work_dir = $sys_course_path.$course_dir;
2009
+            $base_work_dir_test = $base_work_dir.'certificates';
2010 2010
             $dir_name = '/certificates';
2011 2011
             $post_dir_name = get_lang('CertificatesFiles');
2012 2012
             $visibility_command = 'invisible';
@@ -2233,9 +2233,9 @@  discard block
 block discarded – undo
2233 2233
                                             //$new_abs_path = realpath($dir.'/'.$second_part);
2234 2234
                                             $dir = '';
2235 2235
                                             if (!empty($abs_path)) {
2236
-                                                $dir = dirname($abs_path) . '/';
2236
+                                                $dir = dirname($abs_path).'/';
2237 2237
                                             }
2238
-                                            $new_abs_path = realpath($dir . $second_part);
2238
+                                            $new_abs_path = realpath($dir.$second_part);
2239 2239
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2240 2240
                                             if (count($in_files_list) > 0) {
2241 2241
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2248,9 +2248,9 @@  discard block
 block discarded – undo
2248 2248
                                             $files_list[] = array($second_part, 'local', 'rel');
2249 2249
                                             $dir = '';
2250 2250
                                             if (!empty($abs_path)) {
2251
-                                                $dir = dirname($abs_path) . '/';
2251
+                                                $dir = dirname($abs_path).'/';
2252 2252
                                             }
2253
-                                            $new_abs_path = realpath($dir . $second_part);
2253
+                                            $new_abs_path = realpath($dir.$second_part);
2254 2254
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2255 2255
                                             if (count($in_files_list) > 0) {
2256 2256
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2284,9 +2284,9 @@  discard block
 block discarded – undo
2284 2284
                                             $files_list[] = array($source, 'local', 'rel');
2285 2285
                                             $dir = '';
2286 2286
                                             if (!empty($abs_path)) {
2287
-                                                $dir = dirname($abs_path) . '/';
2287
+                                                $dir = dirname($abs_path).'/';
2288 2288
                                             }
2289
-                                            $new_abs_path = realpath($dir . $source);
2289
+                                            $new_abs_path = realpath($dir.$source);
2290 2290
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2291 2291
                                             if (count($in_files_list) > 0) {
2292 2292
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2299,9 +2299,9 @@  discard block
 block discarded – undo
2299 2299
                                             $files_list[] = array($source, 'local', 'rel');
2300 2300
                                             $dir = '';
2301 2301
                                             if (!empty($abs_path)) {
2302
-                                                $dir = dirname($abs_path) . '/';
2302
+                                                $dir = dirname($abs_path).'/';
2303 2303
                                             }
2304
-                                            $new_abs_path = realpath($dir . $source);
2304
+                                            $new_abs_path = realpath($dir.$source);
2305 2305
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2306 2306
                                             if (count($in_files_list) > 0) {
2307 2307
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2335,9 +2335,9 @@  discard block
 block discarded – undo
2335 2335
                                     $files_list[] = array($source, 'local', 'rel');
2336 2336
                                     $dir = '';
2337 2337
                                     if (!empty($abs_path)) {
2338
-                                        $dir = dirname($abs_path) . '/';
2338
+                                        $dir = dirname($abs_path).'/';
2339 2339
                                     }
2340
-                                    $new_abs_path = realpath($dir . $source);
2340
+                                    $new_abs_path = realpath($dir.$source);
2341 2341
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2342 2342
                                     if (count($in_files_list) > 0) {
2343 2343
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2350,9 +2350,9 @@  discard block
 block discarded – undo
2350 2350
                                     $files_list[] = array($source, 'local', 'rel');
2351 2351
                                     $dir = '';
2352 2352
                                     if (!empty($abs_path)) {
2353
-                                        $dir = dirname($abs_path) . '/';
2353
+                                        $dir = dirname($abs_path).'/';
2354 2354
                                     }
2355
-                                    $new_abs_path = realpath($dir . $source);
2355
+                                    $new_abs_path = realpath($dir.$source);
2356 2356
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2357 2357
                                     if (count($in_files_list) > 0) {
2358 2358
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2410,24 +2410,24 @@  discard block
 block discarded – undo
2410 2410
             // then possible closing brackets if we were in the opening bracket case
2411 2411
             // OR something like @import()
2412 2412
             $res = preg_match_all(
2413
-                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' .
2413
+                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'.
2414 2414
                 // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much
2415 2415
                 // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name
2416
-                '([ \n\t\r]+)?(' .
2416
+                '([ \n\t\r]+)?('.
2417 2417
                 // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself
2418
-                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' .
2419
-                '|' .
2418
+                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'.
2419
+                '|'.
2420 2420
                 // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself
2421
-                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' .
2422
-                '))' .
2423
-                '|' .
2421
+                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'.
2422
+                '))'.
2423
+                '|'.
2424 2424
                 // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities)
2425 2425
                 '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/',
2426 2426
                 $attrString,
2427 2427
                 $regs
2428 2428
             );
2429 2429
         } catch (Exception $e) {
2430
-            error_log('Caught exception: ' . $e->getMessage(), 0);
2430
+            error_log('Caught exception: '.$e->getMessage(), 0);
2431 2431
         }
2432 2432
         if ($res) {
2433 2433
             for ($i = 0; $i < count($regs[1]); $i++) {
@@ -2505,14 +2505,14 @@  discard block
 block discarded – undo
2505 2505
                 $orig_course_info_path = $origin_course_info_path;
2506 2506
             }
2507 2507
         } else {
2508
-            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/';
2508
+            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/';
2509 2509
             $orig_course_info_path = $orig_course_info['path'];
2510 2510
         }
2511 2511
 
2512 2512
         $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory);
2513 2513
         $destination_course_info = api_get_course_info($destination_course_code);
2514
-        $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/';
2515
-        $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/';
2514
+        $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/';
2515
+        $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/';
2516 2516
 
2517 2517
         $user_id = api_get_user_id();
2518 2518
 
@@ -2521,7 +2521,7 @@  discard block
 block discarded – undo
2521 2521
 
2522 2522
                 // Get information about source url
2523 2523
                 $real_orig_url = $source[0]; // url
2524
-                $scope_url = $source[1];   // scope (local, remote)
2524
+                $scope_url = $source[1]; // scope (local, remote)
2525 2525
                 $type_url = $source[2]; // type (rel, abs, url)
2526 2526
 
2527 2527
                 // Get path and query from origin url
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
                 $dest_url_query = '';
2534 2534
 
2535 2535
                 if (!empty($real_orig_query)) {
2536
-                    $dest_url_query = '?' . $real_orig_query;
2536
+                    $dest_url_query = '?'.$real_orig_query;
2537 2537
                     if (strpos($dest_url_query, $origin_course_code) !== false) {
2538 2538
                         $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query);
2539 2539
                     }
@@ -2614,7 +2614,7 @@  discard block
 block discarded – undo
2614 2614
 
2615 2615
                                 //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query;
2616 2616
                                 // See BT#7780
2617
-                                $destination_url = $dest_course_path_rel . $document_file . $dest_url_query;
2617
+                                $destination_url = $dest_course_path_rel.$document_file.$dest_url_query;
2618 2618
 
2619 2619
                                 // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985
2620 2620
                                 if (strpos($real_orig_path, $origin_course_code) === false) {
@@ -2649,14 +2649,14 @@  discard block
 block discarded – undo
2649 2649
     function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path)
2650 2650
     {
2651 2651
         if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') {
2652
-            $original = $original_path . $file_name;
2652
+            $original = $original_path.$file_name;
2653 2653
         } else {
2654
-            $original = $original_path . '/' . $file_name;
2654
+            $original = $original_path.'/'.$file_name;
2655 2655
         }
2656 2656
         if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') {
2657
-            $destination = $destiny_path . $file_name;
2657
+            $destination = $destiny_path.$file_name;
2658 2658
         } else {
2659
-            $destination = $destiny_path . '/' . $file_name;
2659
+            $destination = $destiny_path.'/'.$file_name;
2660 2660
         }
2661 2661
         $original_count = count(explode('/', $original));
2662 2662
         $destination_count = count(explode('/', $destination));
@@ -2670,8 +2670,8 @@  discard block
 block discarded – undo
2670 2670
             $mode = 'inside';
2671 2671
         }
2672 2672
         //We do not select the $original_path becayse the file was already moved
2673
-        $content_html = file_get_contents($destiny_path . '/' . $file_name);
2674
-        $destination_file = $destiny_path . '/' . $file_name;
2673
+        $content_html = file_get_contents($destiny_path.'/'.$file_name);
2674
+        $destination_file = $destiny_path.'/'.$file_name;
2675 2675
 
2676 2676
         $pre_original = strstr($original_path, 'document');
2677 2677
         $pre_destin = strstr($destiny_path, 'document');
@@ -2693,11 +2693,11 @@  discard block
 block discarded – undo
2693 2693
         }
2694 2694
 
2695 2695
         if ($pre_original != '') {
2696
-            $pre_original = '..' . $pre_original . '/';
2696
+            $pre_original = '..'.$pre_original.'/';
2697 2697
         }
2698 2698
 
2699 2699
         if ($pre_destin != '') {
2700
-            $pre_destin = '..' . $pre_destin . '/';
2700
+            $pre_destin = '..'.$pre_destin.'/';
2701 2701
         }
2702 2702
 
2703 2703
         $levels = explode('/', $pre_original);
@@ -2715,7 +2715,7 @@  discard block
 block discarded – undo
2715 2715
         //echo '$count_pre_destination_levels '. $count_pre_destination_levels;
2716 2716
         $pre_remove = '';
2717 2717
         for ($i = 1; $i <= $count_pre_destination_levels; $i++) {
2718
-            $pre_remove .='..\/';
2718
+            $pre_remove .= '..\/';
2719 2719
         }
2720 2720
 
2721 2721
         $orig_source_html = DocumentManager::get_resources_from_source_html($content_html);
@@ -2723,9 +2723,9 @@  discard block
 block discarded – undo
2723 2723
         foreach ($orig_source_html as $source) {
2724 2724
 
2725 2725
             // get information about source url
2726
-            $real_orig_url = $source[0];   // url
2727
-            $scope_url = $source[1];   // scope (local, remote)
2728
-            $type_url = $source[2];   // tyle (rel, abs, url)
2726
+            $real_orig_url = $source[0]; // url
2727
+            $scope_url = $source[1]; // scope (local, remote)
2728
+            $type_url = $source[2]; // tyle (rel, abs, url)
2729 2729
             // Get path and query from origin url
2730 2730
             $orig_parse_url = parse_url($real_orig_url);
2731 2731
             $real_orig_path = $orig_parse_url['path'];
@@ -2752,11 +2752,11 @@  discard block
 block discarded – undo
2752 2752
                         $real_orig_url_temp = '';
2753 2753
                         if ($mode == 'inside') {
2754 2754
                             $real_orig_url_temp = str_replace('../', '', $real_orig_url);
2755
-                            $destination_url = $link_to_add . $real_orig_url_temp;
2755
+                            $destination_url = $link_to_add.$real_orig_url_temp;
2756 2756
                         } else {
2757 2757
                             $real_orig_url_temp = $real_orig_url;
2758 2758
 
2759
-                            $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1);
2759
+                            $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1);
2760 2760
                         }
2761 2761
                         if ($real_orig_url == $destination_url) {
2762 2762
                             //echo 'continue2';
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
     {
2783 2783
         $course_data = api_get_course_info($course_code);
2784 2784
         $document_data = self::get_document_data_by_id($document_id, $course_code);
2785
-        $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path'];
2785
+        $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path'];
2786 2786
         $pdf = new PDF('A4-L', 'L');
2787 2787
         $pdf->html_to_pdf($file_path, $document_data['title'], $course_code);
2788 2788
     }
@@ -2813,9 +2813,9 @@  discard block
 block discarded – undo
2813 2813
     ) {
2814 2814
         $course_info = api_get_course_info();
2815 2815
         $sessionId = api_get_session_id();
2816
-        $course_dir = $course_info['path'] . '/document';
2816
+        $course_dir = $course_info['path'].'/document';
2817 2817
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
2818
-        $base_work_dir = $sys_course_path . $course_dir;
2818
+        $base_work_dir = $sys_course_path.$course_dir;
2819 2819
 
2820 2820
         if (isset($files[$fileKey])) {
2821 2821
             $upload_ok = process_uploaded_file($files[$fileKey], $show_output);
@@ -2892,7 +2892,7 @@  discard block
 block discarded – undo
2892 2892
                     // Showing message when sending zip files
2893 2893
                     if ($new_path === true && $unzip == 1 && $show_output) {
2894 2894
                         Display::display_confirmation_message(
2895
-                            get_lang('UplUploadSucceeded') . '<br />',
2895
+                            get_lang('UplUploadSucceeded').'<br />',
2896 2896
                             false
2897 2897
                         );
2898 2898
                     }
@@ -2994,7 +2994,7 @@  discard block
 block discarded – undo
2994 2994
         }
2995 2995
         if (isset($output)) {
2996 2996
             foreach ($output as & $line) {
2997
-                $content .= $line . "\n";
2997
+                $content .= $line."\n";
2998 2998
             }
2999 2999
             return $content;
3000 3000
         } else {
@@ -3026,13 +3026,13 @@  discard block
 block discarded – undo
3026 3026
         $group_condition = null;
3027 3027
         if (isset($group_id)) {
3028 3028
             $group_id = intval($group_id);
3029
-            $group_condition = " AND props.to_group_id='" . $group_id . "' ";
3029
+            $group_condition = " AND props.to_group_id='".$group_id."' ";
3030 3030
         }
3031 3031
 
3032 3032
         $session_condition = null;
3033 3033
         if (isset($session_id)) {
3034 3034
             $session_id = intval($session_id);
3035
-            $session_condition = " AND props.session_id='" . $session_id . "' ";
3035
+            $session_condition = " AND props.session_id='".$session_id."' ";
3036 3036
         }
3037 3037
 
3038 3038
         $sql = "SELECT SUM(size)
@@ -3042,7 +3042,7 @@  discard block
 block discarded – undo
3042 3042
                 WHERE
3043 3043
                     props.c_id 	= $course_id AND
3044 3044
                     docs.c_id 	= $course_id AND
3045
-                    props.tool 	= '" . TOOL_DOCUMENT . "' AND
3045
+                    props.tool 	= '".TOOL_DOCUMENT."' AND
3046 3046
                     props.visibility <> 2
3047 3047
                     $group_condition
3048 3048
                     $session_condition
@@ -3065,8 +3065,8 @@  discard block
 block discarded – undo
3065 3065
         $course_quota_m = round($course_quota / 1048576);
3066 3066
         $already_consumed_space_m = round($already_consumed_space / 1048576);
3067 3067
 
3068
-        $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
3069
-        $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
3068
+        $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />';
3069
+        $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />';
3070 3070
 
3071 3071
         $percentage = round(($already_consumed_space / $course_quota * 100), 1);
3072 3072
 
@@ -3074,33 +3074,33 @@  discard block
 block discarded – undo
3074 3074
 
3075 3075
         // Decide where to place percentage in graph
3076 3076
         if ($percentage >= 50) {
3077
-            $text_in_filled = '&nbsp;' . $other_percentage . '%';
3077
+            $text_in_filled = '&nbsp;'.$other_percentage.'%';
3078 3078
             $text_in_unfilled = '';
3079 3079
         } else {
3080
-            $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
3080
+            $text_in_unfilled = '&nbsp;'.$other_percentage.'%';
3081 3081
             $text_in_filled = '';
3082 3082
         }
3083 3083
 
3084 3084
         // Decide the background colour of the graph
3085 3085
         if ($percentage < 65) {
3086
-            $colour = '#00BB00';        // Safe - green
3086
+            $colour = '#00BB00'; // Safe - green
3087 3087
         } elseif ($percentage < 90) {
3088
-            $colour = '#ffd400';        // Filling up - yelloworange
3088
+            $colour = '#ffd400'; // Filling up - yelloworange
3089 3089
         } else {
3090
-            $colour = '#DD0000';        // Full - red
3090
+            $colour = '#DD0000'; // Full - red
3091 3091
         }
3092 3092
 
3093 3093
         // This is used for the table width: a table of only 100 pixels looks too small
3094 3094
         $visual_percentage = 4 * $percentage;
3095 3095
         $visual_other_percentage = 4 * $other_percentage;
3096 3096
 
3097
-        $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' .
3098
-            get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
3097
+        $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'.
3098
+            get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />';
3099 3099
 
3100
-        $show_percentage = '&nbsp;' . $percentage . '%';
3101
-        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\'' . api_get_path(WEB_CODE_PATH) . 'css/' . api_get_visual_theme() . '/images/bg-header4.png\');" class="document-quota-bar">' .
3102
-            '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' .
3103
-            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
3100
+        $show_percentage = '&nbsp;'.$percentage.'%';
3101
+        $message .= '<div style="width: 80%; text-align: center; -moz-border-radius: 5px 5px 5px 5px; border: 1px solid #aaa; background-image: url(\''.api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/bg-header4.png\');" class="document-quota-bar">'.
3102
+            '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>'.
3103
+            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>';
3104 3104
         echo $message;
3105 3105
     }
3106 3106
 
@@ -3116,7 +3116,7 @@  discard block
 block discarded – undo
3116 3116
         $percentage = $already_consumed_space / $course_quota * 100;
3117 3117
         $percentage = round($percentage, 1);
3118 3118
         $message = get_lang('YouAreCurrentlyUsingXOfYourX');
3119
-        $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' ');
3119
+        $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' ');
3120 3120
         echo Display::div($message, array('id' => 'document_quota'));
3121 3121
     }
3122 3122
 
@@ -3147,13 +3147,13 @@  discard block
 block discarded – undo
3147 3147
      */
3148 3148
     static function generate_jplayer_jquery($params = array())
3149 3149
     {
3150
-        $js_path = api_get_path(WEB_LIBRARY_PATH) . 'javascript/';
3150
+        $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
3151 3151
 
3152 3152
         $js = '
3153
-            $("#jquery_jplayer_' . $params['count'] . '").jPlayer({
3153
+            $("#jquery_jplayer_' . $params['count'].'").jPlayer({
3154 3154
                 ready: function() {
3155 3155
                     $(this).jPlayer("setMedia", {
3156
-                        ' . $params['extension'] . ' : "' . $params['url'] . '"
3156
+                        ' . $params['extension'].' : "'.$params['url'].'"
3157 3157
                     });
3158 3158
                 },
3159 3159
                 play: function() { // To avoid both jPlayers playing together.
@@ -3161,12 +3161,12 @@  discard block
 block discarded – undo
3161 3161
                 },
3162 3162
                 //errorAlerts: true,
3163 3163
                 //warningAlerts: true,
3164
-                swfPath: "' . $js_path . 'jquery-jplayer/jplayer/",
3164
+                swfPath: "' . $js_path.'jquery-jplayer/jplayer/",
3165 3165
                 //supplied: "m4a, oga, mp3, ogg, wav",
3166
-                supplied: "' . $params['extension'] . '",
3166
+                supplied: "' . $params['extension'].'",
3167 3167
                 wmode: "window",
3168 3168
                 solution: "flash, html",  // Do not change this setting
3169
-                cssSelectorAncestor: "#jp_container_' . $params['count'] . '",
3169
+                cssSelectorAncestor: "#jp_container_' . $params['count'].'",
3170 3170
             });  	 ' . "\n\n";
3171 3171
 
3172 3172
         return $js;
@@ -3196,16 +3196,16 @@  discard block
 block discarded – undo
3196 3196
         }
3197 3197
 
3198 3198
         //Shows only the play button
3199
-        $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div>
3200
-                <div id="jp_container_' . $i . '" class="jp-audio">
3199
+        $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div>
3200
+                <div id="jp_container_' . $i.'" class="jp-audio">
3201 3201
                     <div class="jp-type-single">
3202 3202
                         <div class="jp-gui jp-interface">
3203 3203
                             <ul class="jp-controls">
3204 3204
                                 <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3205 3205
                                 <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3206
-                                ' . $extra_controls . '
3206
+                                ' . $extra_controls.'
3207 3207
                             </ul>
3208
-                            ' . $progress . '
3208
+                            ' . $progress.'
3209 3209
                         </div>
3210 3210
                     </div>
3211 3211
                 </div>';
@@ -3258,8 +3258,8 @@  discard block
 block discarded – undo
3258 3258
                     </div>
3259 3259
                 </div>
3260 3260
                 <div class="jp-no-solution">
3261
-                    <span>' . get_lang('UpdateRequire') . '</span>
3262
-                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . '
3261
+                    <span>' . get_lang('UpdateRequire').'</span>
3262
+                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").'
3263 3263
                 </div>
3264 3264
             </div>
3265 3265
         </div>';
@@ -3340,7 +3340,7 @@  discard block
 block discarded – undo
3340 3340
 
3341 3341
         $add_folder_filter = null;
3342 3342
         if (!empty($filter_by_folder)) {
3343
-            $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'";
3343
+            $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'";
3344 3344
         }
3345 3345
 
3346 3346
         // If we are in LP display hidden folder https://support.chamilo.org/issues/6679
@@ -3375,7 +3375,7 @@  discard block
 block discarded – undo
3375 3375
 
3376 3376
                 $notLikeCondition = null;
3377 3377
                 for ($i = 1; $i <= $num; $i++) {
3378
-                    $repeat = str_repeat('/%', $i+1);
3378
+                    $repeat = str_repeat('/%', $i + 1);
3379 3379
                     $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' ";
3380 3380
                 }
3381 3381
 
@@ -3400,7 +3400,7 @@  discard block
 block discarded – undo
3400 3400
                 ON (docs.id = last.ref AND docs.c_id = last.c_id)
3401 3401
                 WHERE
3402 3402
                     docs.path NOT LIKE '%_DELETED_%' AND
3403
-                    last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND
3403
+                    last.tool = '".TOOL_DOCUMENT."' $condition_session AND
3404 3404
                     (last.visibility = '1' $lp_visibility_condition) AND
3405 3405
                     last.visibility <> 2 AND
3406 3406
                     docs.c_id = {$course_info['real_id']} AND
@@ -3430,7 +3430,7 @@  discard block
 block discarded – undo
3430 3430
                 Display::url(
3431 3431
                     Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL),
3432 3432
                     ' javascript:void(0);',
3433
-                    array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div')
3433
+                    array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div')
3434 3434
                 ),
3435 3435
                 array('style' => 'position:absolute;right:10px')
3436 3436
             );
@@ -3534,7 +3534,7 @@  discard block
 block discarded – undo
3534 3534
                     $('#'+tempId).hide();
3535 3535
                 } else {
3536 3536
                     image.addClass('open');
3537
-                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
3537
+                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif')."');
3538 3538
                     $('#'+id).hide();
3539 3539
                     $('#'+tempId).show();
3540 3540
 
@@ -3581,7 +3581,7 @@  discard block
 block discarded – undo
3581 3581
         $target,
3582 3582
         $overwrite_url
3583 3583
     ) {
3584
-        $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
3584
+        $img_sys_path = api_get_path(SYS_CODE_PATH).'img/';
3585 3585
         $web_code_path = api_get_path(WEB_CODE_PATH);
3586 3586
 
3587 3587
         $documentId = $resource['id'];
@@ -3596,7 +3596,7 @@  discard block
 block discarded – undo
3596 3596
         // It's a file.
3597 3597
         $icon = choose_image($path);
3598 3598
         $position = strrpos($icon, '.');
3599
-        $icon = substr($icon, 0, $position) . '_small.gif';
3599
+        $icon = substr($icon, 0, $position).'_small.gif';
3600 3600
         $my_file_title = $resource['title'];
3601 3601
         $visibility = $resource['visibility'];
3602 3602
 
@@ -3608,25 +3608,25 @@  discard block
 block discarded – undo
3608 3608
         // Show the "image name" not the filename of the image.
3609 3609
         if ($lp_id) {
3610 3610
             // LP URL
3611
-            $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
3611
+            $url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type='.TOOL_DOCUMENT.'&amp;file='.$documentId.'&amp;lp_id='.$lp_id;
3612 3612
             if (!empty($overwrite_url)) {
3613
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
3613
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.'';
3614 3614
             }
3615 3615
         } else {
3616 3616
             // Direct document URL
3617
-            $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3617
+            $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3618 3618
             if (!empty($overwrite_url)) {
3619
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId;
3619
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId;
3620 3620
             }
3621 3621
         }
3622 3622
 
3623 3623
         $img = Display::returnIconPath($icon);
3624
-        if (!file_exists($img_sys_path . $icon)) {
3624
+        if (!file_exists($img_sys_path.$icon)) {
3625 3625
             $img = Display::returnIconPath('default_small.gif');
3626 3626
         }
3627 3627
 
3628 3628
         $link = Display::url(
3629
-            '<img alt="" src="' . $img . '" title="" />&nbsp;' . $my_file_title, $url,
3629
+            '<img alt="" src="'.$img.'" title="" />&nbsp;'.$my_file_title, $url,
3630 3630
             array('target' => $target)
3631 3631
         );
3632 3632
 
@@ -3637,12 +3637,12 @@  discard block
 block discarded – undo
3637 3637
         $return = null;
3638 3638
 
3639 3639
         if ($lp_id == false) {
3640
-            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3640
+            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3641 3641
         } else {
3642
-            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3642
+            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3643 3643
         }
3644 3644
 
3645
-        $return .= '<div class="item_data" style="margin-left:' . ($num  * 18) . 'px;margin-right:5px;">';
3645
+        $return .= '<div class="item_data" style="margin-left:'.($num * 18).'px;margin-right:5px;">';
3646 3646
 
3647 3647
         if ($add_move_button) {
3648 3648
             $return .= '<a class="moved" href="#">';
@@ -3707,7 +3707,7 @@  discard block
 block discarded – undo
3707 3707
             if (isset($resource['visible']) && $resource['visible'] == 0) {
3708 3708
                 $folder_class_hidden = "doc_folder_hidden"; // in base.css
3709 3709
             }
3710
-            $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
3710
+            $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"';
3711 3711
         }
3712 3712
         $return = null;
3713 3713
 
@@ -3715,22 +3715,22 @@  discard block
 block discarded – undo
3715 3715
             $return = '<ul class="lp_resource">';
3716 3716
         }
3717 3717
 
3718
-        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
3718
+        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
3719 3719
 
3720 3720
         $image = Display::returnIconPath('nolines_plus.gif');
3721 3721
         if (empty($path)) {
3722 3722
             $image = Display::returnIconPath('nolines_minus.gif');
3723 3723
         }
3724
-        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
3724
+        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>';
3725 3725
         $return .= Display::return_icon('lp_folder.gif').'&nbsp;';
3726 3726
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
3727 3727
         $return .= '</li>';
3728 3728
 
3729 3729
         if (empty($path)) {
3730 3730
             if ($folderId == false) {
3731
-                $return .= '<div id="res_' . $resource['id'] . '" >';
3731
+                $return .= '<div id="res_'.$resource['id'].'" >';
3732 3732
             } else {
3733
-                $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >';
3733
+                $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >';
3734 3734
             }
3735 3735
         }
3736 3736
 
@@ -3892,9 +3892,9 @@  discard block
 block discarded – undo
3892 3892
             $session_id = api_get_session_id();
3893 3893
         }
3894 3894
         $course_info = api_get_course_info($course_code);
3895
-        $course_dir = $course_info['path'] . '/document';
3895
+        $course_dir = $course_info['path'].'/document';
3896 3896
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
3897
-        $base_work_dir = $sys_course_path . $course_dir;
3897
+        $base_work_dir = $sys_course_path.$course_dir;
3898 3898
 
3899 3899
         $course_id = $course_info['real_id'];
3900 3900
         $table_document = Database::get_course_table(TABLE_DOCUMENT);
@@ -3903,7 +3903,7 @@  discard block
 block discarded – undo
3903 3903
         $result = Database::query($qry);
3904 3904
         if (Database::num_rows($result) == 1) {
3905 3905
             $row = Database::fetch_array($result);
3906
-            $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path'];
3906
+            $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
3907 3907
             //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
3908 3908
             // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while
3909 3909
             $doc_mime = mime_content_type($doc_path);
@@ -3934,8 +3934,8 @@  discard block
 block discarded – undo
3934 3934
                 $file_content = self::get_text_content($doc_path, $doc_mime);
3935 3935
                 $course_code = Database::escape_string($course_code);
3936 3936
 
3937
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3938
-                require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
3937
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3938
+                require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
3939 3939
 
3940 3940
                 $ic_slide = new IndexableChunk();
3941 3941
                 $ic_slide->addValue('title', $file_title);
@@ -3952,7 +3952,7 @@  discard block
 block discarded – undo
3952 3952
                 $di = new ChamiloIndexer();
3953 3953
                 $return = $di->connectDb(null, null, $lang);
3954 3954
 
3955
-                require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
3955
+                require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
3956 3956
                 $specific_fields = get_specific_field_list();
3957 3957
 
3958 3958
                 // process different depending on what to do if file exists
@@ -3989,7 +3989,7 @@  discard block
 block discarded – undo
3989 3989
                             } else { //if the specific field is not defined, force an empty one
3990 3990
                                 $sterms = '';
3991 3991
                             }
3992
-                            $all_specific_terms .= ' ' . $sterms;
3992
+                            $all_specific_terms .= ' '.$sterms;
3993 3993
                             $sterms = explode(',', $sterms);
3994 3994
                             foreach ($sterms as $sterm) {
3995 3995
                                 $sterm = trim($sterm);
@@ -4003,7 +4003,7 @@  discard block
 block discarded – undo
4003 4003
                             }
4004 4004
                         }
4005 4005
                         // Add terms also to content to make terms findable by probabilistic search
4006
-                        $file_content = $all_specific_terms . ' ' . $file_content;
4006
+                        $file_content = $all_specific_terms.' '.$file_content;
4007 4007
 
4008 4008
                         if (!$simulation) {
4009 4009
                             $ic_slide->addValue('content', $file_content);
@@ -4029,7 +4029,7 @@  discard block
 block discarded – undo
4029 4029
                         } else { //if the specific field is not defined, force an empty one
4030 4030
                             $sterms = '';
4031 4031
                         }
4032
-                        $all_specific_terms .= ' ' . $sterms;
4032
+                        $all_specific_terms .= ' '.$sterms;
4033 4033
                         if (!empty($sterms)) {
4034 4034
                             $sterms = explode(',', $sterms);
4035 4035
                             foreach ($sterms as $sterm) {
@@ -4041,7 +4041,7 @@  discard block
 block discarded – undo
4041 4041
                         }
4042 4042
                     }
4043 4043
                     // Add terms also to content to make terms findable by probabilistic search
4044
-                    $file_content = $all_specific_terms . ' ' . $file_content;
4044
+                    $file_content = $all_specific_terms.' '.$file_content;
4045 4045
                     if (!$simulation) {
4046 4046
                         $ic_slide->addValue('content', $file_content);
4047 4047
                         $di->addChunk($ic_slide);
@@ -4325,7 +4325,7 @@  discard block
 block discarded – undo
4325 4325
         $defaultVisibility = 'visible';
4326 4326
 
4327 4327
         if (isset($settings['documents'])) {
4328
-            $portalDefaultVisibility =  'invisible';
4328
+            $portalDefaultVisibility = 'invisible';
4329 4329
             if ($settings['documents'] == 'true') {
4330 4330
                 $portalDefaultVisibility = 'visible';
4331 4331
             }
@@ -4563,7 +4563,7 @@  discard block
 block discarded – undo
4563 4563
         //make htaccess with allow from all, and file index.html into temp/audio
4564 4564
         $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4565 4565
         if (!file_exists($htaccess)) {
4566
-            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4566
+            $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
4567 4567
             $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4568 4568
             if ($fp) {
4569 4569
                 fwrite($fp, $htaccess_content);
@@ -4572,9 +4572,9 @@  discard block
 block discarded – undo
4572 4572
         }
4573 4573
 
4574 4574
         //encript temp name file
4575
-        $name_crip = sha1(uniqid());//encript
4576
-        $findext= explode(".", $file);
4577
-        $extension = $findext[count($findext)-1];
4575
+        $name_crip = sha1(uniqid()); //encript
4576
+        $findext = explode(".", $file);
4577
+        $extension = $findext[count($findext) - 1];
4578 4578
         $file_crip = $name_crip.'.'.$extension;
4579 4579
 
4580 4580
         //copy file to temp/audio directory
@@ -4678,7 +4678,7 @@  discard block
 block discarded – undo
4678 4678
         $comment = null;
4679 4679
 
4680 4680
         $fileName = api_replace_dangerous_char($title);
4681
-        $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}";
4681
+        $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}";
4682 4682
         $fileFullPath = "{$filePath}/{$fileName}.html";
4683 4683
         $fileSize = 0;
4684 4684
         $fileType = 'file';
@@ -4730,7 +4730,7 @@  discard block
 block discarded – undo
4730 4730
             $fileSize,
4731 4731
             $title,
4732 4732
             $comment,
4733
-            0,//$readonly = 0,
4733
+            0, //$readonly = 0,
4734 4734
             true, //$save_visibility = true,
4735 4735
             null, //$group_id = null,
4736 4736
             $sessionId
@@ -5015,8 +5015,8 @@  discard block
 block discarded – undo
5015 5015
             $sessionId,
5016 5016
             $groupId
5017 5017
         )) {
5018
-            $uniqueName = self::addSuffixToFileName($name, '_' . $counter);
5019
-            $filePath = $path . $uniqueName;
5018
+            $uniqueName = self::addSuffixToFileName($name, '_'.$counter);
5019
+            $filePath = $path.$uniqueName;
5020 5020
             $counter++;
5021 5021
         }
5022 5022
 
@@ -5049,7 +5049,7 @@  discard block
 block discarded – undo
5049 5049
             $folder_sql = implode("','", $escaped_folders);
5050 5050
 
5051 5051
             $sql = "SELECT * FROM $doc_table
5052
-                WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('" . $folder_sql . "')";
5052
+                WHERE filetype = 'folder' AND c_id = $course_id AND path IN ('".$folder_sql."')";
5053 5053
             $res = Database::query($sql);
5054 5054
             $folder_titles = array();
5055 5055
             while ($obj = Database::fetch_object($res)) {
@@ -5057,7 +5057,7 @@  discard block
 block discarded – undo
5057 5057
             }
5058 5058
         }
5059 5059
 
5060
-        $form = new FormValidator('selector', 'GET', api_get_self() . '?' . api_get_cidreq());
5060
+        $form = new FormValidator('selector', 'GET', api_get_self().'?'.api_get_cidreq());
5061 5061
         $form->addElement('hidden', 'cidReq', api_get_course_id());
5062 5062
         $parent_select = $form->addSelect('id', get_lang('CurrentDirectory'), '', array('onchange' => 'javascript: document.selector.submit();'));
5063 5063
 
@@ -5077,9 +5077,9 @@  discard block
 block discarded – undo
5077 5077
                     $folder_titles[$folder] = cut($folder_titles[$folder], 80);
5078 5078
                     $counter = count($path_parts) - 2;
5079 5079
                     if ($counter > 0) {
5080
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter) . ' &mdash; ' . $folder_titles[$folder];
5080
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter).' &mdash; '.$folder_titles[$folder];
5081 5081
                     } else {
5082
-                        $label = ' &mdash; ' . $folder_titles[$folder];
5082
+                        $label = ' &mdash; '.$folder_titles[$folder];
5083 5083
                     }
5084 5084
                     $parent_select->addOption($label, $folder_id);
5085 5085
                     if ($selected != '') {
@@ -5097,7 +5097,7 @@  discard block
 block discarded – undo
5097 5097
                     } else {
5098 5098
                         $path_parts = explode('/', str_replace($group_dir, '', $folder));
5099 5099
                         $label = cut($label, 80);
5100
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
5100
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
5101 5101
                     }
5102 5102
                     $parent_select->addOption($label, $folder_id);
5103 5103
                     if ($selected != '') {
@@ -5129,7 +5129,7 @@  discard block
 block discarded – undo
5129 5129
     ) {
5130 5130
         global $dbl_click_id;
5131 5131
         $course_info = api_get_course_info();
5132
-        $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document';
5132
+        $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
5133 5133
         $webOdflist = DocumentManager::get_web_odf_extension_list();
5134 5134
 
5135 5135
         // Get the title or the basename depending on what we're using
@@ -5153,11 +5153,11 @@  discard block
 block discarded – undo
5153 5153
 
5154 5154
         if (!$show_as_icon) {
5155 5155
             // Build download link (icon)
5156
-            $forcedownload_link = ($filetype == 'folder') ? api_get_self() . '?' . api_get_cidreq() . '&action=downloadfolder&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5156
+            $forcedownload_link = ($filetype == 'folder') ? api_get_self().'?'.api_get_cidreq().'&action=downloadfolder&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5157 5157
             // Folder download or file download?
5158 5158
             $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png';
5159 5159
             // Prevent multiple clicks on zipped folder download
5160
-            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_" . ($dbl_click_id++) . "=false;',10000); } else { return false; }\"" : '';
5160
+            $prevent_multiple_click = ($filetype == 'folder') ? " onclick=\"javascript: if(typeof clic_$dbl_click_id == 'undefined' || !clic_$dbl_click_id) { clic_$dbl_click_id=true; window.setTimeout('clic_".($dbl_click_id++)."=false;',10000); } else { return false; }\"" : '';
5161 5161
         }
5162 5162
 
5163 5163
         $target = '_self';
@@ -5173,20 +5173,20 @@  discard block
 block discarded – undo
5173 5173
 
5174 5174
             if ($is_browser_viewable_file) {
5175 5175
                 if ($ext == 'pdf' || in_array($ext, $webOdflist)) {
5176
-                    $url = api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5176
+                    $url = api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5177 5177
                 } else {
5178
-                    $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5178
+                    $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5179 5179
                 }
5180 5180
             } else {
5181 5181
                 // url-encode for problematic characters (we may not call them dangerous characters...)
5182
-                $path = str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq();
5183
-                $url = $www . $path;
5182
+                $path = str_replace('%2F', '/', $url_path).'?'.api_get_cidreq();
5183
+                $url = $www.$path;
5184 5184
             }
5185 5185
 
5186 5186
             /*$path = str_replace('%2F', '/', $url_path); //yox view hack otherwise the image can't be well read
5187 5187
             $url = $www . $path;*/
5188 5188
         } else {
5189
-            $url = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_data['id'];
5189
+            $url = api_get_self().'?'.api_get_cidreq().'&id='.$document_data['id'];
5190 5190
         }
5191 5191
 
5192 5192
         // The little download icon
@@ -5196,10 +5196,10 @@  discard block
 block discarded – undo
5196 5196
         if ($path == '/shared_folder') {
5197 5197
             $tooltip_title_alt = get_lang('UserFolders');
5198 5198
         } elseif (strstr($path, 'shared_folder_session_')) {
5199
-            $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')';
5199
+            $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')';
5200 5200
         } elseif (strstr($tooltip_title, 'sf_user_')) {
5201 5201
             $userinfo = api_get_user_info(substr($tooltip_title, 8));
5202
-            $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5202
+            $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name'];
5203 5203
         } elseif ($path == '/chat_files') {
5204 5204
             $tooltip_title_alt = get_lang('ChatFiles');
5205 5205
         } elseif ($path == '/learning_path') {
@@ -5232,24 +5232,24 @@  discard block
 block discarded – undo
5232 5232
                 ) {
5233 5233
                     //filter when I am into shared folder, I can show for donwload only my shared folder
5234 5234
                     if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
5235
-                        if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5236
-                            preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5235
+                        if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5236
+                            preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5237 5237
                             api_is_allowed_to_edit() || api_is_platform_admin()
5238 5238
                         ) {
5239
-                            $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5240
-                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5239
+                            $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5240
+                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5241 5241
                         }
5242 5242
                     } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) ||
5243 5243
                         api_is_allowed_to_edit() ||
5244 5244
                         api_is_platform_admin()
5245 5245
                     ) {
5246
-                        $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5247
-                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5246
+                        $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5247
+                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5248 5248
                     }
5249 5249
                 }
5250 5250
             } else {
5251
-                $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5252
-                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5251
+                $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5252
+                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5253 5253
             }
5254 5254
 
5255 5255
             // Copy files to users myfiles
@@ -5257,12 +5257,12 @@  discard block
 block discarded – undo
5257 5257
                 api_get_setting('users_copy_files') == 'true' &&
5258 5258
                 !api_is_anonymous()
5259 5259
             ) {
5260
-                $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq();
5260
+                $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq();
5261 5261
 
5262 5262
                 if ($filetype == 'file') {
5263 5263
 
5264
-                    $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5265
-                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5264
+                    $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5265
+                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5266 5266
 
5267 5267
                     if (api_get_setting('allow_my_files') === 'false') {
5268 5268
                         $copy_to_myfiles = '';
@@ -5281,13 +5281,13 @@  discard block
 block discarded – undo
5281 5281
                 $filetype == 'file' &&
5282 5282
                 in_array($extension, array('html', 'htm'))
5283 5283
             ) {
5284
-                $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' .
5285
-                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
5284
+                $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$document_data['id'].'">'.
5285
+                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> ';
5286 5286
             }
5287 5287
 
5288 5288
             if ($is_browser_viewable_file) {
5289
-                $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' .
5290
-                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5289
+                $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.api_get_cidreq().'" style="float:right"'.$prevent_multiple_click.' target="_blank">'.
5290
+                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5291 5291
             }
5292 5292
 
5293 5293
             if ($filetype == 'file') {
@@ -5296,9 +5296,9 @@  discard block
 block discarded – undo
5296 5296
                     (preg_match('/wav$/i', urldecode($checkExtension)) && !preg_match('/_chnano_.wav$/i', urldecode($url))) ||
5297 5297
                     preg_match('/ogg$/i', urldecode($checkExtension))
5298 5298
                 ) {
5299
-                    return '<span style="float:left" ' . $visibility_class . '>' .
5300
-                    $title .
5301
-                    '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5299
+                    return '<span style="float:left" '.$visibility_class.'>'.
5300
+                    $title.
5301
+                    '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5302 5302
                 } elseif (
5303 5303
 
5304 5304
                     // Show preview
@@ -5316,7 +5316,7 @@  discard block
 block discarded – undo
5316 5316
                     )
5317 5317
                 ) {
5318 5318
                     // Simpler version of showinframesmin.php with no headers
5319
-                    $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5319
+                    $url = 'show_content.php?'.api_get_cidreq().'&id='.$document_data['id'];
5320 5320
                     $class = 'ajax';
5321 5321
                     if ($visibility == false) {
5322 5322
                         $class = "ajax invisible";
@@ -5331,34 +5331,34 @@  discard block
 block discarded – undo
5331 5331
                             'style' => 'float: left;'
5332 5332
                         ]
5333 5333
                     )
5334
-                    . $force_download_html . $send_to . $copy_to_myfiles
5335
-                    . $open_in_new_window_link . $pdf_icon;
5334
+                    . $force_download_html.$send_to.$copy_to_myfiles
5335
+                    . $open_in_new_window_link.$pdf_icon;
5336 5336
                 } else {
5337 5337
                     // For PDF Download the file.
5338 5338
                     $pdfPreview = null;
5339 5339
                     if ($ext != 'pdf' && !in_array($ext, $webOdflist)) {
5340
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5340
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5341 5341
                     } else {
5342 5342
                         $pdfPreview = Display::url(
5343 5343
                             Display::return_icon('preview.gif', get_lang('Preview')),
5344
-                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'],
5344
+                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'],
5345 5345
                             array('style' => 'float:right')
5346 5346
                         );
5347 5347
                     }
5348 5348
                     // No plugin just the old and good showinframes.php page
5349
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' .
5350
-                    $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5349
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'.
5350
+                    $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5351 5351
                 }
5352 5352
             } else {
5353
-                return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' .
5354
-                $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5353
+                return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'.
5354
+                $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5355 5355
             }
5356 5356
             // end copy files to users myfiles
5357 5357
         } else {
5358 5358
             // Icon column
5359 5359
             if (preg_match('/shared_folder/', urldecode($checkExtension)) &&
5360 5360
                 preg_match('/shared_folder$/', urldecode($checkExtension)) == false &&
5361
-                preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false
5361
+                preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false
5362 5362
             ) {
5363 5363
                 if ($filetype == 'file') {
5364 5364
                     //Sound preview with jplayer
@@ -5383,19 +5383,19 @@  discard block
 block discarded – undo
5383 5383
                             api_get_setting('enable_nanogong') == 'true'
5384 5384
                         )
5385 5385
                     ) {
5386
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5387
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5388
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5389
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5386
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5387
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5388
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5389
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5390 5390
                     } else {
5391
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5392
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5393
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5391
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5392
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5393
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5394 5394
                     }
5395 5395
                 } else {
5396
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5397
-                    DocumentManager::build_document_icon_tag($filetype, $path) .
5398
-                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5396
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5397
+                    DocumentManager::build_document_icon_tag($filetype, $path).
5398
+                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5399 5399
                 }
5400 5400
             } else {
5401 5401
                 if ($filetype == 'file') {
@@ -5423,16 +5423,16 @@  discard block
 block discarded – undo
5423 5423
                             api_get_setting('enable_nanogong') == 'true'
5424 5424
                         )
5425 5425
                     ) {
5426
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; //without preview
5427
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5428
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5426
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; //without preview
5427
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5428
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5429 5429
                     } else {
5430
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5431
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5430
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5431
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5432 5432
                     }
5433 5433
                 } else {
5434
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5435
-                    DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5434
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5435
+                    DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5436 5436
                 }
5437 5437
             }
5438 5438
         }
@@ -5456,7 +5456,7 @@  discard block
 block discarded – undo
5456 5456
 
5457 5457
             if (preg_match('/_chnano_.wav$/i', $basename)) {
5458 5458
                 $icon = "jplayer_play.png";
5459
-                $basename = 'wav' . ' ' . '(Nanogong)';
5459
+                $basename = 'wav'.' '.'(Nanogong)';
5460 5460
             } else {
5461 5461
                 $basename = substr(strrchr($basename, '.'), 1);
5462 5462
             }
@@ -5472,13 +5472,13 @@  discard block
 block discarded – undo
5472 5472
                 $userinfo = api_get_user_info(substr($basename, 8));
5473 5473
                 $icon = $userinfo['avatar_small'];
5474 5474
 
5475
-                $basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5475
+                $basename = get_lang('UserFolder').' '.$userinfo['complete_name'];
5476 5476
                 $user_image = true;
5477 5477
             } elseif (strstr($path, 'shared_folder_session_')) {
5478 5478
                 if ($is_allowed_to_edit) {
5479
-                    $basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder');
5479
+                    $basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder');
5480 5480
                 } else {
5481
-                    $basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')';
5481
+                    $basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
5482 5482
                 }
5483 5483
                 $icon = 'folder_users.gif';
5484 5484
             } else {
@@ -5572,16 +5572,16 @@  discard block
 block discarded – undo
5572 5572
         // Build URL-parameters for table-sorting
5573 5573
         $sort_params = array();
5574 5574
         if (isset($_GET['column'])) {
5575
-            $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
5575
+            $sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
5576 5576
         }
5577 5577
         if (isset($_GET['page_nr'])) {
5578
-            $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
5578
+            $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
5579 5579
         }
5580 5580
         if (isset($_GET['per_page'])) {
5581
-            $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
5581
+            $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
5582 5582
         }
5583 5583
         if (isset($_GET['direction'])) {
5584
-            $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
5584
+            $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
5585 5585
         }
5586 5586
         $sort_params = implode('&amp;', $sort_params);
5587 5587
         $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible';
@@ -5594,89 +5594,89 @@  discard block
 block discarded – undo
5594 5594
         if ($is_read_only /* or ($session_id!=api_get_session_id()) */) {
5595 5595
             if (api_is_course_admin() || api_is_platform_admin()) {
5596 5596
                 if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5597
-                    $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5598
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5599
-                } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5600
-                    $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5601
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5597
+                    $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5598
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5599
+                } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5600
+                    $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5601
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5602 5602
                 } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5603
-                    $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5604
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5603
+                    $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5604
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5605 5605
                 } else {
5606
-                    $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id. '">' .
5607
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5606
+                    $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5607
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5608 5608
                 }
5609 5609
             } else {
5610 5610
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5611 5611
             }
5612
-            $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5612
+            $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5613 5613
             if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5614
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5614
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5615 5615
             }
5616
-            $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5616
+            $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5617 5617
         } else {
5618 5618
             //Edit button
5619 5619
             if (in_array($path, DocumentManager::get_system_folders())) {
5620 5620
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5621
-            } elseif ($is_certificate_mode ) {
5621
+            } elseif ($is_certificate_mode) {
5622 5622
                 // gradebook category doesn't seem to be taken into account
5623
-                $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '&curdirpath=/certificates">' . Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5623
+                $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'&curdirpath=/certificates">'.Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5624 5624
             } else {
5625 5625
                 if (api_get_session_id()) {
5626 5626
                     if ($document_data['session_id'] == api_get_session_id()) {
5627 5627
                         if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5628
-                            $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5629
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5630
-                        } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5631
-                            $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5632
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5628
+                            $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5629
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5630
+                        } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5631
+                            $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5632
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5633 5633
                         } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5634
-                            $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5635
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5634
+                            $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5635
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5636 5636
                         } else {
5637
-                            $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5638
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5637
+                            $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5638
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5639 5639
                         }
5640 5640
                     } else {
5641
-                        $modify_icons .= '&nbsp;' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
5641
+                        $modify_icons .= '&nbsp;'.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
5642 5642
                     }
5643 5643
                 } else {
5644 5644
                     if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5645
-                        $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5646
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5647
-                    } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5648
-                        $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5649
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5645
+                        $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5646
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5647
+                    } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5648
+                        $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5649
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5650 5650
                     } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5651
-                        $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '">' .
5652
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5651
+                        $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5652
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5653 5653
                     } else {
5654
-                        $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5655
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5654
+                        $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5655
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5656 5656
                     }
5657 5657
                 }
5658 5658
             }
5659 5659
 
5660 5660
             // Move button.
5661 5661
             if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
5662
-                $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5662
+                $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5663 5663
             } else {
5664 5664
                 if (api_get_session_id()) {
5665 5665
                     if ($document_data['session_id'] == api_get_session_id()) {
5666
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5667
-                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5666
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5667
+                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5668 5668
                     } else {
5669
-                        $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5669
+                        $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5670 5670
                     }
5671 5671
                 } else {
5672
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5673
-                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5672
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5673
+                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5674 5674
                 }
5675 5675
             }
5676 5676
 
5677 5677
             //Visibility button
5678 5678
             if ($is_certificate_mode) {
5679
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
5679
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>';
5680 5680
             } else {
5681 5681
                 if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5682 5682
                     if ($visibility_icon == 'invisible') {
@@ -5684,14 +5684,14 @@  discard block
 block discarded – undo
5684 5684
                     } else {
5685 5685
                         $tip_visibility = get_lang('Hide');
5686 5686
                     }
5687
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . '&amp;' . $sort_params . '">' .
5688
-                        Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
5687
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;'.$visibility_command.'='.$id.'&amp;'.$sort_params.'">'.
5688
+                        Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>';
5689 5689
                 }
5690 5690
             }
5691 5691
 
5692 5692
             // Delete button
5693 5693
             if (in_array($path, DocumentManager::get_system_folders())) {
5694
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5694
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5695 5695
             } else {
5696 5696
                 $titleToShow = addslashes(basename($document_data['title']));
5697 5697
 
@@ -5699,23 +5699,23 @@  discard block
 block discarded – undo
5699 5699
                     $_GET['curdirpath'] == '/certificates' &&
5700 5700
                     DocumentManager::get_default_certificate_id(api_get_course_id()) == $id
5701 5701
                 ) {
5702
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;' . $sort_params . 'delete_certificate_id=' . $id . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5703
-                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5702
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'delete_certificate_id='.$id.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5703
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5704 5704
                 } else {
5705 5705
                     if ($is_certificate_mode) {
5706
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid=' . $document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">' .
5707
-                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5706
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5707
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5708 5708
                     } else {
5709 5709
                         if (api_get_session_id()) {
5710 5710
                             if ($document_data['session_id'] == api_get_session_id()) {
5711
-                                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id  . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow . '\');">'.
5712
-                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5711
+                                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5712
+                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5713 5713
                             } else {
5714
-                                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5714
+                                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5715 5715
                             }
5716 5716
                         } else {
5717
-                            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&action=delete_item&id='.$parent_id.'&deleteid='.$document_id . '&amp;' . $sort_params . '" onclick="return confirmation(\'' . $titleToShow. '\');">' .
5718
-                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5717
+                            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&action=delete_item&id='.$parent_id.'&deleteid='.$document_id.'&amp;'.$sort_params.'" onclick="return confirmation(\''.$titleToShow.'\');">'.
5718
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5719 5719
                         }
5720 5720
                     }
5721 5721
                 }
@@ -5727,15 +5727,15 @@  discard block
 block discarded – undo
5727 5727
                 // nothing to do
5728 5728
             } else {
5729 5729
                 if ($usePpt2lp && $formatType) {
5730
-                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5731
-                        'data-documentId = ' . $document_id .
5732
-                        ' data-formatType = ' . $formatType . '>' .
5730
+                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" '.
5731
+                        'data-documentId = '.$document_id.
5732
+                        ' data-formatType = '.$formatType.'>'.
5733 5733
                         Display::return_icon(
5734 5734
                             'convert.png',
5735 5735
                             get_lang('Convert'),
5736 5736
                             array(),
5737 5737
                             ICON_SIZE_SMALL
5738
-                        ) . '</a>';
5738
+                        ).'</a>';
5739 5739
                 }
5740 5740
             }
5741 5741
         }
@@ -5743,8 +5743,8 @@  discard block
 block discarded – undo
5743 5743
         if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
5744 5744
             if ($is_template == 0) {
5745 5745
                 if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
5746
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id .  '&amp;' . $sort_params . '">' .
5747
-                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
5746
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;add_as_template='.$id.'&amp;'.$sort_params.'">'.
5747
+                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>';
5748 5748
                 }
5749 5749
                 if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
5750 5750
                     $visibility_icon_certificate = 'nocertificate';
@@ -5758,21 +5758,21 @@  discard block
 block discarded – undo
5758 5758
                         $certificate = get_lang('NoDefaultCertificate');
5759 5759
                     }
5760 5760
                     if (isset($_GET['selectcat'])) {
5761
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;selectcat=' . intval($_GET['selectcat']) . '&amp;set_certificate=' . $id . '&amp;' . $sort_params . '">';
5761
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;selectcat='.intval($_GET['selectcat']).'&amp;set_certificate='.$id.'&amp;'.$sort_params.'">';
5762 5762
                         $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate);
5763 5763
                         $modify_icons .= '</a>';
5764 5764
                         if ($is_preview) {
5765
-                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5766
-                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5765
+                            $modify_icons .= '&nbsp;<a target="_blank"  href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;set_preview='.$id.'&amp;'.$sort_params.'" >'.
5766
+                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>';
5767 5767
                         }
5768 5768
                     }
5769 5769
                 }
5770 5770
             } else {
5771
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5772
-                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5771
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.'&amp;'.$sort_params.'">'.
5772
+                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>';
5773 5773
             }
5774
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' .
5775
-                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5774
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'">'.
5775
+                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>';
5776 5776
         }
5777 5777
         return $modify_icons;
5778 5778
     }
@@ -5841,7 +5841,7 @@  discard block
 block discarded – undo
5841 5841
                     // 3. inside a subfolder of the folder you want to move
5842 5842
                     if (($curdirpath != $folder) &&
5843 5843
                         ($folder != $move_file) &&
5844
-                        (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5844
+                        (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5845 5845
                     ) {
5846 5846
                         $path_displayed = $folder;
5847 5847
                         // If document title is used, we have to display titles instead of real paths...
@@ -5858,7 +5858,7 @@  discard block
 block discarded – undo
5858 5858
             foreach ($folders as $folder) {
5859 5859
                 if (($curdirpath != $folder) &&
5860 5860
                     ($folder != $move_file) &&
5861
-                    (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5861
+                    (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5862 5862
                 ) {
5863 5863
                     // Cannot copy dir into his own subdir
5864 5864
                     $path_displayed = DocumentManager::get_titles_of_path($folder);
@@ -5900,10 +5900,10 @@  discard block
 block discarded – undo
5900 5900
                 // If this path has soon been stored here we don't need a new query
5901 5901
                 $path_displayed .= $tmp_folders_titles[$tmp_path];
5902 5902
             } else {
5903
-                $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . '
5904
-                    WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"';
5903
+                $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).'
5904
+                    WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"';
5905 5905
                 $rs = Database::query($sql);
5906
-                $tmp_title = '/' . Database::result($rs, 0, 0);
5906
+                $tmp_title = '/'.Database::result($rs, 0, 0);
5907 5907
                 $path_displayed .= $tmp_title;
5908 5908
                 $tmp_folders_titles[$tmp_path] = $tmp_title;
5909 5909
             }
@@ -5939,7 +5939,7 @@  discard block
 block discarded – undo
5939 5939
         $clean_curdirpath = Security::remove_XSS($curdirpath);
5940 5940
         if ($clean_curdirpath == '/shared_folder') {
5941 5941
             return true;
5942
-        } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) {
5942
+        } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) {
5943 5943
             return true;
5944 5944
         } else {
5945 5945
             return false;
@@ -5955,7 +5955,7 @@  discard block
 block discarded – undo
5955 5955
         $clean_path = Security::remove_XSS($path);
5956 5956
         if (strpos($clean_path, 'shared_folder/sf_user_')) {
5957 5957
             return true;
5958
-        } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) {
5958
+        } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) {
5959 5959
             return true;
5960 5960
         } else {
5961 5961
             return false;
@@ -5968,11 +5968,11 @@  discard block
 block discarded – undo
5968 5968
      */
5969 5969
     public static function is_my_shared_folder($user_id, $path, $current_session_id)
5970 5970
     {
5971
-        $clean_path = Security::remove_XSS($path) . '/';
5971
+        $clean_path = Security::remove_XSS($path).'/';
5972 5972
         //for security does not remove the last slash
5973
-        $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//';
5973
+        $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//';
5974 5974
         //for security does not remove the last slash
5975
-        $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//';
5975
+        $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//';
5976 5976
 
5977 5977
         if (preg_match($main_user_shared_folder, $clean_path)) {
5978 5978
             return true;
@@ -6245,7 +6245,7 @@  discard block
 block discarded – undo
6245 6245
                 ON (i.c_id = d.c_id)
6246 6246
                 WHERE
6247 6247
                     d.id = i.ref AND
6248
-                    i.tool = '" . TOOL_DOCUMENT . "'
6248
+                    i.tool = '".TOOL_DOCUMENT."'
6249 6249
                     $conditionSession AND
6250 6250
                     i.c_id = $courseId AND
6251 6251
                     d.c_id = $courseId ";
@@ -6253,9 +6253,9 @@  discard block
 block discarded – undo
6253 6253
         $result = Database::query($sql);
6254 6254
         $documents = Database::store_result($result, 'ASSOC');
6255 6255
         if ($documents) {
6256
-            $course_dir = $courseInfo['directory'] . '/document';
6256
+            $course_dir = $courseInfo['directory'].'/document';
6257 6257
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
6258
-            $base_work_dir = $sys_course_path . $course_dir;
6258
+            $base_work_dir = $sys_course_path.$course_dir;
6259 6259
 
6260 6260
             foreach ($documents as $document) {
6261 6261
                 $documentId = $document['id'];
Please login to merge, or discard this patch.