Completed
Push — master ( 50617c...371d59 )
by Julito
28:11
created
main/install/install.lib.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
     if (!is_array($result)) {
409 409
         $result = array();
410 410
         $exceptions = array('.', '..', 'CVS', '.svn');
411
-        $search       = array('_latin',   '_unicode',   '_corporate',   '_org'  , '_KM',   '_');
411
+        $search       = array('_latin', '_unicode', '_corporate', '_org', '_KM', '_');
412 412
         $replace_with = array(' (Latin)', ' (unicode)', ' (corporate)', ' (org)', ' (KM)', ' ');
413 413
         $dirname = api_get_path(SYS_LANG_PATH);
414 414
         $handle = opendir($dirname);
@@ -443,9 +443,9 @@  discard block
 block discarded – undo
443 443
     if ($handle = opendir($directory)) {
444 444
         while (false !== ($file = readdir($handle))) {
445 445
             if ($file != "." && $file != "..") {
446
-                if (is_dir($directory. "/" . $file)) {
447
-                    $array_items = array_merge($array_items, my_directory_to_array($directory. '/' . $file));
448
-                    $file = $directory . "/" . $file;
446
+                if (is_dir($directory."/".$file)) {
447
+                    $array_items = array_merge($array_items, my_directory_to_array($directory.'/'.$file));
448
+                    $file = $directory."/".$file;
449 449
                     $array_items[] = preg_replace("/\/\//si", '/', $file);
450 450
                 }
451 451
             }
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
         // try to recover config file from Chamilo 1.9.x
491 491
         if (file_exists($updatePath.'main/inc/conf/configuration.php')) {
492 492
             $updateFromConfigFile = 'main/inc/conf/configuration.php';
493
-        } elseif (file_exists($updatePath . 'app/config/configuration.php')) {
493
+        } elseif (file_exists($updatePath.'app/config/configuration.php')) {
494 494
             $updateFromConfigFile = 'app/config/configuration.php';
495 495
         } else {
496 496
             // Give up recovering.
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
     <h2><?php get_lang('WelcomeToTheChamiloInstaller'); ?></h2>
652 652
     <div class="RequirementHeading">
653 653
         <h2><?php echo display_step_sequence(); ?>
654
-            <?php echo get_lang('InstallationLanguage');?>
654
+            <?php echo get_lang('InstallationLanguage'); ?>
655 655
         </h2>
656 656
         <p><?php echo get_lang('PleaseSelectInstallationProcessLanguage'); ?>:</p>
657 657
         <form id="lang_form" method="post" action="<?php echo api_get_self(); ?>">
@@ -705,14 +705,14 @@  discard block
 block discarded – undo
705 705
     }
706 706
     echo '</div>';
707 707
 
708
-    $properlyAccessUrl =  checkAccessUrl();
708
+    $properlyAccessUrl = checkAccessUrl();
709 709
 
710 710
     if (!$properlyAccessUrl) {
711 711
         echo '
712 712
             <div class="alert alert-danger">
713
-                ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM) .
714
-            ' ' .
715
-            sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')) . '
713
+                ' . Display::return_icon('error.png', get_lang('Error'), [], ICON_SIZE_MEDIUM).
714
+            ' '.
715
+            sprintf(get_lang('InstallMultiURLDetectedNotMainURL'), api_get_configuration_value('root_web')).'
716 716
             </div>
717 717
         ';
718 718
     }
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
     if (phpversion() < REQUIRED_PHP_VERSION) {
737 737
         echo '<strong><font color="red">'.get_lang('PHPVersionError').'</font></strong>';
738 738
     } else {
739
-        echo '<strong><font color="green">'.get_lang('PHPVersionOK'). ' '.phpversion().'</font></strong>';
739
+        echo '<strong><font color="green">'.get_lang('PHPVersionOK').' '.phpversion().'</font></strong>';
740 740
     }
741 741
     echo '</td>
742 742
             </tr>
@@ -1094,9 +1094,9 @@  discard block
 block discarded – undo
1094 1094
         }
1095 1095
 
1096 1096
         $deprecated = [
1097
-            api_get_path(SYS_CODE_PATH) . 'exercice/',
1098
-            api_get_path(SYS_CODE_PATH) . 'newscorm/',
1099
-            api_get_path(SYS_PLUGIN_PATH) . 'ticket/'
1097
+            api_get_path(SYS_CODE_PATH).'exercice/',
1098
+            api_get_path(SYS_CODE_PATH).'newscorm/',
1099
+            api_get_path(SYS_PLUGIN_PATH).'ticket/'
1100 1100
         ];
1101 1101
         $deprecatedToRemove = [];
1102 1102
 
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
 function get_contact_registration_form()
1207 1207
 {
1208 1208
 
1209
-    $html ='
1209
+    $html = '
1210 1210
    <div class="form-horizontal">
1211 1211
     <div class="panel panel-default">
1212 1212
     <div class="panel-body">
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
         <div class="col-sm-9">
1304 1304
             <div class="radio">
1305 1305
                 <label>
1306
-                    <input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes') . '
1306
+                    <input type="radio" name="financial_decision" id="financial_decision1" value="1" checked /> ' . get_lang('Yes').'
1307 1307
                 </label>
1308 1308
             </div>
1309 1309
             <div class="radio">
@@ -1362,8 +1362,8 @@  discard block
 block discarded – undo
1362 1362
             echo '<input type="hidden" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />';
1363 1363
             echo api_htmlentities($parameterValue);
1364 1364
         } else {
1365
-            echo '<div class="col-sm-5"><input type="' . $inputType . '" class="form-control" size="' . DATABASE_FORM_FIELD_DISPLAY_LENGTH . '" maxlength="' . $maxLength . '" name="' . $formFieldName . '" id="' . $formFieldName . '" value="' . api_htmlentities($parameterValue) . '" />' . "</div>";
1366
-            echo '<div class="col-sm-3">' . $extra_notice . '</div>';
1365
+            echo '<div class="col-sm-5"><input type="'.$inputType.'" class="form-control" size="'.DATABASE_FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.$maxLength.'" name="'.$formFieldName.'" id="'.$formFieldName.'" value="'.api_htmlentities($parameterValue).'" />'."</div>";
1366
+            echo '<div class="col-sm-3">'.$extra_notice.'</div>';
1367 1367
         }
1368 1368
     }
1369 1369
 }
@@ -1397,12 +1397,12 @@  discard block
 block discarded – undo
1397 1397
         $dbNameForm = $_configuration['main_database'];
1398 1398
         $dbPortForm = isset($_configuration['db_port']) ? $_configuration['db_port'] : '';
1399 1399
 
1400
-        echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
1400
+        echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>';
1401 1401
         echo '<div class="RequirementContent">';
1402 1402
         echo get_lang('DBSettingUpgradeIntro');
1403 1403
         echo '</div>';
1404 1404
     } else {
1405
-        echo '<div class="RequirementHeading"><h2>' . display_step_sequence() .get_lang('DBSetting') . '</h2></div>';
1405
+        echo '<div class="RequirementHeading"><h2>'.display_step_sequence().get_lang('DBSetting').'</h2></div>';
1406 1406
         echo '<div class="RequirementContent">';
1407 1407
         echo get_lang('DBSettingIntro');
1408 1408
         echo '</div>';
@@ -1412,12 +1412,12 @@  discard block
 block discarded – undo
1412 1412
         <div class="panel-body">
1413 1413
         <div class="form-group">
1414 1414
             <label class="col-sm-4"><?php echo get_lang('DBHost'); ?> </label>
1415
-            <?php if ($installType == 'update'){ ?>
1415
+            <?php if ($installType == 'update') { ?>
1416 1416
             <div class="col-sm-5">
1417 1417
                 <input type="hidden" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" /><?php echo $dbHostForm; ?>
1418 1418
             </div>
1419 1419
             <div class="col-sm-3"></div>
1420
-            <?php }else{ ?>
1420
+            <?php } else { ?>
1421 1421
             <div class="col-sm-5">
1422 1422
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbHostForm" value="<?php echo htmlentities($dbHostForm); ?>" />
1423 1423
             </div>
@@ -1426,12 +1426,12 @@  discard block
 block discarded – undo
1426 1426
         </div>
1427 1427
         <div class="form-group">
1428 1428
             <label class="col-sm-4"><?php echo get_lang('DBPort'); ?> </label>
1429
-            <?php if ($installType == 'update'){ ?>
1429
+            <?php if ($installType == 'update') { ?>
1430 1430
             <div class="col-sm-5">
1431 1431
                 <input type="hidden" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" /><?php echo $dbPortForm; ?>
1432 1432
             </div>
1433 1433
             <div class="col-sm-3"></div>
1434
-            <?php }else{ ?>
1434
+            <?php } else { ?>
1435 1435
             <div class="col-sm-5">
1436 1436
                 <input type="text" class="form-control" size="25" maxlength="50" name="dbPortForm" value="<?php echo htmlentities($dbPortForm); ?>" />
1437 1437
             </div>
@@ -1457,7 +1457,7 @@  discard block
 block discarded – undo
1457 1457
             <?php
1458 1458
             //Database Name fix replace weird chars
1459 1459
             if ($installType != INSTALL_TYPE_UPDATE) {
1460
-                $dbNameForm = str_replace(array('-','*', '$', ' ', '.'), '', $dbNameForm);
1460
+                $dbNameForm = str_replace(array('-', '*', '$', ' ', '.'), '', $dbNameForm);
1461 1461
             }
1462 1462
 
1463 1463
             displayDatabaseParameter(
@@ -1550,7 +1550,7 @@  discard block
 block discarded – undo
1550 1550
     if (!empty($title)) {
1551 1551
         $panelTitle = Display::div($title, array('class' => 'panel-heading'));
1552 1552
         $panelBody = Display::div($content, array('class' => 'panel-body'));
1553
-        $panelParent = Display::div($panelTitle . $panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
1553
+        $panelParent = Display::div($panelTitle.$panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
1554 1554
     } else {
1555 1555
         $panelBody = Display::div($html, array('class' => 'panel-body'));
1556 1556
         $panelParent = Display::div($panelBody, array('id' => $id, 'class' => 'panel panel-'.$style));
@@ -1576,9 +1576,9 @@  discard block
 block discarded – undo
1576 1576
     $displayWhenUpdate = 'true'
1577 1577
 ) {
1578 1578
     $html = '<div class="form-group">';
1579
-    $html .= '<label class="col-sm-6 control-label">' . $parameterName . '</label>';
1579
+    $html .= '<label class="col-sm-6 control-label">'.$parameterName.'</label>';
1580 1580
     if ($installType == INSTALL_TYPE_UPDATE && $displayWhenUpdate) {
1581
-        $html .= '<input type="hidden" name="' . $formFieldName . '" value="'. api_htmlentities($parameterValue, ENT_QUOTES). '" />' . $parameterValue;
1581
+        $html .= '<input type="hidden" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'.$parameterValue;
1582 1582
     } else {
1583 1583
         $html .= '<div class="col-sm-6"><input class="form-control" type="text" size="'.FORM_FIELD_DISPLAY_LENGTH.'" maxlength="'.MAX_FORM_FIELD_LENGTH.'" name="'.$formFieldName.'" value="'.api_htmlentities($parameterValue, ENT_QUOTES).'" />'."</div>";
1584 1584
     }
@@ -1626,7 +1626,7 @@  discard block
 block discarded – undo
1626 1626
         $languageForm = $_SESSION['install_language'];
1627 1627
     }
1628 1628
     echo '<div class="RequirementHeading">';
1629
-    echo "<h2>" . display_step_sequence() . get_lang("CfgSetting") . "</h2>";
1629
+    echo "<h2>".display_step_sequence().get_lang("CfgSetting")."</h2>";
1630 1630
     echo '</div>';
1631 1631
 
1632 1632
     echo '<p>'.get_lang('ConfigSettingsInfo').' <strong>app/config/configuration.php</strong></p>';
@@ -1644,14 +1644,14 @@  discard block
 block discarded – undo
1644 1644
 
1645 1645
     // Parameters 3 and 4: administrator's names
1646 1646
 
1647
-    $html .=  display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
1648
-    $html .=  display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
1647
+    $html .= display_configuration_parameter($installType, get_lang('AdminFirstName'), 'adminFirstName', $adminFirstName);
1648
+    $html .= display_configuration_parameter($installType, get_lang('AdminLastName'), 'adminLastName', $adminLastName);
1649 1649
 
1650 1650
     //Parameter 3: administrator's email
1651
-    $html .=  display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
1651
+    $html .= display_configuration_parameter($installType, get_lang('AdminEmail'), 'emailForm', $emailForm);
1652 1652
 
1653 1653
     //Parameter 6: administrator's telephone
1654
-    $html .=  display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
1654
+    $html .= display_configuration_parameter($installType, get_lang('AdminPhone'), 'adminPhoneForm', $adminPhoneForm);
1655 1655
 
1656 1656
 
1657 1657
     echo panel($html, get_lang('Administrator'), 'administrator');
@@ -1670,12 +1670,12 @@  discard block
 block discarded – undo
1670 1670
         $html .= display_language_selection_box('languageForm', $languageForm);
1671 1671
         $html .= '</div>';
1672 1672
     }
1673
-    $html.= "</div>";
1673
+    $html .= "</div>";
1674 1674
 
1675 1675
 
1676 1676
     //Second parameter: Chamilo URL
1677 1677
     $html .= '<div class="form-group">';
1678
-    $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL') .get_lang('ThisFieldIsRequired').'</label>';
1678
+    $html .= '<label class="col-sm-6 control-label">'.get_lang('ChamiloURL').get_lang('ThisFieldIsRequired').'</label>';
1679 1679
 
1680 1680
 
1681 1681
 
@@ -1699,34 +1699,34 @@  discard block
 block discarded – undo
1699 1699
 
1700 1700
 
1701 1701
     $html .= '<div class="form-group">
1702
-            <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass") . '</label>
1702
+            <label class="col-sm-6 control-label">' . get_lang("EncryptMethodUserPass").'</label>
1703 1703
         <div class="col-sm-6">';
1704 1704
     if ($installType == 'update') {
1705
-        $html .= '<input type="hidden" name="encryptPassForm" value="'. $encryptPassForm .'" />'. $encryptPassForm;
1705
+        $html .= '<input type="hidden" name="encryptPassForm" value="'.$encryptPassForm.'" />'.$encryptPassForm;
1706 1706
     } else {
1707 1707
 
1708 1708
         $html .= '<div class="checkbox">
1709 1709
                     <label>
1710
-                        <input  type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ':'') .'/> bcrypt
1710
+                        <input  type="radio" name="encryptPassForm" value="bcrypt" id="encryptPass1" '. ($encryptPassForm == 'bcrypt' ? 'checked="checked" ' : '').'/> bcrypt
1711 1711
                     </label>';
1712 1712
 
1713 1713
         $html .= '<label>
1714
-                        <input  type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ':'') .'/> sha1
1714
+                        <input  type="radio" name="encryptPassForm" value="sha1" id="encryptPass1" '. ($encryptPassForm == 'sha1' ? 'checked="checked" ' : '').'/> sha1
1715 1715
                     </label>';
1716 1716
 
1717 1717
         $html .= '<label>
1718
-                        <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ':'') .'/> md5
1718
+                        <input type="radio" name="encryptPassForm" value="md5" id="encryptPass0" '. ($encryptPassForm == 'md5' ? 'checked="checked" ' : '').'/> md5
1719 1719
                     </label>';
1720 1720
 
1721 1721
         $html .= '<label>
1722
-                        <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ':'') .'/>'. get_lang('None').'
1722
+                        <input type="radio" name="encryptPassForm" value="none" id="encryptPass2" '. ($encryptPassForm == 'none' ? 'checked="checked" ' : '').'/>'.get_lang('None').'
1723 1723
                     </label>';
1724 1724
         $html .= '</div>';
1725 1725
     }
1726 1726
     $html .= '</div></div>';
1727 1727
 
1728 1728
     $html .= '<div class="form-group">
1729
-            <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg') . '</label>
1729
+            <label class="col-sm-6 control-label">' . get_lang('AllowSelfReg').'</label>
1730 1730
             <div class="col-sm-6">';
1731 1731
     if ($installType == 'update') {
1732 1732
         if ($allowSelfReg == 'true') {
@@ -1736,17 +1736,17 @@  discard block
 block discarded – undo
1736 1736
         } else {
1737 1737
             $label = get_lang('AfterApproval');
1738 1738
         }
1739
-        $html .= '<input type="hidden" name="allowSelfReg" value="'. $allowSelfReg .'" />'. $label;
1739
+        $html .= '<input type="hidden" name="allowSelfReg" value="'.$allowSelfReg.'" />'.$label;
1740 1740
     } else {
1741 1741
         $html .= '<div class="control-group">';
1742 1742
         $html .= '<label class="checkbox-inline">
1743
-                        <input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '') . ' /> '. get_lang('Yes') .'
1743
+                        <input type="radio" name="allowSelfReg" value="true" id="allowSelfReg1" '. ($allowSelfReg == 'true' ? 'checked="checked" ' : '').' /> '.get_lang('Yes').'
1744 1744
                     </label>';
1745 1745
         $html .= '<label class="checkbox-inline">
1746
-                        <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ') .' /> '. get_lang('No') .'
1746
+                        <input type="radio" name="allowSelfReg" value="false" id="allowSelfReg0" '. ($allowSelfReg == 'false' ? '' : 'checked="checked" ').' /> '.get_lang('No').'
1747 1747
                     </label>';
1748 1748
          $html .= '<label class="checkbox-inline">
1749
-                    <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ') .' /> '. get_lang('AfterApproval') .'
1749
+                    <input type="radio" name="allowSelfReg" value="approval" id="allowSelfReg2" '. ($allowSelfReg == 'approval' ? '' : 'checked="checked" ').' /> '.get_lang('AfterApproval').'
1750 1750
                 </label>';
1751 1751
         $html .= '</div>';
1752 1752
     }
@@ -1754,7 +1754,7 @@  discard block
 block discarded – undo
1754 1754
     $html .= '</div>';
1755 1755
 
1756 1756
     $html .= '<div class="form-group">';
1757
-    $html .= '<label class="col-sm-6 control-label">'. get_lang('AllowSelfRegProf') .'</label>
1757
+    $html .= '<label class="col-sm-6 control-label">'.get_lang('AllowSelfRegProf').'</label>
1758 1758
         <div class="col-sm-6">';
1759 1759
     if ($installType == 'update') {
1760 1760
         if ($allowSelfRegProf == 'true') {
@@ -1762,16 +1762,16 @@  discard block
 block discarded – undo
1762 1762
         } else {
1763 1763
             $label = get_lang('No');
1764 1764
         }
1765
-        $html .= '<input type="hidden" name="allowSelfRegProf" value="'. $allowSelfRegProf.'" />'. $label;
1765
+        $html .= '<input type="hidden" name="allowSelfRegProf" value="'.$allowSelfRegProf.'" />'.$label;
1766 1766
     } else {
1767 1767
         $html .= '<div class="control-group">
1768 1768
                 <label class="checkbox-inline">
1769
-                    <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '') .'/>
1770
-                ' . get_lang('Yes') .'
1769
+                    <input type="radio" name="allowSelfRegProf" value="1" id="allowSelfRegProf1" '. ($allowSelfRegProf ? 'checked="checked" ' : '').'/>
1770
+                ' . get_lang('Yes').'
1771 1771
                 </label>';
1772 1772
         $html .= '<label class="checkbox-inline">
1773
-                    <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ') .' />
1774
-                   '. get_lang('No') .'
1773
+                    <input type="radio" name="allowSelfRegProf" value="0" id="allowSelfRegProf0" '. ($allowSelfRegProf ? '' : 'checked="checked" ').' />
1774
+                   '. get_lang('No').'
1775 1775
                 </label>';
1776 1776
         $html .= '</div>';
1777 1777
     }
@@ -1836,7 +1836,7 @@  discard block
 block discarded – undo
1836 1836
         "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar",
1837 1837
         "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway",
1838 1838
         "Oman",
1839
-        "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland","Portugal",
1839
+        "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal",
1840 1840
         "Qatar",
1841 1841
         "Romania", "Russia", "Rwanda",
1842 1842
         "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria",
@@ -1883,11 +1883,11 @@  discard block
 block discarded – undo
1883 1883
     $permissions_for_new_directories = isset($_SESSION['permissions_for_new_directories']) ? $_SESSION['permissions_for_new_directories'] : 0770;
1884 1884
     $permissions_for_new_files = isset($_SESSION['permissions_for_new_files']) ? $_SESSION['permissions_for_new_files'] : 0660;
1885 1885
     // use decoct() to store as string
1886
-    $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_directories) . "'
1886
+    $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_directories)."'
1887 1887
               WHERE variable  = 'permissions_for_new_directories'";
1888 1888
     Database::query($sql);
1889 1889
 
1890
-    $sql = "UPDATE $table SET selected_value = '0" . decoct($permissions_for_new_files) . "' WHERE variable  = 'permissions_for_new_files'";
1890
+    $sql = "UPDATE $table SET selected_value = '0".decoct($permissions_for_new_files)."' WHERE variable  = 'permissions_for_new_files'";
1891 1891
     Database::query($sql);
1892 1892
 
1893 1893
     if (isset($_SESSION['permissions_for_new_directories'])) {
@@ -1907,8 +1907,8 @@  discard block
 block discarded – undo
1907 1907
 function compare_setting_values($current_value, $wanted_value)
1908 1908
 {
1909 1909
     $current_value_string = $current_value;
1910
-    $current_value = (float)$current_value;
1911
-    $wanted_value = (float)$wanted_value;
1910
+    $current_value = (float) $current_value;
1911
+    $wanted_value = (float) $wanted_value;
1912 1912
 
1913 1913
     if ($current_value >= $wanted_value) {
1914 1914
         return Display::label($current_value_string, 'success');
@@ -1971,7 +1971,7 @@  discard block
 block discarded – undo
1971 1971
 
1972 1972
                     fwrite($fp, $out);
1973 1973
                     while (!feof($fp)) {
1974
-                        $result = str_replace("\r\n", '',fgets($fp, 128));
1974
+                        $result = str_replace("\r\n", '', fgets($fp, 128));
1975 1975
                         if (!empty($result) && $result == '123') {
1976 1976
                             $output = true;
1977 1977
                         }
@@ -1994,7 +1994,7 @@  discard block
 block discarded – undo
1994 1994
                     curl_setopt($ch, CURLOPT_URL, $url);
1995 1995
                     //curl_setopt($ch, CURLOPT_TIMEOUT, 30);
1996 1996
                     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1997
-                    $result = curl_exec ($ch);
1997
+                    $result = curl_exec($ch);
1998 1998
                     if (!empty($result) && $result == '123') {
1999 1999
                         $output = true;
2000 2000
                     }
@@ -2755,12 +2755,12 @@  discard block
 block discarded – undo
2755 2755
         $adminPhoneForm,
2756 2756
         '', //$picture_uri = '',
2757 2757
         PLATFORM_AUTH_SOURCE,
2758
-        '',//$expirationDate,
2758
+        '', //$expirationDate,
2759 2759
         1,
2760 2760
         0,
2761 2761
         null,
2762 2762
         '',
2763
-        false,  //$send_mail = false,
2763
+        false, //$send_mail = false,
2764 2764
         true //$isAdmin = false
2765 2765
     );
2766 2766
 
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
         0,
2783 2783
         null,
2784 2784
         '',
2785
-        false,  //$send_mail = false,
2785
+        false, //$send_mail = false,
2786 2786
         false //$isAdmin = false
2787 2787
     );
2788 2788
 
@@ -2817,7 +2817,7 @@  discard block
 block discarded – undo
2817 2817
     Database::query($sql);
2818 2818
 
2819 2819
     foreach ($files as $version) {
2820
-        $version = str_replace(['Version',  '.php' ], '', $version->getFilename());
2820
+        $version = str_replace(['Version', '.php'], '', $version->getFilename());
2821 2821
         $sql = "INSERT INTO version (version) VALUES ('$version')";
2822 2822
         Database::query($sql);
2823 2823
     }
@@ -2863,7 +2863,7 @@  discard block
 block discarded – undo
2863 2863
                 SET selected_value = '".$param->selected_value."'
2864 2864
                 WHERE variable = '".$param->variable."'";
2865 2865
         if (!empty($param->subkey)) {
2866
-            $sql .= " AND subkey='" . $param->subkey . "'";
2866
+            $sql .= " AND subkey='".$param->subkey."'";
2867 2867
         }
2868 2868
         Database::query($sql);
2869 2869
     }
Please login to merge, or discard this patch.
plugin/vchamilo/lib/Virtual.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 
98 98
                 $data['SYS_ARCHIVE_PATH'] = self::addTrailingSlash($archivePath).$data['slug'];
99 99
                 $data['SYS_HOME_PATH'] = self::addTrailingSlash($homePath).$data['slug'];
100
-                $data['WEB_HOME_PATH'] = $_configuration['vchamilo_web_root'] . '/var/home/' . $data['slug'];
100
+                $data['WEB_HOME_PATH'] = $_configuration['vchamilo_web_root'].'/var/home/'.$data['slug'];
101 101
                 $data['SYS_COURSE_PATH'] = self::addTrailingSlash($coursePath).$data['slug'];
102 102
                 $data['SYS_UPLOAD_PATH'] = self::addTrailingSlash($uploadPath).$data['slug'];
103 103
                 //$data['WEB_UPLOAD_PATH'] = $_configuration['vchamilo_web_root'] . '/var/upload/' . $data['slug'];
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
         if (preg_match('#https?://#', $url)) {
231 231
             header('location: '.$url);
232 232
         } else {
233
-            header('location: ' . api_get_path(WEB_PATH).$url);
233
+            header('location: '.api_get_path(WEB_PATH).$url);
234 234
         }
235 235
         exit;
236 236
     }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         }
414 414
 
415 415
         // Making the command line (see 'vconfig.php' file for defining the right paths).
416
-        $sqlcmd = $pgm.' -h'.$vchamilodata->db_host.(isset($vchamilodata->db_port) ? ' -P'.$vchamilodata->db_port.' ' : ' ' );
416
+        $sqlcmd = $pgm.' -h'.$vchamilodata->db_host.(isset($vchamilodata->db_port) ? ' -P'.$vchamilodata->db_port.' ' : ' ');
417 417
         $sqlcmd .= '-u'.$vchamilodata->db_user.' '.$databasePassword;
418 418
         $sqlcmd .= '%DATABASE% < ';
419 419
 
@@ -493,10 +493,10 @@  discard block
 block discarded – undo
493 493
         //if ($CFG->ostype == 'WINDOWS') {
494 494
         if (false) {
495 495
             $cmd_main = "-h{$host} -P{$port} -u{$vchamilo->db_user} {$pass} {$vchamilo->main_database}";
496
-            $cmds[] = $cmd_main . ' > ' . $outputfilerad;
496
+            $cmds[] = $cmd_main.' > '.$outputfilerad;
497 497
         } else {
498 498
             $cmd_main = "-h{$host} -P{$port} -u{$vchamilo->db_user} {$pass} {$vchamilo->main_database}";
499
-            $cmds[] = $cmd_main . ' > ' . escapeshellarg($outputfilerad);
499
+            $cmds[] = $cmd_main.' > '.escapeshellarg($outputfilerad);
500 500
         }
501 501
 
502 502
         $mysqldumpcmd = self::getConfig('vchamilo', 'cmd_mysqldump', true);
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
                 Display::return_message('You cannot use the same database as the chamilo master', 'error')
946 946
             );
947 947
 
948
-            return ;
948
+            return;
949 949
         }
950 950
 
951 951
         $databaseName = $data->main_database;
@@ -959,7 +959,7 @@  discard block
 block discarded – undo
959 959
                     'error'
960 960
                 )
961 961
             );
962
-            return ;
962
+            return;
963 963
         }
964 964
 
965 965
         $data->root_web = api_add_trailing_slash($data->root_web);
@@ -983,7 +983,7 @@  discard block
 block discarded – undo
983 983
                 Display::addFlash(
984 984
                     Display::return_message('Cannot create slug from url: '.$data->root_web, 'error')
985 985
                 );
986
-                return ;
986
+                return;
987 987
             }
988 988
             Database::insert($tablename, (array) $data);
989 989
         }
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
                 $newDatabase->sitename = $siteName;
1126 1126
                 $newDatabase->institution = $institution;
1127 1127
                 $slug = $newDatabase->slug = $data->slug = Virtual::getSlugFromUrl($data->root_web);
1128
-                $id = Database::insert($table, (array)$newDatabase);
1128
+                $id = Database::insert($table, (array) $newDatabase);
1129 1129
             }
1130 1130
         }
1131 1131
 
@@ -1302,7 +1302,7 @@  discard block
 block discarded – undo
1302 1302
             $id = (int) $id;
1303 1303
             $sql = "SELECT * FROM vchamilo WHERE id = $id";
1304 1304
             $result = Database::query($sql);
1305
-            $vhost =  (object) Database::fetch_array($result, 'ASSOC');
1305
+            $vhost = (object) Database::fetch_array($result, 'ASSOC');
1306 1306
         }
1307 1307
 
1308 1308
         return $vhost;
Please login to merge, or discard this patch.
main/inc/lib/banner.lib.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 
52 52
     // My Profile
53
-    $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
53
+    $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '');
54 54
     $navigation['myprofile']['title'] = get_lang('ModifyProfile');
55 55
     $navigation['myprofile']['key'] = 'profile';
56 56
     $navigation['myprofile']['icon'] = 'profile.png';
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
 	// Gradebook
64 64
 	if (api_get_setting('gradebook_enable') == 'true') {
65
-        $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
65
+        $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '');
66 66
         $navigation['mygradebook']['title'] = get_lang('MyGradebook');
67 67
         $navigation['mygradebook']['key'] = 'gradebook';
68 68
         $navigation['mygradebook']['icon'] = 'gradebook.png';
@@ -71,12 +71,12 @@  discard block
 block discarded – undo
71 71
 	// Reporting
72 72
 	if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) {
73 73
         // Link to my space
74
-        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh()?'session.php':'');
74
+        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh() ? 'session.php' : '');
75 75
         $navigation['session_my_space']['title'] = get_lang('MySpace');
76 76
         $navigation['session_my_space']['key'] = 'my-space';
77 77
         $navigation['session_my_space']['icon'] = 'my-space.png';
78 78
     } else if (api_is_student_boss()) {
79
-        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH) . 'mySpace/student.php';
79
+        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/student.php';
80 80
         $navigation['session_my_space']['title'] = get_lang('MySpace');
81 81
         $navigation['session_my_space']['key'] = 'my-space';
82 82
         $navigation['session_my_space']['icon'] = 'my-space.png';
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     }
98 98
 
99 99
 	// Social
100
-	if (api_get_setting('allow_social_tool')=='true') {
100
+	if (api_get_setting('allow_social_tool') == 'true') {
101 101
         $navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php';
102 102
         $navigation['social']['title'] = get_lang('SocialNetwork');
103 103
         $navigation['social']['key'] = 'social-network';
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     $_course = api_get_course_info();
194 194
     $course_id = 0;
195 195
     if (!empty($_course)) {
196
-        $course_id  = $_course['code'];
196
+        $course_id = $_course['code'];
197 197
     }
198 198
 
199 199
     $user_id = api_get_user_id();
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function return_navigation_array()
247 247
 {
248
-    return ;
248
+    return;
249 249
     $navigation = array();
250 250
     $menu_navigation = array();
251 251
     $possible_tabs = get_tabs();
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             $cleanUrl = api_replace_dangerous_char($url);
404 404
             $cleanUrl = str_replace('/', '-', $cleanUrl);
405 405
             $cleanUrl .= '/';
406
-            $homepath  = api_get_path(SYS_HOME_PATH) . $cleanUrl; //homep for Home Path
406
+            $homepath  = api_get_path(SYS_HOME_PATH).$cleanUrl; //homep for Home Path
407 407
 
408 408
             //we create the new dir for the new sites
409 409
             if (!is_dir($homepath)) {
@@ -419,9 +419,9 @@  discard block
 block discarded – undo
419 419
     $pageContent = '';
420 420
     // Get the extra page content, containing the links to add to the tabs
421 421
     if (is_file($homepath.$menuTabs.'_'.$lang.$ext) && is_readable($homepath.$menuTabs.'_'.$lang.$ext)) {
422
-        $pageContent = @(string) file_get_contents($homepath . $menuTabs . '_' . $lang . $ext);
422
+        $pageContent = @(string) file_get_contents($homepath.$menuTabs.'_'.$lang.$ext);
423 423
     } elseif (is_file($homepath.$menuTabs.$lang.$ext) && is_readable($homepath.$menuTabs.$lang.$ext)) {
424
-        $pageContent = @(string) file_get_contents($homepath . $menuTabs . $lang . $ext);
424
+        $pageContent = @(string) file_get_contents($homepath.$menuTabs.$lang.$ext);
425 425
     }
426 426
     // Sanitize page content
427 427
     $pageContent = api_to_system_encoding($pageContent, api_detect_encoding(strip_tags($pageContent)));
@@ -431,22 +431,22 @@  discard block
 block discarded – undo
431 431
     //  that are only for users already logged in
432 432
     $openMenuTabsLoggedIn = '';
433 433
     if (api_get_user_id() && !api_is_anonymous()) {
434
-        if (is_file($homepath . $menuTabsLoggedIn . '_' . $lang . $ext) && is_readable($homepath . $menuTabsLoggedIn . '_' . $lang . $ext)) {
435
-            $pageContent = @(string) file_get_contents($homepath . $menuTabsLoggedIn . '_' . $lang . $ext);
434
+        if (is_file($homepath.$menuTabsLoggedIn.'_'.$lang.$ext) && is_readable($homepath.$menuTabsLoggedIn.'_'.$lang.$ext)) {
435
+            $pageContent = @(string) file_get_contents($homepath.$menuTabsLoggedIn.'_'.$lang.$ext);
436 436
             $pageContent = str_replace('::private', '', $pageContent);
437
-        } elseif (is_file($homepath . $menuTabsLoggedIn . $lang . $ext) && is_readable($homepath . $menuTabsLoggedIn . $lang . $ext)) {
438
-            $pageContent = @(string) file_get_contents($homepath . $menuTabsLoggedIn . $lang . $ext);
437
+        } elseif (is_file($homepath.$menuTabsLoggedIn.$lang.$ext) && is_readable($homepath.$menuTabsLoggedIn.$lang.$ext)) {
438
+            $pageContent = @(string) file_get_contents($homepath.$menuTabsLoggedIn.$lang.$ext);
439 439
             $pageContent = str_replace('::private', '', $pageContent);
440 440
         }
441 441
 
442 442
         $pageContent = api_to_system_encoding($pageContent, api_detect_encoding(strip_tags($pageContent)));
443
-        $openMenuTabsLoggedIn = str_replace('{rel_path}',api_get_path(REL_PATH), $pageContent);
443
+        $openMenuTabsLoggedIn = str_replace('{rel_path}', api_get_path(REL_PATH), $pageContent);
444 444
         $openMenuTabsLoggedIn = api_to_system_encoding($openMenuTabsLoggedIn, api_detect_encoding(strip_tags($openMenuTabsLoggedIn)));
445 445
     }
446 446
     if (!empty($open) || !empty($openMenuTabsLoggedIn)) {
447 447
         if (strpos($open.$openMenuTabsLoggedIn, 'show_menu') === false) {
448 448
             if (api_is_anonymous()) {
449
-                $mainNavigation['navigation'][SECTION_CAMPUS]  = null;
449
+                $mainNavigation['navigation'][SECTION_CAMPUS] = null;
450 450
             }
451 451
         } else {
452 452
             if (api_get_user_id() && !api_is_anonymous()) {
@@ -459,7 +459,7 @@  discard block
 block discarded – undo
459 459
                             'url' => $matches[1],
460 460
                             'target' => $matches[2],
461 461
                             'title' => $matches[3],
462
-                            'key' => 'page-' . str_replace(' ', '-', strtolower($matches[3]))
462
+                            'key' => 'page-'.str_replace(' ', '-', strtolower($matches[3]))
463 463
                         );
464 464
                     }
465 465
                 }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
                             'url' => $matches[1],
474 474
                             'target' => $matches[2],
475 475
                             'title' => $matches[3],
476
-                            'key' => 'page-' . str_replace(' ', '-', strtolower($matches[3]))
476
+                            'key' => 'page-'.str_replace(' ', '-', strtolower($matches[3]))
477 477
                         );
478 478
                     }
479 479
                 }
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
         //$pre_lis = '';
486 486
         $activeSection = '';
487 487
         foreach ($mainNavigation['navigation'] as $section => $navigation_info) {
488
-            $key = (!empty($navigation_info['key'])?'tab-'.$navigation_info['key']:'');
488
+            $key = (!empty($navigation_info['key']) ? 'tab-'.$navigation_info['key'] : '');
489 489
 
490 490
             if (isset($GLOBALS['this_section'])) {
491 491
                 $tempSection = $section;
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
                 // loaded
500 500
                 if ($GLOBALS['this_section'] == SECTION_CAMPUS) {
501 501
                     if (!empty($_GET['include'])) {
502
-                        $name = str_replace(' ', '-', strtolower($navigation_info['title'])) . '_' . $lang . $ext;
502
+                        $name = str_replace(' ', '-', strtolower($navigation_info['title'])).'_'.$lang.$ext;
503 503
                         if (strtolower($_GET['include']) == $name) {
504 504
                             $activeSection = $section;
505 505
                         }
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 
552 552
     if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) {
553 553
 
554
-        $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : '');
554
+        $navigation_item['url'] = $web_course_path.$_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : '');
555 555
         $_course['name'] = api_htmlentities($_course['name']);
556 556
         $course_title = cut($_course['name'], MAX_LENGTH_BREADCRUMB);
557 557
 
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
                 $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name;
567 567
                 break;
568 568
             default:
569
-                if (api_get_session_id() != -1 ) {
569
+                if (api_get_session_id() != -1) {
570 570
                     $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name;
571 571
                 } else {
572 572
                     $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name']).' '.$course_title;
@@ -686,35 +686,35 @@  discard block
 block discarded – undo
686 686
         if (!empty($final_navigation)) {
687 687
             // $home_link.= '<span class="divider">/</span>';
688 688
             if (!empty($home_link)) {
689
-                $lis.= Display::tag('li', $home_link);
689
+                $lis .= Display::tag('li', $home_link);
690 690
             }
691 691
 
692 692
             foreach ($final_navigation as $bread) {
693 693
                 $bread_check = trim(strip_tags($bread));
694 694
                 if (!empty($bread_check)) {
695
-                    if ($final_navigation_count-1 > $i) {
695
+                    if ($final_navigation_count - 1 > $i) {
696 696
                         $bread .= '';
697 697
                     }
698
-                    $lis.= Display::tag('li', $bread, array('class'=>'active'));
698
+                    $lis .= Display::tag('li', $bread, array('class'=>'active'));
699 699
                     $i++;
700 700
                 }
701 701
             }
702 702
         } else {
703 703
             if (!empty($home_link)) {
704
-                $lis.= Display::tag('li', $home_link);
704
+                $lis .= Display::tag('li', $home_link);
705 705
             }
706 706
         }
707 707
 
708 708
         // View as student/teacher link
709 709
         $view = null;
710 710
         if (!empty($view_as_student_link)) {
711
-            $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link','class' => 'pull-right'));
711
+            $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link', 'class' => 'pull-right'));
712 712
         }
713 713
 
714 714
         if (!empty($navigation_right)) {
715
-            foreach($navigation_right as $item) {
715
+            foreach ($navigation_right as $item) {
716 716
                 $extra_class = isset($item['class']) ? $item['class'] : null;
717
-                $lis.= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right'));
717
+                $lis .= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right'));
718 718
             }
719 719
         }
720 720
 
Please login to merge, or discard this patch.
main/inc/lib/document.lib.php 1 patch
Spacing   +330 added lines, -330 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');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
                     } else {
379 379
                         $encoding = @api_detect_encoding_html(file_get_contents($full_file_name));
380 380
                         if (!empty($encoding)) {
381
-                            $content_type .= '; charset=' . $encoding;
381
+                            $content_type .= '; charset='.$encoding;
382 382
                         }
383 383
                     }
384 384
                     break;
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
                     } else {
389 389
                         $encoding = @api_detect_encoding(strip_tags(file_get_contents($full_file_name)));
390 390
                         if (!empty($encoding)) {
391
-                            $content_type .= '; charset=' . $encoding;
391
+                            $content_type .= '; charset='.$encoding;
392 392
                         }
393 393
                     }
394 394
                     break;
@@ -397,13 +397,13 @@  discard block
 block discarded – undo
397 397
                     header('Content-type: application/octet-stream');
398 398
                     break;
399 399
             }
400
-            header('Content-type: ' . $content_type);
401
-            header('Content-Length: ' . $len);
400
+            header('Content-type: '.$content_type);
401
+            header('Content-Length: '.$len);
402 402
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
403 403
             if (strpos($user_agent, 'msie')) {
404
-                header('Content-Disposition: ; filename= ' . $filename);
404
+                header('Content-Disposition: ; filename= '.$filename);
405 405
             } else {
406
-                header('Content-Disposition: inline; filename= ' . $filename);
406
+                header('Content-Disposition: inline; filename= '.$filename);
407 407
             }
408 408
 
409 409
             if ($fixLinksHttpToHttps) {
@@ -444,18 +444,18 @@  discard block
 block discarded – undo
444 444
 
445 445
             header('Content-type: application/octet-stream');
446 446
             //header('Content-Type: application/force-download');
447
-            header('Content-length: ' . $len);
447
+            header('Content-length: '.$len);
448 448
             if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) {
449
-                header('Content-Disposition: filename= ' . $filename);
449
+                header('Content-Disposition: filename= '.$filename);
450 450
             } else {
451
-                header('Content-Disposition: attachment; filename= ' . $filename);
451
+                header('Content-Disposition: attachment; filename= '.$filename);
452 452
             }
453 453
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) {
454 454
                 header('Pragma: ');
455 455
                 header('Cache-Control: ');
456 456
                 header('Cache-Control: public'); // IE cannot download from sessions without a cache
457 457
             }
458
-            header('Content-Description: ' . $filename);
458
+            header('Content-Description: '.$filename);
459 459
             header('Content-transfer-encoding: binary');
460 460
             echo $full_string;
461 461
 
@@ -468,30 +468,30 @@  discard block
 block discarded – undo
468 468
 
469 469
             $content_type = self::file_get_mime_type($filename);
470 470
             header('Expires: Wed, 01 Jan 1990 00:00:00 GMT');
471
-            header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
471
+            header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
472 472
             header('Cache-Control: no-cache, must-revalidate');
473 473
             header('Pragma: no-cache');
474 474
             switch ($content_type) {
475 475
                 case 'text/html':
476 476
                     $encoding = @api_detect_encoding_html($full_string);
477 477
                     if (!empty($encoding)) {
478
-                        $content_type .= '; charset=' . $encoding;
478
+                        $content_type .= '; charset='.$encoding;
479 479
                     }
480 480
                     break;
481 481
                 case 'text/plain':
482 482
                     $encoding = @api_detect_encoding(strip_tags($full_string));
483 483
                     if (!empty($encoding)) {
484
-                        $content_type .= '; charset=' . $encoding;
484
+                        $content_type .= '; charset='.$encoding;
485 485
                     }
486 486
                     break;
487 487
             }
488
-            header('Content-type: ' . $content_type);
489
-            header('Content-Length: ' . $len);
488
+            header('Content-type: '.$content_type);
489
+            header('Content-Length: '.$len);
490 490
             $user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
491 491
             if (strpos($user_agent, 'msie')) {
492
-                header('Content-Disposition: ; filename= ' . $filename);
492
+                header('Content-Disposition: ; filename= '.$filename);
493 493
             } else {
494
-                header('Content-Disposition: inline; filename= ' . $filename);
494
+                header('Content-Disposition: inline; filename= '.$filename);
495 495
             }
496 496
             echo($full_string);
497 497
             //You have to ensure that the calling script then stops processing (exit();)
@@ -586,9 +586,9 @@  discard block
 block discarded – undo
586 586
             if (!empty($students)) {
587 587
                 $conditionList = array();
588 588
                 foreach ($students as $studentId => $studentInfo) {
589
-                    $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
589
+                    $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
590 590
                 }
591
-                $sharedCondition .= ' AND docs.path IN ("' . implode('","', $conditionList) . '")';
591
+                $sharedCondition .= ' AND docs.path IN ("'.implode('","', $conditionList).'")';
592 592
             }
593 593
         }
594 594
 
@@ -615,8 +615,8 @@  discard block
 block discarded – undo
615 615
                     last.tool = '".TOOL_DOCUMENT."' AND 
616 616
                     docs.c_id = {$_course['real_id']} AND
617 617
                     last.c_id = {$_course['real_id']} AND
618
-                    docs.path LIKE '" . Database::escape_string($path . $added_slash.'%'). "' AND
619
-                    docs.path NOT LIKE '" . Database::escape_string($path . $added_slash.'%/%')."' AND
618
+                    docs.path LIKE '".Database::escape_string($path.$added_slash.'%')."' AND
619
+                    docs.path NOT LIKE '" . Database::escape_string($path.$added_slash.'%/%')."' AND
620 620
                     docs.path NOT LIKE '%_DELETED_%' AND
621 621
                     $userGroupFilter AND
622 622
                     last.visibility $visibility_bit
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
                     $table_template = Database::get_main_table(TABLE_MAIN_TEMPLATES);
658 658
                     $sql = "SELECT id FROM $table_template
659 659
                             WHERE
660
-                                course_code = '" . $_course['code'] . "' AND
660
+                                course_code = '".$_course['code']."' AND
661 661
                                 user_id = '".api_get_user_id()."' AND
662 662
                                 ref_doc = '".$row['id']."'";
663 663
                     $template_result = Database::query($sql);
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
         $conditionList = array();
771 771
         if (!empty($students)) {
772 772
             foreach ($students as $studentId => $studentInfo) {
773
-                $conditionList[] = '/shared_folder/sf_user_' . $studentInfo['user_id'];
773
+                $conditionList[] = '/shared_folder/sf_user_'.$studentInfo['user_id'];
774 774
             }
775 775
         }
776 776
 
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
                        INNER JOIN $TABLE_DOCUMENT  AS docs
800 800
                        ON (
801 801
                             docs.id = last.ref AND
802
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
802
+                            last.tool = '".TOOL_DOCUMENT."' AND
803 803
                             last.c_id = {$_course['real_id']} AND
804 804
                             docs.c_id = {$_course['real_id']}
805 805
                        )
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
                         INNER JOIN $TABLE_DOCUMENT  AS docs
817 817
                         ON (
818 818
                             docs.id = last.ref AND
819
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
819
+                            last.tool = '".TOOL_DOCUMENT."' AND
820 820
                             last.c_id = {$_course['real_id']} AND
821 821
                             docs.c_id = {$_course['real_id']}
822 822
                         )
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
                         ON (docs.id = last.ref AND last.c_id = docs.c_id)
875 875
                     WHERE
876 876
                         $fileType
877
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
877
+                        last.tool = '".TOOL_DOCUMENT."' AND
878 878
                         $groupCondition AND
879 879
                         $visibilityCondition
880 880
                         $show_users_condition
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
                     ON (docs.id = last.ref AND last.c_id = docs.c_id)
903 903
                     WHERE                        
904 904
                         docs.filetype = 'folder' AND
905
-                        last.tool = '" . TOOL_DOCUMENT . "' AND
905
+                        last.tool = '".TOOL_DOCUMENT."' AND
906 906
                         $groupCondition AND
907 907
                         last.visibility = 0 $condition_session AND
908 908
                         last.c_id = {$_course['real_id']} AND
@@ -918,9 +918,9 @@  discard block
 block discarded – undo
918 918
                         FROM $TABLE_ITEMPROPERTY AS last, $TABLE_DOCUMENT AS docs
919 919
                         WHERE
920 920
                             docs.id = last.ref AND
921
-                            docs.path LIKE '" . Database::escape_string($row['path'].'/%') . "' AND
921
+                            docs.path LIKE '".Database::escape_string($row['path'].'/%')."' AND
922 922
                             docs.filetype = 'folder' AND
923
-                            last.tool = '" . TOOL_DOCUMENT . "' AND
923
+                            last.tool = '" . TOOL_DOCUMENT."' AND
924 924
                             $groupCondition AND
925 925
                             last.visibility = 1 $condition_session AND
926 926
                             last.c_id = {$_course['real_id']} AND
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                                 tp.c_id = $course_id AND
998 998
                                 td.session_id = $sessionId AND
999 999
                                 tp.ref= td.id AND
1000
-                                (path='" . $path . "' OR path LIKE BINARY '" . $path . "/%' ) ";
1000
+                                (path='".$path."' OR path LIKE BINARY '".$path."/%' ) ";
1001 1001
                     // Get all id's of documents that are deleted
1002 1002
                     $what_to_check_result = Database::query($sql);
1003 1003
 
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
             $res = Database::query($sql);
1345 1345
             if (Database::num_rows($res) > 0) {
1346 1346
                 $row2 = Database::fetch_array($res);
1347
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
1347
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
1348 1348
                 $di = new ChamiloIndexer();
1349 1349
                 $di->remove_document((int) $row2['search_did']);
1350 1350
             }
@@ -1353,7 +1353,7 @@  discard block
 block discarded – undo
1353 1353
             Database::query($sql);
1354 1354
 
1355 1355
             // remove terms from db
1356
-            require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
1356
+            require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
1357 1357
             delete_all_values_for_item($course_id, TOOL_DOCUMENT, $document_id);
1358 1358
         }
1359 1359
     }
@@ -1439,12 +1439,12 @@  discard block
 block discarded – undo
1439 1439
             $path = str_replace('%2F', '/', $url_path);
1440 1440
             $pathinfo = pathinfo($row['path']);
1441 1441
 
1442
-            $row['url'] = api_get_path(WEB_CODE_PATH) . 'document/showinframes.php?cidReq=' . $course_code . '&id=' . $id;
1443
-            $row['document_url'] = api_get_path(WEB_CODE_PATH) . 'document/document.php?cidReq=' . $course_code . '&id=' . $id;
1444
-            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1445
-            $row['absolute_path_from_document'] = '/document' . $row['path'];
1446
-            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'] . '/';
1447
-            $row['direct_url'] = $www . $path;
1442
+            $row['url'] = api_get_path(WEB_CODE_PATH).'document/showinframes.php?cidReq='.$course_code.'&id='.$id;
1443
+            $row['document_url'] = api_get_path(WEB_CODE_PATH).'document/document.php?cidReq='.$course_code.'&id='.$id;
1444
+            $row['absolute_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1445
+            $row['absolute_path_from_document'] = '/document'.$row['path'];
1446
+            $row['absolute_parent_path'] = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$pathinfo['dirname'].'/';
1447
+            $row['direct_url'] = $www.$path;
1448 1448
             $row['basename'] = basename($row['path']);
1449 1449
 
1450 1450
             if (dirname($row['path']) == '.') {
@@ -1464,7 +1464,7 @@  discard block
 block discarded – undo
1464 1464
                 $real_dir = '';
1465 1465
 
1466 1466
                 for ($i = 1; $i < $array_len; $i++) {
1467
-                    $real_dir .= '/' . (isset($dir_array[$i]) ? $dir_array[$i] : '');
1467
+                    $real_dir .= '/'.(isset($dir_array[$i]) ? $dir_array[$i] : '');
1468 1468
                     $parent_id = self::get_document_id($course_info, $real_dir);
1469 1469
                     if ($session_id != 0 && empty($parent_id)) {
1470 1470
                         $parent_id = self::get_document_id($course_info, $real_dir, 0);
@@ -1538,21 +1538,21 @@  discard block
 block discarded – undo
1538 1538
         $user_id = intval($user_id);
1539 1539
         $document_id = intval($document_id);
1540 1540
 
1541
-        $sql = 'SELECT id FROM ' . $table_template . '
1541
+        $sql = 'SELECT id FROM '.$table_template.'
1542 1542
                 WHERE
1543
-                    course_code="' . $course_code . '" AND
1544
-                    user_id="' . $user_id . '" AND
1545
-                    ref_doc="' . $document_id . '"';
1543
+                    course_code="' . $course_code.'" AND
1544
+                    user_id="' . $user_id.'" AND
1545
+                    ref_doc="' . $document_id.'"';
1546 1546
         $result = Database::query($sql);
1547 1547
         $template_id = Database::result($result, 0, 0);
1548 1548
 
1549
-        my_delete(api_get_path(SYS_CODE_PATH) . 'upload/template_thumbnails/' . $template_id . '.jpg');
1549
+        my_delete(api_get_path(SYS_CODE_PATH).'upload/template_thumbnails/'.$template_id.'.jpg');
1550 1550
 
1551
-        $sql = 'DELETE FROM ' . $table_template . '
1551
+        $sql = 'DELETE FROM '.$table_template.'
1552 1552
                 WHERE
1553
-                    course_code="' . $course_code . '" AND
1554
-                    user_id="' . $user_id . '" AND
1555
-                    ref_doc="' . $document_id . '"';
1553
+                    course_code="' . $course_code.'" AND
1554
+                    user_id="' . $user_id.'" AND
1555
+                    ref_doc="' . $document_id.'"';
1556 1556
 
1557 1557
         Database::query($sql);
1558 1558
     }
@@ -1613,7 +1613,7 @@  discard block
 block discarded – undo
1613 1613
                 INNER JOIN $propTable ip
1614 1614
                 ON (d.id = ip.ref AND d.c_id  = $course_id AND ip.c_id = $course_id)
1615 1615
         		WHERE
1616
-        		    ip.tool = '" . TOOL_DOCUMENT . "' $condition AND
1616
+        		    ip.tool = '".TOOL_DOCUMENT."' $condition AND
1617 1617
         			filetype = '$file_type' AND
1618 1618
         			locate(concat(path,'/'), '$doc_path')=1
1619 1619
                 ";
@@ -1777,12 +1777,12 @@  discard block
 block discarded – undo
1777 1777
         if (empty($session_id)) {
1778 1778
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1779 1779
         } elseif ($session_id > 0) {
1780
-            $sql_session = 'AND session_id=' . intval($session_id);
1780
+            $sql_session = 'AND session_id='.intval($session_id);
1781 1781
         } else {
1782 1782
             $sql_session = '';
1783 1783
         }
1784
-        $sql = 'UPDATE ' . $tbl_category . ' SET document_id="' . intval($document_id) . '"
1785
-                WHERE c_id ="' . Database::escape_string($course_id) . '" ' . $sql_session;
1784
+        $sql = 'UPDATE '.$tbl_category.' SET document_id="'.intval($document_id).'"
1785
+                WHERE c_id ="' . Database::escape_string($course_id).'" '.$sql_session;
1786 1786
         Database::query($sql);
1787 1787
     }
1788 1788
 
@@ -1804,12 +1804,12 @@  discard block
 block discarded – undo
1804 1804
         if (empty($session_id)) {
1805 1805
             $sql_session = 'AND (session_id = 0 OR isnull(session_id)) ';
1806 1806
         } elseif ($session_id > 0) {
1807
-            $sql_session = 'AND session_id=' . intval($session_id);
1807
+            $sql_session = 'AND session_id='.intval($session_id);
1808 1808
         } else {
1809 1809
             $sql_session = '';
1810 1810
         }
1811
-        $sql = 'SELECT document_id FROM ' . $tbl_category . '
1812
-                WHERE c_id ="' . Database::escape_string($course_id) . '" ' . $sql_session;
1811
+        $sql = 'SELECT document_id FROM '.$tbl_category.'
1812
+                WHERE c_id ="' . Database::escape_string($course_id).'" '.$sql_session;
1813 1813
 
1814 1814
         $rs = Database::query($sql);
1815 1815
         $num = Database::num_rows($rs);
@@ -1850,7 +1850,7 @@  discard block
 block discarded – undo
1850 1850
             $all_user_info = array();
1851 1851
             if (Database::num_rows($rs)) {
1852 1852
                 $row = Database::fetch_array($rs);
1853
-                $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document' . $row['path'];
1853
+                $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document'.$row['path'];
1854 1854
                 if (is_file($filepath)) {
1855 1855
                     $my_content_html = file_get_contents($filepath);
1856 1856
                 }
@@ -1933,9 +1933,9 @@  discard block
 block discarded – undo
1933 1933
             $date_no_time = api_convert_and_format_date(api_get_utc_datetime(), DATE_FORMAT_LONG_NO_DAY);
1934 1934
         }
1935 1935
 
1936
-        $url = api_get_path(WEB_PATH) . 'certificates/index.php?id=' . $info_grade_certificate['id'];
1936
+        $url = api_get_path(WEB_PATH).'certificates/index.php?id='.$info_grade_certificate['id'];
1937 1937
 
1938
-        $externalStyleFile = api_get_path(SYS_CSS_PATH) . 'themes/' . api_get_visual_theme() . '/certificate.css';
1938
+        $externalStyleFile = api_get_path(SYS_CSS_PATH).'themes/'.api_get_visual_theme().'/certificate.css';
1939 1939
         $externalStyle = '';
1940 1940
 
1941 1941
         if (is_file($externalStyleFile)) {
@@ -1957,7 +1957,7 @@  discard block
 block discarded – undo
1957 1957
             $course_info['name'],
1958 1958
             $info_grade_certificate['grade'],
1959 1959
             $url,
1960
-            '<a href="' . $url . '" target="_blank">' . get_lang('CertificateOnlineLink') . '</a>',
1960
+            '<a href="'.$url.'" target="_blank">'.get_lang('CertificateOnlineLink').'</a>',
1961 1961
             '((certificate_barcode))',
1962 1962
             $externalStyle
1963 1963
         );
@@ -1983,7 +1983,7 @@  discard block
 block discarded – undo
1983 1983
         if (!empty($extraFields)) {
1984 1984
             foreach ($extraFields as $extraField) {
1985 1985
                 $valueExtra = isset($extra_user_info_data[$extraField['variable']]) ? $extra_user_info_data[$extraField['variable']] : '';
1986
-                $info_to_be_replaced_in_content_html[] = '((' . strtolower($extraField['variable']) . '))';
1986
+                $info_to_be_replaced_in_content_html[] = '(('.strtolower($extraField['variable']).'))';
1987 1987
                 $info_to_replace_in_content_html[] = $valueExtra;
1988 1988
             }
1989 1989
         }
@@ -2011,17 +2011,17 @@  discard block
 block discarded – undo
2011 2011
             $tbl_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
2012 2012
             $session_id = api_get_session_id();
2013 2013
             if ($session_id == 0 || is_null($session_id)) {
2014
-                $sql_session = 'AND (session_id=' . intval($session_id) . ' OR isnull(session_id)) ';
2014
+                $sql_session = 'AND (session_id='.intval($session_id).' OR isnull(session_id)) ';
2015 2015
             } elseif ($session_id > 0) {
2016
-                $sql_session = 'AND session_id=' . intval($session_id);
2016
+                $sql_session = 'AND session_id='.intval($session_id);
2017 2017
             } else {
2018 2018
                 $sql_session = '';
2019 2019
             }
2020 2020
 
2021
-            $sql = 'UPDATE ' . $tbl_category . ' SET document_id=null
2021
+            $sql = 'UPDATE '.$tbl_category.' SET document_id=null
2022 2022
                     WHERE
2023
-                        c_id = "' . Database::escape_string($course_id) . '" AND
2024
-                        document_id="' . $default_certificate_id . '" ' . $sql_session;
2023
+                        c_id = "' . Database::escape_string($course_id).'" AND
2024
+                        document_id="' . $default_certificate_id.'" '.$sql_session;
2025 2025
             Database::query($sql);
2026 2026
         }
2027 2027
     }
@@ -2037,10 +2037,10 @@  discard block
 block discarded – undo
2037 2037
         if (!empty($courseInfo)) {
2038 2038
             $to_group_id = 0;
2039 2039
             $to_user_id = null;
2040
-            $course_dir = $courseInfo['path'] . "/document/";
2040
+            $course_dir = $courseInfo['path']."/document/";
2041 2041
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
2042
-            $base_work_dir = $sys_course_path . $course_dir;
2043
-            $base_work_dir_test = $base_work_dir . 'certificates';
2042
+            $base_work_dir = $sys_course_path.$course_dir;
2043
+            $base_work_dir_test = $base_work_dir.'certificates';
2044 2044
             $dir_name = '/certificates';
2045 2045
             $post_dir_name = get_lang('CertificatesFiles');
2046 2046
             $visibility_command = 'invisible';
@@ -2265,9 +2265,9 @@  discard block
 block discarded – undo
2265 2265
                                             //$new_abs_path = realpath($dir.'/'.$second_part);
2266 2266
                                             $dir = '';
2267 2267
                                             if (!empty($abs_path)) {
2268
-                                                $dir = dirname($abs_path) . '/';
2268
+                                                $dir = dirname($abs_path).'/';
2269 2269
                                             }
2270
-                                            $new_abs_path = realpath($dir . $second_part);
2270
+                                            $new_abs_path = realpath($dir.$second_part);
2271 2271
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2272 2272
                                             if (count($in_files_list) > 0) {
2273 2273
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2280,9 +2280,9 @@  discard block
 block discarded – undo
2280 2280
                                             $files_list[] = array($second_part, 'local', 'rel');
2281 2281
                                             $dir = '';
2282 2282
                                             if (!empty($abs_path)) {
2283
-                                                $dir = dirname($abs_path) . '/';
2283
+                                                $dir = dirname($abs_path).'/';
2284 2284
                                             }
2285
-                                            $new_abs_path = realpath($dir . $second_part);
2285
+                                            $new_abs_path = realpath($dir.$second_part);
2286 2286
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2287 2287
                                             if (count($in_files_list) > 0) {
2288 2288
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2316,9 +2316,9 @@  discard block
 block discarded – undo
2316 2316
                                             $files_list[] = array($source, 'local', 'rel');
2317 2317
                                             $dir = '';
2318 2318
                                             if (!empty($abs_path)) {
2319
-                                                $dir = dirname($abs_path) . '/';
2319
+                                                $dir = dirname($abs_path).'/';
2320 2320
                                             }
2321
-                                            $new_abs_path = realpath($dir . $source);
2321
+                                            $new_abs_path = realpath($dir.$source);
2322 2322
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2323 2323
                                             if (count($in_files_list) > 0) {
2324 2324
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2331,9 +2331,9 @@  discard block
 block discarded – undo
2331 2331
                                             $files_list[] = array($source, 'local', 'rel');
2332 2332
                                             $dir = '';
2333 2333
                                             if (!empty($abs_path)) {
2334
-                                                $dir = dirname($abs_path) . '/';
2334
+                                                $dir = dirname($abs_path).'/';
2335 2335
                                             }
2336
-                                            $new_abs_path = realpath($dir . $source);
2336
+                                            $new_abs_path = realpath($dir.$source);
2337 2337
                                             $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2338 2338
                                             if (count($in_files_list) > 0) {
2339 2339
                                                 $files_list = array_merge($files_list, $in_files_list);
@@ -2367,9 +2367,9 @@  discard block
 block discarded – undo
2367 2367
                                     $files_list[] = array($source, 'local', 'rel');
2368 2368
                                     $dir = '';
2369 2369
                                     if (!empty($abs_path)) {
2370
-                                        $dir = dirname($abs_path) . '/';
2370
+                                        $dir = dirname($abs_path).'/';
2371 2371
                                     }
2372
-                                    $new_abs_path = realpath($dir . $source);
2372
+                                    $new_abs_path = realpath($dir.$source);
2373 2373
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2374 2374
                                     if (count($in_files_list) > 0) {
2375 2375
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2382,9 +2382,9 @@  discard block
 block discarded – undo
2382 2382
                                     $files_list[] = array($source, 'local', 'rel');
2383 2383
                                     $dir = '';
2384 2384
                                     if (!empty($abs_path)) {
2385
-                                        $dir = dirname($abs_path) . '/';
2385
+                                        $dir = dirname($abs_path).'/';
2386 2386
                                     }
2387
-                                    $new_abs_path = realpath($dir . $source);
2387
+                                    $new_abs_path = realpath($dir.$source);
2388 2388
                                     $in_files_list[] = self::get_resources_from_source_html($new_abs_path, true, TOOL_DOCUMENT, $recursivity + 1);
2389 2389
                                     if (count($in_files_list) > 0) {
2390 2390
                                         $files_list = array_merge($files_list, $in_files_list);
@@ -2443,24 +2443,24 @@  discard block
 block discarded – undo
2443 2443
             // then possible closing brackets if we were in the opening bracket case
2444 2444
             // OR something like @import()
2445 2445
             $res = preg_match_all(
2446
-                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))' .
2446
+                '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]*))'.
2447 2447
                 // '/(((([A-Za-z_:])([A-Za-z0-9_:\.-]|[^\x00-\x7F])*)' . -> seems to be taking too much
2448 2448
                 // '/(((([A-Za-z_:])([^\x00-\x7F])*)' . -> takes only last letter of parameter name
2449
-                '([ \n\t\r]+)?(' .
2449
+                '([ \n\t\r]+)?('.
2450 2450
                 // '(=([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+))' . -> doesn't restrict close enough to the url itself
2451
-                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))' .
2452
-                '|' .
2451
+                '(=([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+))'.
2452
+                '|'.
2453 2453
                 // '(\(([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)\))' . -> doesn't restrict close enough to the url itself
2454
-                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))' .
2455
-                '))' .
2456
-                '|' .
2454
+                '(\(([ \n\t\r]+)?("[^"\)]+"|\'[^\'\)]+\'|[^ \n\t\r\)]+)\))'.
2455
+                '))'.
2456
+                '|'.
2457 2457
                 // '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))?/', -> takes a lot (like 100's of thousands of empty possibilities)
2458 2458
                 '(@import([ \n\t\r]+)?("[^"]+"|\'[^\']+\'|[^ \n\t\r]+)))/',
2459 2459
                 $attrString,
2460 2460
                 $regs
2461 2461
             );
2462 2462
         } catch (Exception $e) {
2463
-            error_log('Caught exception: ' . $e->getMessage(), 0);
2463
+            error_log('Caught exception: '.$e->getMessage(), 0);
2464 2464
         }
2465 2465
         if ($res) {
2466 2466
             for ($i = 0; $i < count($regs[1]); $i++) {
@@ -2538,14 +2538,14 @@  discard block
 block discarded – undo
2538 2538
                 $orig_course_info_path = $origin_course_info_path;
2539 2539
             }
2540 2540
         } else {
2541
-            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'] . '/';
2541
+            $orig_course_path = api_get_path(SYS_COURSE_PATH).$orig_course_info['path'].'/';
2542 2542
             $orig_course_info_path = $orig_course_info['path'];
2543 2543
         }
2544 2544
 
2545 2545
         $destination_course_code = CourseManager::get_course_id_from_path($destination_course_directory);
2546 2546
         $destination_course_info = api_get_course_info($destination_course_code);
2547
-        $dest_course_path = api_get_path(SYS_COURSE_PATH) . $destination_course_directory . '/';
2548
-        $dest_course_path_rel = api_get_path(REL_COURSE_PATH) . $destination_course_directory . '/';
2547
+        $dest_course_path = api_get_path(SYS_COURSE_PATH).$destination_course_directory.'/';
2548
+        $dest_course_path_rel = api_get_path(REL_COURSE_PATH).$destination_course_directory.'/';
2549 2549
 
2550 2550
         $user_id = api_get_user_id();
2551 2551
 
@@ -2554,7 +2554,7 @@  discard block
 block discarded – undo
2554 2554
 
2555 2555
                 // Get information about source url
2556 2556
                 $real_orig_url = $source[0]; // url
2557
-                $scope_url = $source[1];   // scope (local, remote)
2557
+                $scope_url = $source[1]; // scope (local, remote)
2558 2558
                 $type_url = $source[2]; // type (rel, abs, url)
2559 2559
 
2560 2560
                 // Get path and query from origin url
@@ -2566,7 +2566,7 @@  discard block
 block discarded – undo
2566 2566
                 $dest_url_query = '';
2567 2567
 
2568 2568
                 if (!empty($real_orig_query)) {
2569
-                    $dest_url_query = '?' . $real_orig_query;
2569
+                    $dest_url_query = '?'.$real_orig_query;
2570 2570
                     if (strpos($dest_url_query, $origin_course_code) !== false) {
2571 2571
                         $dest_url_query = str_replace($origin_course_code, $destination_course_code, $dest_url_query);
2572 2572
                     }
@@ -2647,7 +2647,7 @@  discard block
 block discarded – undo
2647 2647
 
2648 2648
                                 //$destination_url = $url_course_path . $destination_course_directory . '/' . $document_file . $dest_url_query;
2649 2649
                                 // See BT#7780
2650
-                                $destination_url = $dest_course_path_rel . $document_file . $dest_url_query;
2650
+                                $destination_url = $dest_course_path_rel.$document_file.$dest_url_query;
2651 2651
 
2652 2652
                                 // If the course code doesn't exist in the path? what we do? Nothing! see BT#1985
2653 2653
                                 if (strpos($real_orig_path, $origin_course_code) === false) {
@@ -2682,14 +2682,14 @@  discard block
 block discarded – undo
2682 2682
     public function replace_urls_inside_content_html_when_moving_file($file_name, $original_path, $destiny_path)
2683 2683
     {
2684 2684
         if (substr($original_path, strlen($original_path) - 1, strlen($original_path)) == '/') {
2685
-            $original = $original_path . $file_name;
2685
+            $original = $original_path.$file_name;
2686 2686
         } else {
2687
-            $original = $original_path . '/' . $file_name;
2687
+            $original = $original_path.'/'.$file_name;
2688 2688
         }
2689 2689
         if (substr($destiny_path, strlen($destiny_path) - 1, strlen($destiny_path)) == '/') {
2690
-            $destination = $destiny_path . $file_name;
2690
+            $destination = $destiny_path.$file_name;
2691 2691
         } else {
2692
-            $destination = $destiny_path . '/' . $file_name;
2692
+            $destination = $destiny_path.'/'.$file_name;
2693 2693
         }
2694 2694
         $original_count = count(explode('/', $original));
2695 2695
         $destination_count = count(explode('/', $destination));
@@ -2703,8 +2703,8 @@  discard block
 block discarded – undo
2703 2703
             $mode = 'inside';
2704 2704
         }
2705 2705
         //We do not select the $original_path becayse the file was already moved
2706
-        $content_html = file_get_contents($destiny_path . '/' . $file_name);
2707
-        $destination_file = $destiny_path . '/' . $file_name;
2706
+        $content_html = file_get_contents($destiny_path.'/'.$file_name);
2707
+        $destination_file = $destiny_path.'/'.$file_name;
2708 2708
 
2709 2709
         $pre_original = strstr($original_path, 'document');
2710 2710
         $pre_destin = strstr($destiny_path, 'document');
@@ -2726,11 +2726,11 @@  discard block
 block discarded – undo
2726 2726
         }
2727 2727
 
2728 2728
         if ($pre_original != '') {
2729
-            $pre_original = '..' . $pre_original . '/';
2729
+            $pre_original = '..'.$pre_original.'/';
2730 2730
         }
2731 2731
 
2732 2732
         if ($pre_destin != '') {
2733
-            $pre_destin = '..' . $pre_destin . '/';
2733
+            $pre_destin = '..'.$pre_destin.'/';
2734 2734
         }
2735 2735
 
2736 2736
         $levels = explode('/', $pre_original);
@@ -2748,7 +2748,7 @@  discard block
 block discarded – undo
2748 2748
         //echo '$count_pre_destination_levels '. $count_pre_destination_levels;
2749 2749
         $pre_remove = '';
2750 2750
         for ($i = 1; $i <= $count_pre_destination_levels; $i++) {
2751
-            $pre_remove .='..\/';
2751
+            $pre_remove .= '..\/';
2752 2752
         }
2753 2753
 
2754 2754
         $orig_source_html = DocumentManager::get_resources_from_source_html($content_html);
@@ -2756,9 +2756,9 @@  discard block
 block discarded – undo
2756 2756
         foreach ($orig_source_html as $source) {
2757 2757
 
2758 2758
             // get information about source url
2759
-            $real_orig_url = $source[0];   // url
2760
-            $scope_url = $source[1];   // scope (local, remote)
2761
-            $type_url = $source[2];   // tyle (rel, abs, url)
2759
+            $real_orig_url = $source[0]; // url
2760
+            $scope_url = $source[1]; // scope (local, remote)
2761
+            $type_url = $source[2]; // tyle (rel, abs, url)
2762 2762
             // Get path and query from origin url
2763 2763
             $orig_parse_url = parse_url($real_orig_url);
2764 2764
             $real_orig_path = $orig_parse_url['path'];
@@ -2785,11 +2785,11 @@  discard block
 block discarded – undo
2785 2785
                         $real_orig_url_temp = '';
2786 2786
                         if ($mode == 'inside') {
2787 2787
                             $real_orig_url_temp = str_replace('../', '', $real_orig_url);
2788
-                            $destination_url = $link_to_add . $real_orig_url_temp;
2788
+                            $destination_url = $link_to_add.$real_orig_url_temp;
2789 2789
                         } else {
2790 2790
                             $real_orig_url_temp = $real_orig_url;
2791 2791
 
2792
-                            $destination_url = preg_replace("/" . $pre_remove . "/", '', $real_orig_url, 1);
2792
+                            $destination_url = preg_replace("/".$pre_remove."/", '', $real_orig_url, 1);
2793 2793
                         }
2794 2794
                         if ($real_orig_url == $destination_url) {
2795 2795
                             //echo 'continue2';
@@ -2815,7 +2815,7 @@  discard block
 block discarded – undo
2815 2815
     {
2816 2816
         $course_data = api_get_course_info($course_code);
2817 2817
         $document_data = self::get_document_data_by_id($document_id, $course_code);
2818
-        $file_path = api_get_path(SYS_COURSE_PATH) . $course_data['path'] . '/document' . $document_data['path'];
2818
+        $file_path = api_get_path(SYS_COURSE_PATH).$course_data['path'].'/document'.$document_data['path'];
2819 2819
         $pdf = new PDF('A4-L', 'L');
2820 2820
         $pdf->html_to_pdf($file_path, $document_data['title'], $course_code);
2821 2821
     }
@@ -2850,9 +2850,9 @@  discard block
 block discarded – undo
2850 2850
     ) {
2851 2851
         $course_info = api_get_course_info();
2852 2852
         $sessionId = api_get_session_id();
2853
-        $course_dir = $course_info['path'] . '/document';
2853
+        $course_dir = $course_info['path'].'/document';
2854 2854
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
2855
-        $base_work_dir = $sys_course_path . $course_dir;
2855
+        $base_work_dir = $sys_course_path.$course_dir;
2856 2856
 
2857 2857
         $group_properties = GroupManager::get_group_properties(api_get_group_id());
2858 2858
         $groupIid = isset($group_properties['iid']) ? $group_properties['iid'] : 0;
@@ -3040,7 +3040,7 @@  discard block
 block discarded – undo
3040 3040
         }
3041 3041
         if (isset($output)) {
3042 3042
             foreach ($output as & $line) {
3043
-                $content .= $line . "\n";
3043
+                $content .= $line."\n";
3044 3044
             }
3045 3045
             return $content;
3046 3046
         } else {
@@ -3072,13 +3072,13 @@  discard block
 block discarded – undo
3072 3072
         $group_condition = null;
3073 3073
         if (isset($group_id)) {
3074 3074
             $group_id = intval($group_id);
3075
-            $group_condition = " AND props.to_group_id='" . $group_id . "' ";
3075
+            $group_condition = " AND props.to_group_id='".$group_id."' ";
3076 3076
         }
3077 3077
 
3078 3078
         $session_condition = null;
3079 3079
         if (isset($session_id)) {
3080 3080
             $session_id = intval($session_id);
3081
-            $session_condition = " AND props.session_id='" . $session_id . "' ";
3081
+            $session_condition = " AND props.session_id='".$session_id."' ";
3082 3082
         }
3083 3083
 
3084 3084
         $sql = "SELECT SUM(size)
@@ -3088,7 +3088,7 @@  discard block
 block discarded – undo
3088 3088
                 WHERE
3089 3089
                     props.c_id 	= $course_id AND
3090 3090
                     docs.c_id 	= $course_id AND
3091
-                    props.tool 	= '" . TOOL_DOCUMENT . "' AND
3091
+                    props.tool 	= '".TOOL_DOCUMENT."' AND
3092 3092
                     props.visibility <> 2
3093 3093
                     $group_condition
3094 3094
                     $session_condition
@@ -3111,8 +3111,8 @@  discard block
 block discarded – undo
3111 3111
         $course_quota_m = round($course_quota / 1048576);
3112 3112
         $already_consumed_space_m = round($already_consumed_space / 1048576);
3113 3113
 
3114
-        $message = get_lang('MaximumAllowedQuota') . ' <strong>' . $course_quota_m . ' megabyte</strong>.<br />';
3115
-        $message .= get_lang('CourseCurrentlyUses') . ' <strong>' . $already_consumed_space_m . ' megabyte</strong>.<br />';
3114
+        $message = get_lang('MaximumAllowedQuota').' <strong>'.$course_quota_m.' megabyte</strong>.<br />';
3115
+        $message .= get_lang('CourseCurrentlyUses').' <strong>'.$already_consumed_space_m.' megabyte</strong>.<br />';
3116 3116
 
3117 3117
         $percentage = round(($already_consumed_space / $course_quota * 100), 1);
3118 3118
 
@@ -3120,33 +3120,33 @@  discard block
 block discarded – undo
3120 3120
 
3121 3121
         // Decide where to place percentage in graph
3122 3122
         if ($percentage >= 50) {
3123
-            $text_in_filled = '&nbsp;' . $other_percentage . '%';
3123
+            $text_in_filled = '&nbsp;'.$other_percentage.'%';
3124 3124
             $text_in_unfilled = '';
3125 3125
         } else {
3126
-            $text_in_unfilled = '&nbsp;' . $other_percentage . '%';
3126
+            $text_in_unfilled = '&nbsp;'.$other_percentage.'%';
3127 3127
             $text_in_filled = '';
3128 3128
         }
3129 3129
 
3130 3130
         // Decide the background colour of the graph
3131 3131
         if ($percentage < 65) {
3132
-            $colour = '#00BB00';        // Safe - green
3132
+            $colour = '#00BB00'; // Safe - green
3133 3133
         } elseif ($percentage < 90) {
3134
-            $colour = '#ffd400';        // Filling up - yelloworange
3134
+            $colour = '#ffd400'; // Filling up - yelloworange
3135 3135
         } else {
3136
-            $colour = '#DD0000';        // Full - red
3136
+            $colour = '#DD0000'; // Full - red
3137 3137
         }
3138 3138
 
3139 3139
         // This is used for the table width: a table of only 100 pixels looks too small
3140 3140
         $visual_percentage = 4 * $percentage;
3141 3141
         $visual_other_percentage = 4 * $other_percentage;
3142 3142
 
3143
-        $message .= get_lang('PercentageQuotaInUse') . ': <strong>' . $percentage . '%</strong>.<br />' .
3144
-            get_lang('PercentageQuotaFree') . ': <strong>' . $other_percentage . '%</strong>.<br />';
3143
+        $message .= get_lang('PercentageQuotaInUse').': <strong>'.$percentage.'%</strong>.<br />'.
3144
+            get_lang('PercentageQuotaFree').': <strong>'.$other_percentage.'%</strong>.<br />';
3145 3145
 
3146
-        $show_percentage = '&nbsp;' . $percentage . '%';
3147
-        $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">' .
3148
-            '<div style="width:' . $percentage . '%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>' .
3149
-            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">' . $show_percentage . '</span></div>';
3146
+        $show_percentage = '&nbsp;'.$percentage.'%';
3147
+        $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">'.
3148
+            '<div style="width:'.$percentage.'%; background-color: #bbb; border-right:3px groove #bbb; -moz-border-radius:5px;">&nbsp;</div>'.
3149
+            '<span style="margin-top: -15px; margin-left:-15px; position: absolute;font-weight:bold;">'.$show_percentage.'</span></div>';
3150 3150
         echo $message;
3151 3151
     }
3152 3152
 
@@ -3162,7 +3162,7 @@  discard block
 block discarded – undo
3162 3162
         $percentage = $already_consumed_space / $course_quota * 100;
3163 3163
         $percentage = round($percentage, 1);
3164 3164
         $message = get_lang('YouAreCurrentlyUsingXOfYourX');
3165
-        $message = sprintf($message, $already_consumed_space_m, $percentage . '%', $course_quota_m . ' ');
3165
+        $message = sprintf($message, $already_consumed_space_m, $percentage.'%', $course_quota_m.' ');
3166 3166
         echo Display::div($message, array('id' => 'document_quota'));
3167 3167
     }
3168 3168
 
@@ -3197,10 +3197,10 @@  discard block
 block discarded – undo
3197 3197
         $js_path = api_get_path(WEB_LIBRARY_JS_PATH);
3198 3198
 
3199 3199
         $js = '
3200
-            $("#jquery_jplayer_' . $params['count'] . '").jPlayer({
3200
+            $("#jquery_jplayer_' . $params['count'].'").jPlayer({
3201 3201
                 ready: function() {
3202 3202
                     $(this).jPlayer("setMedia", {
3203
-                        ' . $params['extension'] . ' : "' . $params['url'] . '"
3203
+                        ' . $params['extension'].' : "'.$params['url'].'"
3204 3204
                     });
3205 3205
                 },
3206 3206
                 play: function() { // To avoid both jPlayers playing together.
@@ -3208,12 +3208,12 @@  discard block
 block discarded – undo
3208 3208
                 },
3209 3209
                 //errorAlerts: true,
3210 3210
                 //warningAlerts: true,
3211
-                swfPath: "' . $js_path . 'jquery-jplayer/jplayer/",
3211
+                swfPath: "' . $js_path.'jquery-jplayer/jplayer/",
3212 3212
                 //supplied: "m4a, oga, mp3, ogg, wav",
3213
-                supplied: "' . $params['extension'] . '",
3213
+                supplied: "' . $params['extension'].'",
3214 3214
                 wmode: "window",
3215 3215
                 solution: "flash, html",  // Do not change this setting
3216
-                cssSelectorAncestor: "#jp_container_' . $params['count'] . '",
3216
+                cssSelectorAncestor: "#jp_container_' . $params['count'].'",
3217 3217
             });  	 ' . "\n\n";
3218 3218
 
3219 3219
         return $js;
@@ -3243,16 +3243,16 @@  discard block
 block discarded – undo
3243 3243
         }
3244 3244
 
3245 3245
         //Shows only the play button
3246
-        $html = '<div id="jquery_jplayer_' . $i . '" class="jp-jplayer"></div>
3247
-                <div id="jp_container_' . $i . '" class="jp-audio">
3246
+        $html = '<div id="jquery_jplayer_'.$i.'" class="jp-jplayer"></div>
3247
+                <div id="jp_container_' . $i.'" class="jp-audio">
3248 3248
                     <div class="jp-type-single">
3249 3249
                         <div class="jp-gui jp-interface">
3250 3250
                             <ul class="jp-controls">
3251 3251
                                 <li><a href="javascript:;" class="jp-play" tabindex="1">play</a></li>
3252 3252
                                 <li><a href="javascript:;" class="jp-pause" tabindex="1">pause</a></li>
3253
-                                ' . $extra_controls . '
3253
+                                ' . $extra_controls.'
3254 3254
                             </ul>
3255
-                            ' . $progress . '
3255
+                            ' . $progress.'
3256 3256
                         </div>
3257 3257
                     </div>
3258 3258
                 </div>';
@@ -3305,8 +3305,8 @@  discard block
 block discarded – undo
3305 3305
                     </div>
3306 3306
                 </div>
3307 3307
                 <div class="jp-no-solution">
3308
-                    <span>' . get_lang('UpdateRequire') . '</span>
3309
-                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile") . '
3308
+                    <span>' . get_lang('UpdateRequire').'</span>
3309
+                    ' . get_lang("ToPlayTheMediaYouWillNeedToUpdateYourBrowserToARecentVersionYouCanAlsoDownloadTheFile").'
3310 3310
                 </div>
3311 3311
             </div>
3312 3312
         </div>';
@@ -3387,7 +3387,7 @@  discard block
 block discarded – undo
3387 3387
 
3388 3388
         $add_folder_filter = null;
3389 3389
         if (!empty($filter_by_folder)) {
3390
-            $add_folder_filter = " AND docs.path LIKE '" . Database::escape_string($filter_by_folder) . "%'";
3390
+            $add_folder_filter = " AND docs.path LIKE '".Database::escape_string($filter_by_folder)."%'";
3391 3391
         }
3392 3392
 
3393 3393
         // If we are in LP display hidden folder https://support.chamilo.org/issues/6679
@@ -3422,7 +3422,7 @@  discard block
 block discarded – undo
3422 3422
 
3423 3423
                 $notLikeCondition = null;
3424 3424
                 for ($i = 1; $i <= $num; $i++) {
3425
-                    $repeat = str_repeat('/%', $i+1);
3425
+                    $repeat = str_repeat('/%', $i + 1);
3426 3426
                     $notLikeCondition .= " AND docs.path NOT LIKE '".Database::escape_string($cleanedPath.$repeat)."' ";
3427 3427
                 }
3428 3428
 
@@ -3447,7 +3447,7 @@  discard block
 block discarded – undo
3447 3447
                 ON (docs.id = last.ref AND docs.c_id = last.c_id)
3448 3448
                 WHERE
3449 3449
                     docs.path NOT LIKE '%_DELETED_%' AND
3450
-                    last.tool = '" . TOOL_DOCUMENT . "' $condition_session AND
3450
+                    last.tool = '".TOOL_DOCUMENT."' $condition_session AND
3451 3451
                     (last.visibility = '1' $lp_visibility_condition) AND
3452 3452
                     last.visibility <> 2 AND
3453 3453
                     docs.c_id = {$course_info['real_id']} AND
@@ -3477,7 +3477,7 @@  discard block
 block discarded – undo
3477 3477
                 Display::url(
3478 3478
                     Display::return_icon('close.png', get_lang('Close'), array(), ICON_SIZE_SMALL),
3479 3479
                     ' javascript:void(0);',
3480
-                    array('id' => 'close_div_' . $course_info['real_id'] . '_' . $session_id, 'class' => 'close_div')
3480
+                    array('id' => 'close_div_'.$course_info['real_id'].'_'.$session_id, 'class' => 'close_div')
3481 3481
                 ),
3482 3482
                 array('style' => 'position:absolute;right:10px')
3483 3483
             );
@@ -3584,7 +3584,7 @@  discard block
 block discarded – undo
3584 3584
                     $('#'+tempId).hide();
3585 3585
                 } else {
3586 3586
                     image.addClass('open');
3587
-                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif') . "');
3587
+                    image.attr('src', '" . Display::returnIconPath('nolines_minus.gif')."');
3588 3588
                     $('#'+id).hide();
3589 3589
                     $('#'+tempId).show();
3590 3590
 
@@ -3631,7 +3631,7 @@  discard block
 block discarded – undo
3631 3631
         $target,
3632 3632
         $overwrite_url
3633 3633
     ) {
3634
-        $img_sys_path = api_get_path(SYS_CODE_PATH) . 'img/';
3634
+        $img_sys_path = api_get_path(SYS_CODE_PATH).'img/';
3635 3635
         $web_code_path = api_get_path(WEB_CODE_PATH);
3636 3636
 
3637 3637
         $documentId = $resource['id'];
@@ -3646,7 +3646,7 @@  discard block
 block discarded – undo
3646 3646
         // It's a file.
3647 3647
         $icon = choose_image($path);
3648 3648
         $position = strrpos($icon, '.');
3649
-        $icon = substr($icon, 0, $position) . '_small.gif';
3649
+        $icon = substr($icon, 0, $position).'_small.gif';
3650 3650
         $my_file_title = $resource['title'];
3651 3651
         $visibility = $resource['visibility'];
3652 3652
 
@@ -3658,29 +3658,29 @@  discard block
 block discarded – undo
3658 3658
         // Show the "image name" not the filename of the image.
3659 3659
         if ($lp_id) {
3660 3660
             // LP URL
3661
-            $url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;file=' . $documentId . '&amp;lp_id=' . $lp_id;
3661
+            $url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq().'&amp;action=add_item&amp;type='.TOOL_DOCUMENT.'&amp;file='.$documentId.'&amp;lp_id='.$lp_id;
3662 3662
             if (!empty($overwrite_url)) {
3663
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId.'';
3663
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId.'';
3664 3664
             }
3665 3665
         } else {
3666 3666
             // Direct document URL
3667
-            $url = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3667
+            $url = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3668 3668
             if (!empty($overwrite_url)) {
3669
-                $url = $overwrite_url . '&cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&document_id=' . $documentId;
3669
+                $url = $overwrite_url.'&cidReq='.$course_info['code'].'&id_session='.$session_id.'&document_id='.$documentId;
3670 3670
             }
3671 3671
         }
3672 3672
 
3673 3673
         $img = Display::returnIconPath($icon);
3674
-        if (!file_exists($img_sys_path . $icon)) {
3674
+        if (!file_exists($img_sys_path.$icon)) {
3675 3675
             $img = Display::returnIconPath('default_small.gif');
3676 3676
         }
3677 3677
 
3678 3678
         $link = Display::url(
3679
-            '<img alt="" src="' . $img . '" title="" />&nbsp;' . $my_file_title, $url,
3679
+            '<img alt="" src="'.$img.'" title="" />&nbsp;'.$my_file_title, $url,
3680 3680
             array('target' => $target, 'class' => 'moved')
3681 3681
         );
3682 3682
 
3683
-        $directUrl = $web_code_path . 'document/document.php?cidReq=' . $course_info['code'] . '&id_session=' . $session_id . '&id=' . $documentId;
3683
+        $directUrl = $web_code_path.'document/document.php?cidReq='.$course_info['code'].'&id_session='.$session_id.'&id='.$documentId;
3684 3684
 
3685 3685
         $link .= Display::url(
3686 3686
             Display::return_icon('preview_view.png', get_lang('Preview')),
@@ -3695,12 +3695,12 @@  discard block
 block discarded – undo
3695 3695
         $return = null;
3696 3696
 
3697 3697
         if ($lp_id == false) {
3698
-            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3698
+            $return .= '<li class="doc_resource '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3699 3699
         } else {
3700
-            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="' . $documentId . '" data_type="document" title="' . $my_file_title . '" >';
3700
+            $return .= '<li class="doc_resource lp_resource_element '.$visibilityClass.' " data_id="'.$documentId.'" data_type="document" title="'.$my_file_title.'" >';
3701 3701
         }
3702 3702
 
3703
-        $return .= '<div class="item_data" style="margin-left:' . ($num  * 5 ) . 'px;margin-right:5px;">';
3703
+        $return .= '<div class="item_data" style="margin-left:'.($num * 5).'px;margin-right:5px;">';
3704 3704
 
3705 3705
         if ($add_move_button) {
3706 3706
             $return .= '<a class="moved" href="#">';
@@ -3765,7 +3765,7 @@  discard block
 block discarded – undo
3765 3765
             if (isset($resource['visible']) && $resource['visible'] == 0) {
3766 3766
                 $folder_class_hidden = "doc_folder_hidden"; // in base.css
3767 3767
             }
3768
-            $onclick = 'onclick="javascript: testResources(\'res_' . $resource['id'] . '\',\'img_' . $resource['id'] . '\')"';
3768
+            $onclick = 'onclick="javascript: testResources(\'res_'.$resource['id'].'\',\'img_'.$resource['id'].'\')"';
3769 3769
         }
3770 3770
         $return = null;
3771 3771
 
@@ -3773,22 +3773,22 @@  discard block
 block discarded – undo
3773 3773
             $return = '<ul class="lp_resource">';
3774 3774
         }
3775 3775
 
3776
-        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_' . $resource['id'] . '"  style="margin-left:' . ($num * 18) . 'px; ">';
3776
+        $return .= '<li class="doc_folder '.$folder_class_hidden.'" id="doc_id_'.$resource['id'].'"  style="margin-left:'.($num * 18).'px; ">';
3777 3777
 
3778 3778
         $image = Display::returnIconPath('nolines_plus.gif');
3779 3779
         if (empty($path)) {
3780 3780
             $image = Display::returnIconPath('nolines_minus.gif');
3781 3781
         }
3782
-        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'] . '" '.$onclick.'>';
3782
+        $return .= '<img style="cursor: pointer;" src="'.$image.'" align="absmiddle" id="img_'.$resource['id'].'" '.$onclick.'>';
3783 3783
         $return .= Display::return_icon('lp_folder.gif').'&nbsp;';
3784 3784
         $return .= '<span '.$onclick.' style="cursor: pointer;" >'.$title.'</span>';
3785 3785
         $return .= '</li>';
3786 3786
 
3787 3787
         if (empty($path)) {
3788 3788
             if ($folderId == false) {
3789
-                $return .= '<div id="res_' . $resource['id'] . '" >';
3789
+                $return .= '<div id="res_'.$resource['id'].'" >';
3790 3790
             } else {
3791
-                $return .= '<div id="res_' . $resource['id'] . '" style="display: none;" >';
3791
+                $return .= '<div id="res_'.$resource['id'].'" style="display: none;" >';
3792 3792
             }
3793 3793
         }
3794 3794
 
@@ -3950,9 +3950,9 @@  discard block
 block discarded – undo
3950 3950
             $session_id = api_get_session_id();
3951 3951
         }
3952 3952
         $course_info = api_get_course_info($course_code);
3953
-        $course_dir = $course_info['path'] . '/document';
3953
+        $course_dir = $course_info['path'].'/document';
3954 3954
         $sys_course_path = api_get_path(SYS_COURSE_PATH);
3955
-        $base_work_dir = $sys_course_path . $course_dir;
3955
+        $base_work_dir = $sys_course_path.$course_dir;
3956 3956
 
3957 3957
         $course_id = $course_info['real_id'];
3958 3958
         $table_document = Database::get_course_table(TABLE_DOCUMENT);
@@ -3961,7 +3961,7 @@  discard block
 block discarded – undo
3961 3961
         $result = Database::query($qry);
3962 3962
         if (Database::num_rows($result) == 1) {
3963 3963
             $row = Database::fetch_array($result);
3964
-            $doc_path = api_get_path(SYS_COURSE_PATH) . $course_dir . $row['path'];
3964
+            $doc_path = api_get_path(SYS_COURSE_PATH).$course_dir.$row['path'];
3965 3965
             //TODO: mime_content_type is deprecated, fileinfo php extension is enabled by default as of PHP 5.3.0
3966 3966
             // now versions of PHP on Debian testing(5.2.6-5) and Ubuntu(5.2.6-2ubuntu) are lower, so wait for a while
3967 3967
             $doc_mime = mime_content_type($doc_path);
@@ -3992,8 +3992,8 @@  discard block
 block discarded – undo
3992 3992
                 $file_content = self::get_text_content($doc_path, $doc_mime);
3993 3993
                 $course_code = Database::escape_string($course_code);
3994 3994
 
3995
-                require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php';
3996
-                require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
3995
+                require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php';
3996
+                require_once api_get_path(LIBRARY_PATH).'search/IndexableChunk.class.php';
3997 3997
 
3998 3998
                 $ic_slide = new IndexableChunk();
3999 3999
                 $ic_slide->addValue('title', $file_title);
@@ -4010,7 +4010,7 @@  discard block
 block discarded – undo
4010 4010
                 $di = new ChamiloIndexer();
4011 4011
                 $return = $di->connectDb(null, null, $lang);
4012 4012
 
4013
-                require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
4013
+                require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php';
4014 4014
                 $specific_fields = get_specific_field_list();
4015 4015
 
4016 4016
                 // process different depending on what to do if file exists
@@ -4047,7 +4047,7 @@  discard block
 block discarded – undo
4047 4047
                             } else { //if the specific field is not defined, force an empty one
4048 4048
                                 $sterms = '';
4049 4049
                             }
4050
-                            $all_specific_terms .= ' ' . $sterms;
4050
+                            $all_specific_terms .= ' '.$sterms;
4051 4051
                             $sterms = explode(',', $sterms);
4052 4052
                             foreach ($sterms as $sterm) {
4053 4053
                                 $sterm = trim($sterm);
@@ -4061,7 +4061,7 @@  discard block
 block discarded – undo
4061 4061
                             }
4062 4062
                         }
4063 4063
                         // Add terms also to content to make terms findable by probabilistic search
4064
-                        $file_content = $all_specific_terms . ' ' . $file_content;
4064
+                        $file_content = $all_specific_terms.' '.$file_content;
4065 4065
 
4066 4066
                         if (!$simulation) {
4067 4067
                             $ic_slide->addValue('content', $file_content);
@@ -4087,7 +4087,7 @@  discard block
 block discarded – undo
4087 4087
                         } else { //if the specific field is not defined, force an empty one
4088 4088
                             $sterms = '';
4089 4089
                         }
4090
-                        $all_specific_terms .= ' ' . $sterms;
4090
+                        $all_specific_terms .= ' '.$sterms;
4091 4091
                         if (!empty($sterms)) {
4092 4092
                             $sterms = explode(',', $sterms);
4093 4093
                             foreach ($sterms as $sterm) {
@@ -4099,7 +4099,7 @@  discard block
 block discarded – undo
4099 4099
                         }
4100 4100
                     }
4101 4101
                     // Add terms also to content to make terms findable by probabilistic search
4102
-                    $file_content = $all_specific_terms . ' ' . $file_content;
4102
+                    $file_content = $all_specific_terms.' '.$file_content;
4103 4103
                     if (!$simulation) {
4104 4104
                         $ic_slide->addValue('content', $file_content);
4105 4105
                         $di->addChunk($ic_slide);
@@ -4382,7 +4382,7 @@  discard block
 block discarded – undo
4382 4382
         $defaultVisibility = 'visible';
4383 4383
 
4384 4384
         if (isset($settings['documents'])) {
4385
-            $portalDefaultVisibility =  'invisible';
4385
+            $portalDefaultVisibility = 'invisible';
4386 4386
             if ($settings['documents'] == 'true') {
4387 4387
                 $portalDefaultVisibility = 'visible';
4388 4388
             }
@@ -4622,7 +4622,7 @@  discard block
 block discarded – undo
4622 4622
         //make htaccess with allow from all, and file index.html into temp/audio
4623 4623
         $htaccess = api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess';
4624 4624
         if (!file_exists($htaccess)) {
4625
-            $htaccess_content="order deny,allow\r\nallow from all\r\nOptions -Indexes";
4625
+            $htaccess_content = "order deny,allow\r\nallow from all\r\nOptions -Indexes";
4626 4626
             $fp = @ fopen(api_get_path(SYS_ARCHIVE_PATH).'temp/audio/.htaccess', 'w');
4627 4627
             if ($fp) {
4628 4628
                 fwrite($fp, $htaccess_content);
@@ -4631,9 +4631,9 @@  discard block
 block discarded – undo
4631 4631
         }
4632 4632
 
4633 4633
         //encript temp name file
4634
-        $name_crip = sha1(uniqid());//encript
4635
-        $findext= explode(".", $file);
4636
-        $extension = $findext[count($findext)-1];
4634
+        $name_crip = sha1(uniqid()); //encript
4635
+        $findext = explode(".", $file);
4636
+        $extension = $findext[count($findext) - 1];
4637 4637
         $file_crip = $name_crip.'.'.$extension;
4638 4638
 
4639 4639
         //copy file to temp/audio directory
@@ -4737,7 +4737,7 @@  discard block
 block discarded – undo
4737 4737
         $comment = null;
4738 4738
 
4739 4739
         $fileName = api_replace_dangerous_char($title);
4740
-        $filePath = api_get_path(SYS_COURSE_PATH) . "{$courseData['path']}/document{$dir}";
4740
+        $filePath = api_get_path(SYS_COURSE_PATH)."{$courseData['path']}/document{$dir}";
4741 4741
         $fileFullPath = "{$filePath}/{$fileName}.html";
4742 4742
         $fileSize = 0;
4743 4743
         $fileType = 'file';
@@ -4789,7 +4789,7 @@  discard block
 block discarded – undo
4789 4789
             $fileSize,
4790 4790
             $title,
4791 4791
             $comment,
4792
-            0,//$readonly = 0,
4792
+            0, //$readonly = 0,
4793 4793
             true, //$save_visibility = true,
4794 4794
             null, //$group_id = null,
4795 4795
             $sessionId
@@ -5075,8 +5075,8 @@  discard block
 block discarded – undo
5075 5075
             $sessionId,
5076 5076
             $groupId
5077 5077
         )) {
5078
-            $uniqueName = self::addSuffixToFileName($name, '_' . $counter);
5079
-            $filePath = $path . $uniqueName;
5078
+            $uniqueName = self::addSuffixToFileName($name, '_'.$counter);
5079
+            $filePath = $path.$uniqueName;
5080 5080
             $counter++;
5081 5081
         }
5082 5082
 
@@ -5117,7 +5117,7 @@  discard block
 block discarded – undo
5117 5117
                     WHERE 
5118 5118
                         filetype = 'folder' AND 
5119 5119
                         c_id = $course_id AND 
5120
-                        path IN ('" . $folder_sql . "')";
5120
+                        path IN ('".$folder_sql."')";
5121 5121
             $res = Database::query($sql);
5122 5122
             $folder_titles = array();
5123 5123
             while ($obj = Database::fetch_object($res)) {
@@ -5154,9 +5154,9 @@  discard block
 block discarded – undo
5154 5154
                     $folder_titles[$folder] = cut($folder_titles[$folder], 80);
5155 5155
                     $counter = count($path_parts) - 2;
5156 5156
                     if ($counter > 0) {
5157
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter) . ' &mdash; ' . $folder_titles[$folder];
5157
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', $counter).' &mdash; '.$folder_titles[$folder];
5158 5158
                     } else {
5159
-                        $label = ' &mdash; ' . $folder_titles[$folder];
5159
+                        $label = ' &mdash; '.$folder_titles[$folder];
5160 5160
                     }
5161 5161
                     $parent_select->addOption($label, $folder_id);
5162 5162
                     if ($selected != '') {
@@ -5174,7 +5174,7 @@  discard block
 block discarded – undo
5174 5174
                     } else {
5175 5175
                         $path_parts = explode('/', str_replace($group_dir, '', $folder));
5176 5176
                         $label = cut($label, 80);
5177
-                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2) . ' &mdash; ' . $label;
5177
+                        $label = str_repeat('&nbsp;&nbsp;&nbsp;', count($path_parts) - 2).' &mdash; '.$label;
5178 5178
                     }
5179 5179
                     $parent_select->addOption($label, $folder_id);
5180 5180
                     if ($selected != '') {
@@ -5207,7 +5207,7 @@  discard block
 block discarded – undo
5207 5207
     ) {
5208 5208
         global $dbl_click_id;
5209 5209
         $course_info = api_get_course_info();
5210
-        $www = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/document';
5210
+        $www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
5211 5211
         $webOdflist = DocumentManager::get_web_odf_extension_list();
5212 5212
 
5213 5213
         // Get the title or the basename depending on what we're using
@@ -5231,11 +5231,11 @@  discard block
 block discarded – undo
5231 5231
 
5232 5232
         if (!$show_as_icon) {
5233 5233
             // Build download link (icon)
5234
-            $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'];
5234
+            $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'];
5235 5235
             // Folder download or file download?
5236 5236
             $forcedownload_icon = ($filetype == 'folder') ? 'save_pack.png' : 'save.png';
5237 5237
             // Prevent multiple clicks on zipped folder download
5238
-            $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; }\"" : '';
5238
+            $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; }\"" : '';
5239 5239
         }
5240 5240
 
5241 5241
         $target = '_self';
@@ -5251,17 +5251,17 @@  discard block
 block discarded – undo
5251 5251
 
5252 5252
             if ($is_browser_viewable_file) {
5253 5253
                 if ($ext == 'pdf' || in_array($ext, $webOdflist)) {
5254
-                    $url = api_get_self() . '?' . api_get_cidreq() . '&amp;action=download&amp;id=' . $document_data['id'];
5254
+                    $url = api_get_self().'?'.api_get_cidreq().'&amp;action=download&amp;id='.$document_data['id'];
5255 5255
                 } else {
5256
-                    $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5256
+                    $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5257 5257
                 }
5258 5258
             } else {
5259 5259
                 // url-encode for problematic characters (we may not call them dangerous characters...)
5260
-                $path = str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq();
5261
-                $url = $www . $path;
5260
+                $path = str_replace('%2F', '/', $url_path).'?'.api_get_cidreq();
5261
+                $url = $www.$path;
5262 5262
             }
5263 5263
         } else {
5264
-            $url = api_get_self() . '?' . api_get_cidreq() . '&id=' . $document_data['id'];
5264
+            $url = api_get_self().'?'.api_get_cidreq().'&id='.$document_data['id'];
5265 5265
         }
5266 5266
 
5267 5267
         // The little download icon
@@ -5271,10 +5271,10 @@  discard block
 block discarded – undo
5271 5271
         if ($path == '/shared_folder') {
5272 5272
             $tooltip_title_alt = get_lang('UserFolders');
5273 5273
         } elseif (strstr($path, 'shared_folder_session_')) {
5274
-            $tooltip_title_alt = get_lang('UserFolders') . ' (' . api_get_session_name(api_get_session_id()) . ')';
5274
+            $tooltip_title_alt = get_lang('UserFolders').' ('.api_get_session_name(api_get_session_id()).')';
5275 5275
         } elseif (strstr($tooltip_title, 'sf_user_')) {
5276 5276
             $userinfo = api_get_user_info(substr($tooltip_title, 8));
5277
-            $tooltip_title_alt = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5277
+            $tooltip_title_alt = get_lang('UserFolder').' '.$userinfo['complete_name'];
5278 5278
         } elseif ($path == '/chat_files') {
5279 5279
             $tooltip_title_alt = get_lang('ChatFiles');
5280 5280
         } elseif ($path == '/learning_path') {
@@ -5306,35 +5306,35 @@  discard block
 block discarded – undo
5306 5306
                 ) {
5307 5307
                     //filter: when I am into a shared folder, I can only show "my shared folder" for donwload
5308 5308
                     if (DocumentManager::is_shared_folder($curdirpath, $current_session_id)) {
5309
-                        if (preg_match('/shared_folder\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5310
-                            preg_match('/shared_folder_session_' . $current_session_id . '\/sf_user_' . api_get_user_id() . '$/', urldecode($forcedownload_link)) ||
5309
+                        if (preg_match('/shared_folder\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5310
+                            preg_match('/shared_folder_session_'.$current_session_id.'\/sf_user_'.api_get_user_id().'$/', urldecode($forcedownload_link)) ||
5311 5311
                             api_is_allowed_to_edit() || api_is_platform_admin()
5312 5312
                         ) {
5313
-                            $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5314
-                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5313
+                            $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5314
+                                Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5315 5315
                         }
5316 5316
                     } elseif (!preg_match('/shared_folder/', urldecode($forcedownload_link)) ||
5317 5317
                         api_is_allowed_to_edit() ||
5318 5318
                         api_is_platform_admin()
5319 5319
                     ) {
5320
-                        $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5321
-                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5320
+                        $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5321
+                            Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5322 5322
                     }
5323 5323
                 }
5324 5324
             } else {
5325
-                $force_download_html = ($size == 0) ? '' : '<a href="' . $forcedownload_link . '" style="float:right"' . $prevent_multiple_click . ' download="' . $document_data['basename'] . '">' .
5326
-                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL) . '</a>';
5325
+                $force_download_html = ($size == 0) ? '' : '<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.' download="'.$document_data['basename'].'">'.
5326
+                    Display::return_icon($forcedownload_icon, get_lang('Download'), array(), ICON_SIZE_SMALL).'</a>';
5327 5327
             }
5328 5328
 
5329 5329
             // Copy files to user's myfiles
5330 5330
             if (api_get_setting('allow_my_files') === 'true' &&
5331 5331
                 api_get_setting('users_copy_files') === 'true'
5332 5332
             ) {
5333
-                $copy_myfiles_link = ($filetype == 'file') ? api_get_self() . '?' . api_get_cidreq() . '&action=copytomyfiles&id=' . $document_data['id'] : api_get_self() . '?' . api_get_cidreq();
5333
+                $copy_myfiles_link = ($filetype == 'file') ? api_get_self().'?'.api_get_cidreq().'&action=copytomyfiles&id='.$document_data['id'] : api_get_self().'?'.api_get_cidreq();
5334 5334
                 if ($filetype == 'file') {
5335 5335
 
5336
-                    $copy_to_myfiles = '<a href="' . $copy_myfiles_link . '" style="float:right"' . $prevent_multiple_click . '>' .
5337
-                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5336
+                    $copy_to_myfiles = '<a href="'.$copy_myfiles_link.'" style="float:right"'.$prevent_multiple_click.'>'.
5337
+                        Display::return_icon('briefcase.png', get_lang('CopyToMyFiles'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5338 5338
 
5339 5339
                     if (api_get_setting('allow_my_files') === 'false') {
5340 5340
                         $copy_to_myfiles = '';
@@ -5353,13 +5353,13 @@  discard block
 block discarded – undo
5353 5353
                 $filetype == 'file' &&
5354 5354
                 in_array($extension, array('html', 'htm'))
5355 5355
             ) {
5356
-                $pdf_icon = ' <a style="float:right".' . $prevent_multiple_click . ' href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $document_data['id'] . '">' .
5357
-                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a> ';
5356
+                $pdf_icon = ' <a style="float:right".'.$prevent_multiple_click.' href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$document_data['id'].'">'.
5357
+                    Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a> ';
5358 5358
             }
5359 5359
 
5360 5360
             if ($is_browser_viewable_file) {
5361
-                $open_in_new_window_link = '<a href="' . $www . str_replace('%2F', '/', $url_path) . '?' . api_get_cidreq() . '" style="float:right"' . $prevent_multiple_click . ' target="_blank">' .
5362
-                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL) . '&nbsp;&nbsp;</a>';
5361
+                $open_in_new_window_link = '<a href="'.$www.str_replace('%2F', '/', $url_path).'?'.api_get_cidreq().'" style="float:right"'.$prevent_multiple_click.' target="_blank">'.
5362
+                    Display::return_icon('open_in_new_window.png', get_lang('OpenInANewWindow'), array(), ICON_SIZE_SMALL).'&nbsp;&nbsp;</a>';
5363 5363
             }
5364 5364
 
5365 5365
             if ($filetype == 'file') {
@@ -5368,9 +5368,9 @@  discard block
 block discarded – undo
5368 5368
                     (preg_match('/wav$/i', urldecode($checkExtension))) ||
5369 5369
                     preg_match('/ogg$/i', urldecode($checkExtension))
5370 5370
                 ) {
5371
-                    return '<span style="float:left" ' . $visibility_class . '>' .
5372
-                    $title .
5373
-                    '</span>' . $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5371
+                    return '<span style="float:left" '.$visibility_class.'>'.
5372
+                    $title.
5373
+                    '</span>'.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5374 5374
                 } elseif (
5375 5375
 
5376 5376
                     // Show preview
@@ -5383,7 +5383,7 @@  discard block
 block discarded – undo
5383 5383
                     preg_match('/svg$/i', urldecode($checkExtension))
5384 5384
                 ) {
5385 5385
                     // Simpler version of showinframesmin.php with no headers
5386
-                    $url = 'show_content.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5386
+                    $url = 'show_content.php?'.api_get_cidreq().'&id='.$document_data['id'];
5387 5387
                     $class = 'ajax';
5388 5388
                     if ($visibility == false) {
5389 5389
                         $class = "ajax text-muted";
@@ -5398,34 +5398,34 @@  discard block
 block discarded – undo
5398 5398
                             'style' => 'float:left;'
5399 5399
                         ]
5400 5400
                     )
5401
-                    . $force_download_html . $send_to . $copy_to_myfiles
5402
-                    . $open_in_new_window_link . $pdf_icon;
5401
+                    . $force_download_html.$send_to.$copy_to_myfiles
5402
+                    . $open_in_new_window_link.$pdf_icon;
5403 5403
                 } else {
5404 5404
                     // For a "PDF Download" of the file.
5405 5405
                     $pdfPreview = null;
5406 5406
                     if ($ext != 'pdf' && !in_array($ext, $webOdflist)) {
5407
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5407
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5408 5408
                     } else {
5409 5409
                         $pdfPreview = Display::url(
5410 5410
                             Display::return_icon('preview.gif', get_lang('Preview')),
5411
-                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'],
5411
+                            api_get_path(WEB_CODE_PATH).'document/showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'],
5412 5412
                             array('style' => 'float:right')
5413 5413
                         );
5414 5414
                     }
5415 5415
                     // No plugin just the old and good showinframes.php page
5416
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" style="float:left" ' . $visibility_class . ' >' . $title . '</a>' .
5417
-                    $pdfPreview.$force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5416
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" style="float:left" '.$visibility_class.' >'.$title.'</a>'.
5417
+                    $pdfPreview.$force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5418 5418
                 }
5419 5419
             } else {
5420
-                return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' . $title . '</a>' .
5421
-                $force_download_html . $send_to . $copy_to_myfiles . $open_in_new_window_link . $pdf_icon;
5420
+                return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.$title.'</a>'.
5421
+                $force_download_html.$send_to.$copy_to_myfiles.$open_in_new_window_link.$pdf_icon;
5422 5422
             }
5423 5423
             // end copy files to users myfiles
5424 5424
         } else {
5425 5425
             // Icon column
5426 5426
             if (preg_match('/shared_folder/', urldecode($checkExtension)) &&
5427 5427
                 preg_match('/shared_folder$/', urldecode($checkExtension)) == false &&
5428
-                preg_match('/shared_folder_session_' . $current_session_id . '$/', urldecode($url)) == false
5428
+                preg_match('/shared_folder_session_'.$current_session_id.'$/', urldecode($url)) == false
5429 5429
             ) {
5430 5430
                 if ($filetype == 'file') {
5431 5431
                     //Sound preview with jplayer
@@ -5445,19 +5445,19 @@  discard block
 block discarded – undo
5445 5445
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5446 5446
                         preg_match('/svg$/i', urldecode($checkExtension))
5447 5447
                     ) {
5448
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id'];
5449
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5450
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5451
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5448
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id'];
5449
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5450
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5451
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5452 5452
                     } else {
5453
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5454
-                        DocumentManager::build_document_icon_tag($filetype, $path) .
5455
-                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5453
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5454
+                        DocumentManager::build_document_icon_tag($filetype, $path).
5455
+                        Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5456 5456
                     }
5457 5457
                 } else {
5458
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5459
-                    DocumentManager::build_document_icon_tag($filetype, $path) .
5460
-                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()) . '</a>';
5458
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5459
+                    DocumentManager::build_document_icon_tag($filetype, $path).
5460
+                    Display::return_icon('shared.png', get_lang('ResourceShared'), array()).'</a>';
5461 5461
                 }
5462 5462
             } else {
5463 5463
                 if ($filetype == 'file') {
@@ -5480,16 +5480,16 @@  discard block
 block discarded – undo
5480 5480
                         preg_match('/bmp$/i', urldecode($checkExtension)) ||
5481 5481
                         preg_match('/svg$/i', urldecode($checkExtension))
5482 5482
                     ) {
5483
-                        $url = 'showinframes.php?' . api_get_cidreq() . '&id=' . $document_data['id']; //without preview
5484
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5485
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5483
+                        $url = 'showinframes.php?'.api_get_cidreq().'&id='.$document_data['id']; //without preview
5484
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5485
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5486 5486
                     } else {
5487
-                        return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" ' . $visibility_class . ' style="float:left">' .
5488
-                        DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5487
+                        return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" '.$visibility_class.' style="float:left">'.
5488
+                        DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5489 5489
                     }
5490 5490
                 } else {
5491
-                    return '<a href="' . $url . '" title="' . $tooltip_title_alt . '" target="' . $target . '"' . $visibility_class . ' style="float:left">' .
5492
-                    DocumentManager::build_document_icon_tag($filetype, $path) . '</a>';
5491
+                    return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.
5492
+                    DocumentManager::build_document_icon_tag($filetype, $path).'</a>';
5493 5493
                 }
5494 5494
             }
5495 5495
         }
@@ -5524,13 +5524,13 @@  discard block
 block discarded – undo
5524 5524
                 $userinfo = api_get_user_info(substr($basename, 8));
5525 5525
                 $icon = $userinfo['avatar_small'];
5526 5526
 
5527
-                $basename = get_lang('UserFolder') . ' ' . $userinfo['complete_name'];
5527
+                $basename = get_lang('UserFolder').' '.$userinfo['complete_name'];
5528 5528
                 $user_image = true;
5529 5529
             } elseif (strstr($path, 'shared_folder_session_')) {
5530 5530
                 if ($is_allowed_to_edit) {
5531
-                    $basename = '***(' . api_get_session_name($current_session_id) . ')*** ' . get_lang('HelpUsersFolder');
5531
+                    $basename = '***('.api_get_session_name($current_session_id).')*** '.get_lang('HelpUsersFolder');
5532 5532
                 } else {
5533
-                    $basename = get_lang('UserFolders') . ' (' . api_get_session_name($current_session_id) . ')';
5533
+                    $basename = get_lang('UserFolders').' ('.api_get_session_name($current_session_id).')';
5534 5534
                 }
5535 5535
                 $icon = 'folder_users.png';
5536 5536
             } else {
@@ -5639,16 +5639,16 @@  discard block
 block discarded – undo
5639 5639
         // Build URL-parameters for table-sorting
5640 5640
         $sort_params = array();
5641 5641
         if (isset($_GET['column'])) {
5642
-            $sort_params[] = 'column=' . Security::remove_XSS($_GET['column']);
5642
+            $sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
5643 5643
         }
5644 5644
         if (isset($_GET['page_nr'])) {
5645
-            $sort_params[] = 'page_nr=' . Security::remove_XSS($_GET['page_nr']);
5645
+            $sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
5646 5646
         }
5647 5647
         if (isset($_GET['per_page'])) {
5648
-            $sort_params[] = 'per_page=' . Security::remove_XSS($_GET['per_page']);
5648
+            $sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
5649 5649
         }
5650 5650
         if (isset($_GET['direction'])) {
5651
-            $sort_params[] = 'direction=' . Security::remove_XSS($_GET['direction']);
5651
+            $sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
5652 5652
         }
5653 5653
         $sort_params = implode('&amp;', $sort_params);
5654 5654
         $visibility_icon = ($visibility == 0) ? 'invisible' : 'visible';
@@ -5661,89 +5661,89 @@  discard block
 block discarded – undo
5661 5661
         if ($is_read_only /* or ($session_id!=api_get_session_id()) */) {
5662 5662
             if (api_is_course_admin() || api_is_platform_admin()) {
5663 5663
                 if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5664
-                    $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5665
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5666
-                } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5667
-                    $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5668
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5664
+                    $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5665
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5666
+                } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5667
+                    $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5668
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5669 5669
                 } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5670
-                    $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id . '">' .
5671
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5670
+                    $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5671
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5672 5672
                 } else {
5673
-                    $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&id=' . $document_id. '">' .
5674
-                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5673
+                    $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5674
+                        Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5675 5675
                 }
5676 5676
             } else {
5677 5677
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5678 5678
             }
5679
-            $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5679
+            $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL);
5680 5680
             if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5681
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5681
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), '', ICON_SIZE_SMALL);
5682 5682
             }
5683
-            $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5683
+            $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
5684 5684
         } else {
5685 5685
             //Edit button
5686 5686
             if (in_array($path, DocumentManager::get_system_folders())) {
5687 5687
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
5688
-            } elseif ($is_certificate_mode ) {
5688
+            } elseif ($is_certificate_mode) {
5689 5689
                 // gradebook category doesn't seem to be taken into account
5690
-                $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>';
5690
+                $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>';
5691 5691
             } else {
5692 5692
                 if (api_get_session_id()) {
5693 5693
                     if ($document_data['session_id'] == api_get_session_id()) {
5694 5694
                         if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5695
-                            $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5696
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5697
-                        } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5698
-                            $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5699
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5695
+                            $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5696
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5697
+                        } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5698
+                            $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5699
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5700 5700
                         } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5701
-                            $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5702
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5701
+                            $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5702
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5703 5703
                         } else {
5704
-                            $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5705
-                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5704
+                            $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5705
+                                Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5706 5706
                         }
5707 5707
                     } else {
5708
-                        $modify_icons .= '&nbsp;' . Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
5708
+                        $modify_icons .= '&nbsp;'.Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
5709 5709
                     }
5710 5710
                 } else {
5711 5711
                     if ($extension == 'svg' && api_browser_support('svg') && api_get_setting('enabled_support_svg') == 'true') {
5712
-                        $modify_icons = '<a href="edit_draw.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5713
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5714
-                    } elseif (in_array($extension, $web_odf_extension_list)  && api_get_setting('enabled_support_odf') === true) {
5715
-                        $modify_icons = '<a href="edit_odf.php?' . api_get_cidreq() . '&id=' . $document_id  . '">' .
5716
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5712
+                        $modify_icons = '<a href="edit_draw.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5713
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5714
+                    } elseif (in_array($extension, $web_odf_extension_list) && api_get_setting('enabled_support_odf') === true) {
5715
+                        $modify_icons = '<a href="edit_odf.php?'.api_get_cidreq().'&id='.$document_id.'">'.
5716
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5717 5717
                     } elseif ($extension == 'png' || $extension == 'jpg' || $extension == 'jpeg' || $extension == 'bmp' || $extension == 'gif' || $extension == 'pxd' && api_get_setting('enabled_support_pixlr') == 'true') {
5718
-                        $modify_icons = '<a href="edit_paint.php?' . api_get_cidreq() . '&amp;id=' . $document_id . '">' .
5719
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5718
+                        $modify_icons = '<a href="edit_paint.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5719
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5720 5720
                     } else {
5721
-                        $modify_icons = '<a href="edit_document.php?' . api_get_cidreq() . '&amp;id=' . $document_id  . '">' .
5722
-                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
5721
+                        $modify_icons = '<a href="edit_document.php?'.api_get_cidreq().'&amp;id='.$document_id.'">'.
5722
+                            Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
5723 5723
                     }
5724 5724
                 }
5725 5725
             }
5726 5726
 
5727 5727
             // Move button.
5728 5728
             if ($is_certificate_mode || in_array($path, DocumentManager::get_system_folders())) {
5729
-                $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5729
+                $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5730 5730
             } else {
5731 5731
                 if (api_get_session_id()) {
5732 5732
                     if ($document_data['session_id'] == api_get_session_id()) {
5733
-                        $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5734
-                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5733
+                        $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5734
+                            Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5735 5735
                     } else {
5736
-                        $modify_icons .= '&nbsp;' . Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5736
+                        $modify_icons .= '&nbsp;'.Display::return_icon('move_na.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5737 5737
                     }
5738 5738
                 } else {
5739
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;move=' . $document_id .  '">' .
5740
-                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL) . '</a>';
5739
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;move='.$document_id.'">'.
5740
+                        Display::return_icon('move.png', get_lang('Move'), array(), ICON_SIZE_SMALL).'</a>';
5741 5741
                 }
5742 5742
             }
5743 5743
 
5744 5744
             //Visibility button
5745 5745
             if ($is_certificate_mode) {
5746
-                $modify_icons .= '&nbsp;' . Display::return_icon($visibility_icon . '.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL) . '</a>';
5746
+                $modify_icons .= '&nbsp;'.Display::return_icon($visibility_icon.'.png', get_lang('VisibilityCannotBeChanged'), array(), ICON_SIZE_SMALL).'</a>';
5747 5747
             } else {
5748 5748
                 if (api_is_allowed_to_edit() || api_is_platform_admin()) {
5749 5749
                     if ($visibility_icon == 'invisible') {
@@ -5751,14 +5751,14 @@  discard block
 block discarded – undo
5751 5751
                     } else {
5752 5752
                         $tip_visibility = get_lang('Hide');
5753 5753
                     }
5754
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;id=' . $parent_id . '&amp;' . $visibility_command . '=' . $id . '&amp;' . $sort_params . '">' .
5755
-                        Display::return_icon($visibility_icon . '.png', $tip_visibility, '', ICON_SIZE_SMALL) . '</a>';
5754
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;id='.$parent_id.'&amp;'.$visibility_command.'='.$id.'&amp;'.$sort_params.'">'.
5755
+                        Display::return_icon($visibility_icon.'.png', $tip_visibility, '', ICON_SIZE_SMALL).'</a>';
5756 5756
                 }
5757 5757
             }
5758 5758
 
5759 5759
             // Delete button
5760 5760
             if (in_array($path, DocumentManager::get_system_folders())) {
5761
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5761
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5762 5762
             } else {
5763 5763
                 $titleToShow = addslashes(basename($document_data['title']));
5764 5764
 
@@ -5766,23 +5766,23 @@  discard block
 block discarded – undo
5766 5766
                     $_GET['curdirpath'] == '/certificates' &&
5767 5767
                     DocumentManager::get_default_certificate_id(api_get_course_int_id()) == $id
5768 5768
                 ) {
5769
-                    $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 . '\');">' .
5770
-                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5769
+                    $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.'\');">'.
5770
+                        Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5771 5771
                 } else {
5772 5772
                     if ($is_certificate_mode) {
5773
-                        $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 . '\');">' .
5774
-                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5773
+                        $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.'\');">'.
5774
+                            Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5775 5775
                     } else {
5776 5776
                         if (api_get_session_id()) {
5777 5777
                             if ($document_data['session_id'] == api_get_session_id()) {
5778
-                                $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 . '\');">'.
5779
-                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5778
+                                $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.'\');">'.
5779
+                                    Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5780 5780
                             } else {
5781
-                                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5781
+                                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('ThisFolderCannotBeDeleted'), array(), ICON_SIZE_SMALL);
5782 5782
                             }
5783 5783
                         } else {
5784
-                            $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. '\');">' .
5785
-                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) . '</a>';
5784
+                            $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.'\');">'.
5785
+                                Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
5786 5786
                         }
5787 5787
                     }
5788 5788
                 }
@@ -5794,15 +5794,15 @@  discard block
 block discarded – undo
5794 5794
                 // nothing to do
5795 5795
             } else {
5796 5796
                 if ($usePpt2lp && $formatType) {
5797
-                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" ' .
5798
-                        'data-documentId = ' . $document_id .
5799
-                        ' data-formatType = ' . $formatType . '>' .
5797
+                    $modify_icons .= '&nbsp;<a class="convertAction" href="#" '.
5798
+                        'data-documentId = '.$document_id.
5799
+                        ' data-formatType = '.$formatType.'>'.
5800 5800
                         Display::return_icon(
5801 5801
                             'convert.png',
5802 5802
                             get_lang('Convert'),
5803 5803
                             array(),
5804 5804
                             ICON_SIZE_SMALL
5805
-                        ) . '</a>';
5805
+                        ).'</a>';
5806 5806
                 }
5807 5807
             }
5808 5808
         }
@@ -5810,8 +5810,8 @@  discard block
 block discarded – undo
5810 5810
         if ($type == 'file' && ($extension == 'html' || $extension == 'htm')) {
5811 5811
             if ($is_template == 0) {
5812 5812
                 if ((isset($_GET['curdirpath']) && $_GET['curdirpath'] != '/certificates') || !isset($_GET['curdirpath'])) {
5813
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;add_as_template=' . $id .  '&amp;' . $sort_params . '">' .
5814
-                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL) . '</a>';
5813
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;add_as_template='.$id.'&amp;'.$sort_params.'">'.
5814
+                        Display::return_icon('wizard.png', get_lang('AddAsTemplate'), array(), ICON_SIZE_SMALL).'</a>';
5815 5815
                 }
5816 5816
                 if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates') {//allow attach certificate to course
5817 5817
                     $visibility_icon_certificate = 'nocertificate';
@@ -5825,21 +5825,21 @@  discard block
 block discarded – undo
5825 5825
                         $certificate = get_lang('NoDefaultCertificate');
5826 5826
                     }
5827 5827
                     if (isset($_GET['selectcat'])) {
5828
-                        $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 . '">';
5828
+                        $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.'">';
5829 5829
                         $modify_icons .= Display::return_icon($visibility_icon_certificate.'.png', $certificate);
5830 5830
                         $modify_icons .= '</a>';
5831 5831
                         if ($is_preview) {
5832
-                            $modify_icons .= '&nbsp;<a target="_blank"  href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;curdirpath=' . $curdirpath . '&amp;set_preview=' . $id . '&amp;' . $sort_params . '" >' .
5833
-                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL) . '</a>';
5832
+                            $modify_icons .= '&nbsp;<a target="_blank"  href="'.api_get_self().'?'.api_get_cidreq().'&amp;curdirpath='.$curdirpath.'&amp;set_preview='.$id.'&amp;'.$sort_params.'" >'.
5833
+                                Display::return_icon('preview_view.png', $preview, '', ICON_SIZE_SMALL).'</a>';
5834 5834
                         }
5835 5835
                     }
5836 5836
                 }
5837 5837
             } else {
5838
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&curdirpath=' . $curdirpath . '&amp;remove_as_template=' . $id. '&amp;' . $sort_params . '">' .
5839
-                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL) . '</a>';
5838
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.'&amp;'.$sort_params.'">'.
5839
+                    Display::return_icon('wizard_na.png', get_lang('RemoveAsTemplate'), '', ICON_SIZE_SMALL).'</a>';
5840 5840
             }
5841
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?' . api_get_cidreq() . '&action=export_to_pdf&id=' . $id . '">' .
5842
-                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL) . '</a>';
5841
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'">'.
5842
+                Display::return_icon('pdf.png', get_lang('Export2PDF'), array(), ICON_SIZE_SMALL).'</a>';
5843 5843
         }
5844 5844
 
5845 5845
         return $modify_icons;
@@ -5911,7 +5911,7 @@  discard block
 block discarded – undo
5911 5911
                     // 3. inside a subfolder of the folder you want to move
5912 5912
                     if (($curdirpath != $folder) &&
5913 5913
                         ($folder != $move_file) &&
5914
-                        (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5914
+                        (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5915 5915
                     ) {
5916 5916
                         $path_displayed = $folder;
5917 5917
                         // If document title is used, we have to display titles instead of real paths...
@@ -5928,7 +5928,7 @@  discard block
 block discarded – undo
5928 5928
             foreach ($folders as $folder) {
5929 5929
                 if (($curdirpath != $folder) &&
5930 5930
                     ($folder != $move_file) &&
5931
-                    (substr($folder, 0, strlen($move_file) + 1) != $move_file . '/')
5931
+                    (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')
5932 5932
                 ) {
5933 5933
                     // Cannot copy dir into his own subdir
5934 5934
                     $path_displayed = DocumentManager::get_titles_of_path($folder);
@@ -5971,10 +5971,10 @@  discard block
 block discarded – undo
5971 5971
                 // If this path has soon been stored here we don't need a new query
5972 5972
                 $path_displayed .= $tmp_folders_titles[$tmp_path];
5973 5973
             } else {
5974
-                $sql = 'SELECT title FROM ' . Database::get_course_table(TABLE_DOCUMENT) . '
5975
-                    WHERE c_id = ' . $course_id . ' AND path LIKE BINARY "' . $tmp_path . '"';
5974
+                $sql = 'SELECT title FROM '.Database::get_course_table(TABLE_DOCUMENT).'
5975
+                    WHERE c_id = ' . $course_id.' AND path LIKE BINARY "'.$tmp_path.'"';
5976 5976
                 $rs = Database::query($sql);
5977
-                $tmp_title = '/' . Database::result($rs, 0, 0);
5977
+                $tmp_title = '/'.Database::result($rs, 0, 0);
5978 5978
                 $path_displayed .= $tmp_title;
5979 5979
                 $tmp_folders_titles[$tmp_path] = $tmp_title;
5980 5980
             }
@@ -6011,7 +6011,7 @@  discard block
 block discarded – undo
6011 6011
         $clean_curdirpath = Security::remove_XSS($curdirpath);
6012 6012
         if ($clean_curdirpath == '/shared_folder') {
6013 6013
             return true;
6014
-        } elseif ($clean_curdirpath == '/shared_folder_session_' . $current_session_id) {
6014
+        } elseif ($clean_curdirpath == '/shared_folder_session_'.$current_session_id) {
6015 6015
             return true;
6016 6016
         } else {
6017 6017
             return false;
@@ -6027,7 +6027,7 @@  discard block
 block discarded – undo
6027 6027
         $clean_path = Security::remove_XSS($path);
6028 6028
         if (strpos($clean_path, 'shared_folder/sf_user_')) {
6029 6029
             return true;
6030
-        } elseif (strpos($clean_path, 'shared_folder_session_' . $current_session_id . '/sf_user_')) {
6030
+        } elseif (strpos($clean_path, 'shared_folder_session_'.$current_session_id.'/sf_user_')) {
6031 6031
             return true;
6032 6032
         } else {
6033 6033
             return false;
@@ -6040,11 +6040,11 @@  discard block
 block discarded – undo
6040 6040
      */
6041 6041
     public static function is_my_shared_folder($user_id, $path, $current_session_id)
6042 6042
     {
6043
-        $clean_path = Security::remove_XSS($path) . '/';
6043
+        $clean_path = Security::remove_XSS($path).'/';
6044 6044
         //for security does not remove the last slash
6045
-        $main_user_shared_folder = '/shared_folder\/sf_user_' . $user_id . '\//';
6045
+        $main_user_shared_folder = '/shared_folder\/sf_user_'.$user_id.'\//';
6046 6046
         //for security does not remove the last slash
6047
-        $main_user_shared_folder_session = '/shared_folder_session_' . $current_session_id . '\/sf_user_' . $user_id . '\//';
6047
+        $main_user_shared_folder_session = '/shared_folder_session_'.$current_session_id.'\/sf_user_'.$user_id.'\//';
6048 6048
 
6049 6049
         if (preg_match($main_user_shared_folder, $clean_path)) {
6050 6050
             return true;
@@ -6317,7 +6317,7 @@  discard block
 block discarded – undo
6317 6317
                 ON (i.c_id = d.c_id)
6318 6318
                 WHERE
6319 6319
                     d.id = i.ref AND
6320
-                    i.tool = '" . TOOL_DOCUMENT . "'
6320
+                    i.tool = '".TOOL_DOCUMENT."'
6321 6321
                     $conditionSession AND
6322 6322
                     i.c_id = $courseId AND
6323 6323
                     d.c_id = $courseId ";
@@ -6325,9 +6325,9 @@  discard block
 block discarded – undo
6325 6325
         $result = Database::query($sql);
6326 6326
         $documents = Database::store_result($result, 'ASSOC');
6327 6327
         if ($documents) {
6328
-            $course_dir = $courseInfo['directory'] . '/document';
6328
+            $course_dir = $courseInfo['directory'].'/document';
6329 6329
             $sys_course_path = api_get_path(SYS_COURSE_PATH);
6330
-            $base_work_dir = $sys_course_path . $course_dir;
6330
+            $base_work_dir = $sys_course_path.$course_dir;
6331 6331
 
6332 6332
             foreach ($documents as $document) {
6333 6333
                 $documentId = $document['id'];
Please login to merge, or discard this patch.
main/inc/lib/diagnoser.lib.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 {
16 16
     const STATUS_OK = 1;
17 17
     const STATUS_WARNING = 2;
18
-    const STATUS_ERROR 	= 3;
18
+    const STATUS_ERROR = 3;
19 19
     const STATUS_INFORMATION = 4;
20 20
 
21 21
     /**
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
                 $html .= '<li>';
46 46
             }
47 47
             $params['section'] = $section;
48
-            $html .='<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
48
+            $html .= '<a href="system_status.php?section='.$section.'">'.get_lang($section).'</a></li>';
49 49
         }
50 50
 
51 51
         $html .= '</ul><div class="tab-pane">';
52 52
 
53
-        $data = call_user_func(array($this, 'get_' . $currentSection . '_data'));
53
+        $data = call_user_func(array($this, 'get_'.$currentSection.'_data'));
54 54
         echo $html;
55 55
 
56 56
         if ($currentSection != 'paths') {
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
     {
118 118
         $array = array();
119 119
         $writable_folders = array(
120
-            api_get_path(SYS_APP_PATH) .'cache',
120
+            api_get_path(SYS_APP_PATH).'cache',
121 121
             api_get_path(SYS_COURSE_PATH),
122
-            api_get_path(SYS_APP_PATH) .'home',
123
-            api_get_path(SYS_APP_PATH) .'upload/users/',
124
-            api_get_path(SYS_PATH) .'main/default_course_document/images/',
122
+            api_get_path(SYS_APP_PATH).'home',
123
+            api_get_path(SYS_APP_PATH).'upload/users/',
124
+            api_get_path(SYS_PATH).'main/default_course_document/images/',
125 125
         );
126 126
         foreach ($writable_folders as $index => $folder) {
127 127
             $writable = is_writable($folder);
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
         $exists = file_exists(api_get_path(SYS_CODE_PATH).'install');
142 142
         $status = $exists ? self :: STATUS_WARNING : self :: STATUS_OK;
143
-        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists') . ': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
143
+        $array[] = $this->build_setting($status, '[FILES]', get_lang('DirectoryExists').': /install', 'http://be2.php.net/file_exists', $exists, 0, 'yes_no', get_lang('DirectoryShouldBeRemoved'));
144 144
 
145 145
         //$app_version = api_get_setting('chamilo_database_version');
146 146
         //$array[] = $this->build_setting(self :: STATUS_INFORMATION, '[DB]', 'chamilo_database_version', '#', $app_version, 0, null,  'Chamilo DB version');
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
                     $message2 .= get_lang('SpaceUsedOnSystemCannotBeMeasuredOnWindows');
156 156
                 } else {
157 157
                     $dir = api_get_path(SYS_PATH);
158
-                    $du = exec('du -sh ' . $dir, $err);
158
+                    $du = exec('du -sh '.$dir, $err);
159 159
                     list($size, $none) = explode("\t", $du);
160 160
                     $limit = $_configuration[$access_url_id]['hosting_limit_disk_space'];
161 161
                     $message2 .= sprintf(get_lang('TotalSpaceUsedByPortalXLimitIsYMB'), $size, $limit);
@@ -239,33 +239,33 @@  discard block
 block discarded – undo
239 239
         $array[] = $this->build_setting($status, '[INI]', 'default_charset', 'http://www.php.net/manual/en/ini.core.php#ini.default-charset', $setting, $req_setting, null, get_lang('DefaultCharsetInfo'));
240 240
 
241 241
         $setting = ini_get('max_execution_time');
242
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
242
+        $req_setting = '300 ('.get_lang('Minimum').')';
243 243
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
244 244
         $array[] = $this->build_setting($status, '[INI]', 'max_execution_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-execution-time', $setting, $req_setting, null, get_lang('MaxExecutionTimeInfo'));
245 245
 
246 246
         $setting = ini_get('max_input_time');
247
-        $req_setting = '300 (' . get_lang('Minimum') . ')';
247
+        $req_setting = '300 ('.get_lang('Minimum').')';
248 248
         $status = $setting >= 300 ? self :: STATUS_OK : self :: STATUS_WARNING;
249 249
         $array[] = $this->build_setting($status, '[INI]', 'max_input_time', 'http://www.php.net/manual/en/ini.core.php#ini.max-input-time', $setting, $req_setting, null, get_lang('MaxInputTimeInfo'));
250 250
 
251 251
         $setting = ini_get('memory_limit');
252 252
         $req_setting = '>= '.REQUIRED_MIN_MEMORY_LIMIT.'M';
253 253
         $status = self :: STATUS_ERROR;
254
-        if ((float)$setting >= REQUIRED_MIN_MEMORY_LIMIT)
254
+        if ((float) $setting >= REQUIRED_MIN_MEMORY_LIMIT)
255 255
             $status = self :: STATUS_OK;
256 256
         $array[] = $this->build_setting($status, '[INI]', 'memory_limit', 'http://www.php.net/manual/en/ini.core.php#ini.memory-limit', $setting, $req_setting, null, get_lang('MemoryLimitInfo'));
257 257
 
258 258
         $setting = ini_get('post_max_size');
259 259
         $req_setting = '>= '.REQUIRED_MIN_POST_MAX_SIZE.'M';
260 260
         $status = self :: STATUS_ERROR;
261
-        if ((float)$setting >= REQUIRED_MIN_POST_MAX_SIZE)
261
+        if ((float) $setting >= REQUIRED_MIN_POST_MAX_SIZE)
262 262
             $status = self :: STATUS_OK;
263 263
         $array[] = $this->build_setting($status, '[INI]', 'post_max_size', 'http://www.php.net/manual/en/ini.core.php#ini.post-max-size', $setting, $req_setting, null, get_lang('PostMaxSizeInfo'));
264 264
 
265 265
         $setting = ini_get('upload_max_filesize');
266 266
         $req_setting = '>= '.REQUIRED_MIN_UPLOAD_MAX_FILESIZE.'M';
267 267
         $status = self :: STATUS_ERROR;
268
-        if ((float)$setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
268
+        if ((float) $setting >= REQUIRED_MIN_UPLOAD_MAX_FILESIZE)
269 269
             $status = self :: STATUS_OK;
270 270
         $array[] = $this->build_setting($status, '[INI]', 'upload_max_filesize', 'http://www.php.net/manual/en/ini.core.php#ini.upload_max_filesize', $setting, $req_setting, null, get_lang('UploadMaxFilesizeInfo'));
271 271
 
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
280 280
         $array[] = $this->build_setting($status, '[SESSION]', 'session.gc_maxlifetime', 'http://www.php.net/manual/en/ini.core.php#session.gc-maxlifetime', $setting, $req_setting, null, get_lang('SessionGCMaxLifetimeInfo'));
281 281
 
282
-        if (api_check_browscap()){$setting = true;}else{$setting=false;}
282
+        if (api_check_browscap()) {$setting = true; } else {$setting = false; }
283 283
         $req_setting = true;
284 284
         $status = $setting == $req_setting ? self :: STATUS_OK : self :: STATUS_WARNING;
285 285
         $array[] = $this->build_setting($status, '[INI]', 'browscap', 'http://www.php.net/manual/en/misc.configuration.php#ini.browscap', $setting, $req_setting, 'on_off', get_lang('BrowscapInfo'));
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 
346 346
             $loaded = extension_loaded($extension);
347 347
             $status = $loaded ? self :: STATUS_OK : self :: STATUS_ERROR;
348
-            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension') . ': ' . $extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
348
+            $array[] = $this->build_setting($status, '[EXTENSION]', get_lang('LoadedExtension').': '.$extension, $url, $loaded, $expected_value, 'yes_no_optional', $comment);
349 349
         }
350 350
 
351 351
         return $array;
@@ -468,9 +468,9 @@  discard block
 block discarded – undo
468 468
         $formatted_expected_value = $expected_value;
469 469
 
470 470
         if ($formatter) {
471
-            if (method_exists($this, 'format_' . $formatter)) {
472
-                $formatted_current_value = call_user_func(array($this, 'format_' . $formatter), $current_value);
473
-                $formatted_expected_value = call_user_func(array($this, 'format_' . $formatter), $expected_value);
471
+            if (method_exists($this, 'format_'.$formatter)) {
472
+                $formatted_current_value = call_user_func(array($this, 'format_'.$formatter), $current_value);
473
+                $formatted_expected_value = call_user_func(array($this, 'format_'.$formatter), $expected_value);
474 474
             }
475 475
         }
476 476
 
@@ -485,13 +485,13 @@  discard block
 block discarded – undo
485 485
      */
486 486
     public function get_link($title, $url)
487 487
     {
488
-        return '<a href="' . $url . '" target="about:bank">' . $title . '</a>';
488
+        return '<a href="'.$url.'" target="about:bank">'.$title.'</a>';
489 489
     }
490 490
 
491 491
     public function format_yes_no_optional($value)
492 492
     {
493 493
     	$return = '';
494
-    	switch($value) {
494
+    	switch ($value) {
495 495
      		case 0:
496 496
      			$return = get_lang('No');
497 497
      			break;
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Controller/LegacyController.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             /**
65 65
              * Some legacy Chamilo files still use this variables directly,
66 66
              * instead of using a function.
67
-            **/
67
+             **/
68 68
             $is_allowed_in_course = api_is_allowed_in_course();
69 69
             $is_courseAdmin = api_is_course_admin();
70 70
             $is_platformAdmin = api_is_platform_admin();
Please login to merge, or discard this patch.