Completed
Push — master ( 5da9ea...eef579 )
by Angel Fernando Quiroz
50:18 queued 17:36
created
src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestMatching.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
             ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord'],
55 55
             ['Undo', 'Redo', '-', 'SelectAll', 'Find', '-', 'RemoveFormat'],
56 56
             ['Link', 'Unlink', 'Anchor', 'Glossary'],
57
-            ['Image', 'Mapping', 'Video', 'Oembed', 'Youtube', 'Flash', 'Audio', 'leaflet', 'Smiley', 'SpecialChar', 'Asciimath',],
57
+            ['Image', 'Mapping', 'Video', 'Oembed', 'Youtube', 'Flash', 'Audio', 'leaflet', 'Smiley', 'SpecialChar', 'Asciimath', ],
58 58
             '/',
59 59
             ['Table', '-', 'CreateDiv'],
60 60
             ['BulletedList', 'NumberedList', 'HorizontalRule', '-', 'Outdent', 'Indent', 'Blockquote'],
Please login to merge, or discard this patch.
plugin/openmeetings/lib/openmeetings_rest_service.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -40,31 +40,31 @@  discard block
 block discarded – undo
40 40
         // $request
41 41
         
42 42
         // Initialize the session by passing the request as a parameter
43
-        $session = curl_init ( $request );
43
+        $session = curl_init($request);
44 44
         
45 45
         // Set curl options by passing session and flags
46 46
         // CURLOPT_HEADER allows us to receive the HTTP header
47
-        curl_setopt ( $session, CURLOPT_HEADER, true );
47
+        curl_setopt($session, CURLOPT_HEADER, true);
48 48
         
49 49
         // CURLOPT_RETURNTRANSFER will return the response
50
-        curl_setopt ( $session, CURLOPT_RETURNTRANSFER, true );
50
+        curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
51 51
         
52 52
         // Make the request
53
-        $response = curl_exec ( $session );
53
+        $response = curl_exec($session);
54 54
         
55 55
         // Close the curl session
56
-        curl_close ( $session );
56
+        curl_close($session);
57 57
         
58 58
         // Confirm that the request was transmitted to the OpenMeetings! Image Search Service
59
-        if (! $response) {
60
-            die ( "Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()' );
59
+        if (!$response) {
60
+            die ("Request OpenMeetings! OpenMeetings Service failed and no response was returned in ".__CLASS__.'::'.__FUNCTION__.'()');
61 61
         }
62 62
         
63 63
         // Create an array to store the HTTP response codes
64
-        $status_code = array ();
64
+        $status_code = array();
65 65
         
66 66
         // Use regular expressions to extract the code from the header
67
-        preg_match ( '/\d\d\d/', $response, $status_code );
67
+        preg_match('/\d\d\d/', $response, $status_code);
68 68
         $bt = debug_backtrace();
69 69
         $caller = array_shift($bt);
70 70
         $extra = ' (from '.$caller['file'].' at line '.$caller['line'].') ';
@@ -74,24 +74,24 @@  discard block
 block discarded – undo
74 74
                 // Success
75 75
                 break;
76 76
             case 503 :
77
-                error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503.
77
+                error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 503.
78 78
                                  That means: Service unavailable. An internal problem prevented us from returning data to you.' );
79 79
                 return false;
80 80
                 break;
81 81
             case 403 :
82
-                error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403.
82
+                error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 403.
83 83
                                  That means: Forbidden. You do not have permission to access this resource, or are over your rate limit.' );
84 84
                 return false;
85 85
                 break;
86 86
             case 400 :
87 87
                 // You may want to fall through here and read the specific XML error
88
-                error_log( 'Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400.
88
+                error_log('Your call to OpenMeetings Web Services '.$extra.' failed and returned an HTTP status of 400.
89 89
                                  That means:  Bad request. The parameters passed to the service did not match as expected.   
90 90
                                  The exact error is returned in the XML response.' );
91 91
                 return false;
92 92
                 break;
93 93
             default:
94
-                error_log( 'Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: ' . $status_code [0] . " Request " . $request );
94
+                error_log('Your call to OpenMeetings Web Services '.$extra.' returned an unexpected HTTP status of: '.$status_code [0]." Request ".$request);
95 95
                 return false;
96 96
         }
97 97
         
Please login to merge, or discard this patch.
plugin/dashboard/block_daily/block_daily.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -72,19 +72,19 @@  discard block
 block discarded – undo
72 72
         $data = array();
73 73
         $content = $this->get_content_html();
74 74
         $html = '<div class="panel panel-default" id="intro">
75
-		                <div class="panel-heading">' . get_lang('GradebookAndAttendances') . '
75
+		                <div class="panel-heading">' . get_lang('GradebookAndAttendances').'
76 76
 		                    <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\'' . addslashes(
77 77
                 api_htmlentities(
78 78
                     get_lang('ConfirmYourChoice'),
79 79
                     ENT_QUOTES,
80 80
                     $charset
81 81
                 )
82
-            ) . '\')) return false;" href="index.php?action=disable_block&path=' . $this->path . '">
82
+            ).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
83 83
                     <em class="fa fa-times"></em>
84 84
                         </a></div>
85 85
 		                </div>
86 86
 		                <div class="panel-body">
87
-		                   ' . $content . '
87
+		                   ' . $content.'
88 88
 		                </div>
89 89
 		            </div>
90 90
 				';
@@ -102,17 +102,17 @@  discard block
 block discarded – undo
102 102
     {
103 103
         $course_data = $this->get_course_information_data();
104 104
         //$content = '<div style="margin:10px;">';
105
-        $content = '<h4>' . get_lang(
105
+        $content = '<h4>'.get_lang(
106 106
                 'YourCourseList'
107
-            ) . '</h4>';
107
+            ).'</h4>';
108 108
         $data_table = null;
109 109
         if (!empty($course_data)) {
110 110
             $data_table .= '<table class="data_table" width:"95%">';
111 111
             $data_table .= '<tr>
112
-	    						<th>' . get_lang('CourseTitle') . '</th>
113
-	    						<th width="20%">' . get_lang('NbStudents') . '</th>
114
-	    						<th width="20%">' . get_lang('Evaluation') . '</th>
115
-	    						<th width="20%">' . get_lang('ToolAttendance') . '</th>
112
+	    						<th>' . get_lang('CourseTitle').'</th>
113
+	    						<th width="20%">' . get_lang('NbStudents').'</th>
114
+	    						<th width="20%">' . get_lang('Evaluation').'</th>
115
+	    						<th width="20%">' . get_lang('ToolAttendance').'</th>
116 116
 	    					</tr>';
117 117
             $i = 1;
118 118
             foreach ($course_data as $course) {
@@ -121,12 +121,12 @@  discard block
 block discarded – undo
121 121
                 } else {
122 122
                     $class_tr = 'row_even';
123 123
                 }
124
-                $data_table .= '<tr class="' . $class_tr . '">';
124
+                $data_table .= '<tr class="'.$class_tr.'">';
125 125
                 if (!isset($course[3])) {
126 126
                     $course[3] = get_lang('NotAvailable');
127 127
                 }
128 128
                 foreach ($course as $cell) {
129
-                    $data_table .= '<td align="right">' . $cell . '</td>';
129
+                    $data_table .= '<td align="right">'.$cell.'</td>';
130 130
                 }
131 131
                 $data_table .= '</tr>';
132 132
                 $i++;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $content .= $data_table;
139 139
         if (!empty($course_data)) {
140 140
             $content .= '<div style="text-align:right;margin-top:10px;">
141
-            <a href="' . api_get_path(WEB_CODE_PATH) . 'mySpace/course.php">' . get_lang('SeeMore') . '</a></div>';
141
+            <a href="' . api_get_path(WEB_CODE_PATH).'mySpace/course.php">'.get_lang('SeeMore').'</a></div>';
142 142
         }
143 143
         //$content .= '</div>';
144 144
         return $content;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
             $table_course = Database::get_course_table(TABLE_ATTENDANCE);
177 177
 
178 178
             $sql = "SELECT id, name, attendance_qualify_max FROM $table_course
179
-                    WHERE c_id = " . $course_info['real_id'] . " AND active = 1 AND session_id = 0";
179
+                    WHERE c_id = ".$course_info['real_id']." AND active = 1 AND session_id = 0";
180 180
             $rs = Database::query($sql);
181 181
             $attendance = array();
182 182
             $attendances = array();
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
                 $attendance['course_code'] = $course_info['code'];
189 189
 
190 190
                 if ($attendance['done'] != '0') {
191
-                    $attendances[] = '<a href="' . api_get_path(WEB_PATH).'main/attendance/index.php?cidReq=' . $attendance['course_code'] . '&action=attendance_sheet_print&attendance_id=' . $attendance['id']. '">' . Display::return_icon('printmgr.gif', get_lang('Print')).'</a>';
191
+                    $attendances[] = '<a href="'.api_get_path(WEB_PATH).'main/attendance/index.php?cidReq='.$attendance['course_code'].'&action=attendance_sheet_print&attendance_id='.$attendance['id'].'">'.Display::return_icon('printmgr.gif', get_lang('Print')).'</a>';
192 192
                 } else {
193 193
                     $attendances[] = get_lang("NotAvailable");
194 194
                 }
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
             // Number of students
201 201
 
202 202
             $sql = "SELECT user_id FROM $tbl_course_user as course_rel_user
203
-                    WHERE course_rel_user.status=" . STUDENT . " AND course_rel_user.c_id=$courseId";
203
+                    WHERE course_rel_user.status=".STUDENT." AND course_rel_user.c_id=$courseId";
204 204
             $rs = Database::query($sql);
205 205
             $users = array();
206 206
             while ($row = Database::fetch_array($rs)) {
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
             }
212 212
 
213 213
             if (!empty($tematic_advance)) {
214
-                $tematic_advance_progress = '<a title="' . get_lang(
214
+                $tematic_advance_progress = '<a title="'.get_lang(
215 215
                         'GoToThematicAdvance'
216
-                    ) . '" href="' . api_get_path(
216
+                    ).'" href="'.api_get_path(
217 217
                         WEB_CODE_PATH
218
-                    ) . 'attendance/index.php?cidReq=' . $course_code . '&action=attendance_sheet_print&attendance_id=">' . $tematic_advance . '%</a>';
218
+                    ).'attendance/index.php?cidReq='.$course_code.'&action=attendance_sheet_print&attendance_id=">'.$tematic_advance.'%</a>';
219 219
             } else {
220 220
                 $tematic_advance_progress = '0%';
221 221
             }
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
             $tbl_grade_categories = Database::get_main_table(
225 225
                 TABLE_MAIN_GRADEBOOK_CATEGORY
226 226
             );
227
-            $sql = "SELECT id from " . $tbl_grade_categories . "
228
-                    WHERE course_code ='" . $course_code . "'";
227
+            $sql = "SELECT id from ".$tbl_grade_categories."
228
+                    WHERE course_code ='" . $course_code."'";
229 229
             $rs = Database::query($sql);
230 230
             $category = null;
231 231
             while ($row = Database::fetch_array($rs)) {
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                 if (count($eval) > 0) {
239 239
                     $i = 0;
240 240
                     foreach ($eval as $item) {
241
-                        $score .= '<a href="' . api_get_path(WEB_PATH).'main/gradebook/gradebook_view_result.php?export=pdf&cat_code=' . $cat[0]->get_id() . '&official_code=' . $cat[0]->get_course_code() . '&selecteval=' . $item->get_id(). '">' . $item->get_name() . '</a>';
241
+                        $score .= '<a href="'.api_get_path(WEB_PATH).'main/gradebook/gradebook_view_result.php?export=pdf&cat_code='.$cat[0]->get_id().'&official_code='.$cat[0]->get_course_code().'&selecteval='.$item->get_id().'">'.$item->get_name().'</a>';
242 242
                         if (count($eval) - 1 != $i) {
243 243
                             $score .= ', ';
244 244
                         }
Please login to merge, or discard this patch.
plugin/dashboard/block_global_info/block_global_info.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
     /**
30 30
      * Constructor
31 31
      */
32
-    public function __construct ($user_id)
32
+    public function __construct($user_id)
33 33
     {
34
-        $this->user_id 		= $user_id;
35
-        $this->path 		= 'block_global_info';
34
+        $this->user_id = $user_id;
35
+        $this->path = 'block_global_info';
36 36
         if ($this->is_block_visible_for_user($user_id)) {
37 37
             //$this->courses = CourseManager::get_courses_followed_by_drh($user_id);
38 38
         }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     	$html = '
70 70
     	            <div class="panel panel-default" id="intro">
71 71
     	                <div class="panel-heading">'.get_lang('GlobalPlatformInformation').'
72
-    	                    <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
72
+    	                    <div class="pull-right"><a class="btn btn-danger btn-xs" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
73 73
     	                    <em class="fa fa-times"></em>
74 74
     	                    </a></div>
75 75
     	                </div>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
              $data_table = '<table class="table table-bordered" width="95%">';
99 99
              $i = 1;
100 100
              foreach ($global_data as $data) {
101
-                 if ($i%2 == 0) {
101
+                 if ($i % 2 == 0) {
102 102
                      $class_tr = 'row_odd';
103 103
                  } else {
104 104
                      $class_tr = 'row_even';
Please login to merge, or discard this patch.
plugin/buycourses/src/buy_course_plugin.class.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
             return false;
125 125
         }
126 126
 
127
-        require_once api_get_path(SYS_PLUGIN_PATH) . 'buycourses/database.php';
127
+        require_once api_get_path(SYS_PLUGIN_PATH).'buycourses/database.php';
128 128
     }
129 129
 
130 130
     /**
@@ -173,10 +173,10 @@  discard block
 block discarded – undo
173 173
             $item = $this->getItemByProduct(intval($productId), $productType);
174 174
             $return['html'] = '<div class="buycourses-price">';
175 175
             if ($item) {
176
-                $return['html'] .= '<span class="label label-primary"><b>'. $item['iso_code'] .' ' . $item['price'] . '</b></span>';
176
+                $return['html'] .= '<span class="label label-primary"><b>'.$item['iso_code'].' '.$item['price'].'</b></span>';
177 177
                 $return['verificator'] = true;
178 178
             } else {
179
-                $return['html'] .= '<span class="label label-primary"><b>'. $this->get_lang('Free'). '</b></span>';
179
+                $return['html'] .= '<span class="label label-primary"><b>'.$this->get_lang('Free').'</b></span>';
180 180
                 $return['verificator'] = false;
181 181
             }
182 182
             $return['html'] .= '</div>';
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
      */
196 196
     public function returnBuyCourseButton($productId, $productType)
197 197
     {
198
-        $url = api_get_path(WEB_PLUGIN_PATH) .
199
-            'buycourses/src/process.php?i=' .
200
-            intval($productId) .
201
-            '&t=' .
198
+        $url = api_get_path(WEB_PLUGIN_PATH).
199
+            'buycourses/src/process.php?i='.
200
+            intval($productId).
201
+            '&t='.
202 202
             $productType
203 203
         ;
204 204
 
205
-        $html = ' <a class="btn btn-success btn-sm" title="' . $this->get_lang('Buy') . '" href="' . $url . '">' .
206
-            Display::returnFontAwesomeIcon('fa fa-shopping-cart') . '</a>';
205
+        $html = ' <a class="btn btn-success btn-sm" title="'.$this->get_lang('Buy').'" href="'.$url.'">'.
206
+            Display::returnFontAwesomeIcon('fa fa-shopping-cart').'</a>';
207 207
 
208 208
         return $html;
209 209
     }
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
         );
749 749
 
750 750
         if (!empty($sessionImage)) {
751
-            $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH) . $sessionImage['value'];
751
+            $sessionInfo['image'] = api_get_path(WEB_UPLOAD_PATH).$sessionImage['value'];
752 752
         }
753 753
 
754 754
         $sessionCourses = $session->getCourses();
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
         $str = '';
1203 1203
 
1204
-        srand((double)microtime() * 1000000);
1204
+        srand((double) microtime() * 1000000);
1205 1205
 
1206 1206
         for ($i = 0; $i < $length; $i++) {
1207 1207
             $numbers = rand(0, strlen($salt) - 1);
@@ -1543,8 +1543,8 @@  discard block
 block discarded – undo
1543 1543
      */
1544 1544
     public function getPayouts($status = self::PAYOUT_STATUS_PENDING, $payoutId = false, $userId = false)
1545 1545
     {
1546
-        $condition = ($payoutId) ? 'AND p.id = '. intval($payoutId) : '';
1547
-        $condition2 = ($userId) ? ' AND p.user_id = ' . intval($userId) : '';
1546
+        $condition = ($payoutId) ? 'AND p.id = '.intval($payoutId) : '';
1547
+        $condition2 = ($userId) ? ' AND p.user_id = '.intval($userId) : '';
1548 1548
         $typeResult = ($condition) ? 'first' : 'all';
1549 1549
         $payoutsTable = Database::get_main_table(self::TABLE_PAYPAL_PAYOUTS);
1550 1550
         $saleTable = Database::get_main_table(self::TABLE_SALE);
@@ -1571,14 +1571,14 @@  discard block
 block discarded – undo
1571 1571
             INNER JOIN $saleTable s ON s.id = p.sale_id
1572 1572
             INNER JOIN $currencyTable c ON s.currency_id = c.id
1573 1573
             LEFT JOIN  $extraFieldValues efv ON p.user_id = efv.item_id 
1574
-            AND field_id = " . intval($paypalExtraField['id']) . "
1574
+            AND field_id = ".intval($paypalExtraField['id'])."
1575 1575
         ";
1576 1576
 
1577 1577
         $payouts = Database::select(
1578 1578
             "p.* , u.firstname, u.lastname, efv.value as paypal_account, s.reference as sale_reference, s.price as item_price, c.iso_code",
1579 1579
             "$payoutsTable p $innerJoins",
1580 1580
             [
1581
-                'where' => ['p.status = ? '.$condition . ' ' .$condition2 => $status]
1581
+                'where' => ['p.status = ? '.$condition.' '.$condition2 => $status]
1582 1582
             ],
1583 1583
             $typeResult
1584 1584
         );
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
         $platformCommission = $this->getPlatformCommission();
1642 1642
 
1643 1643
         $sale = $this->getSale($saleId);
1644
-        $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission']))/100, 2);
1644
+        $teachersCommission = number_format((floatval($sale['price']) * intval($platformCommission['commission'])) / 100, 2);
1645 1645
 
1646 1646
 
1647 1647
         $beneficiaries = $this->getBeneficiariesBySale($saleId);
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
                     'payout_date' => getdate(),
1654 1654
                     'sale_id' => intval($saleId),
1655 1655
                     'user_id' => $beneficiary['user_id'],
1656
-                    'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions']))/100, 2),
1656
+                    'commission' => number_format((floatval($teachersCommission) * intval($beneficiary['commissions'])) / 100, 2),
1657 1657
                     'status' => self::PAYOUT_STATUS_PENDING
1658 1658
                 ]
1659 1659
             );
@@ -2251,17 +2251,17 @@  discard block
 block discarded – undo
2251 2251
      */
2252 2252
     public function getPath($var)
2253 2253
     {
2254
-        $pluginPath = api_get_path(WEB_PLUGIN_PATH) . 'buycourses/';
2254
+        $pluginPath = api_get_path(WEB_PLUGIN_PATH).'buycourses/';
2255 2255
         $paths = [
2256
-            'SERVICE_IMAGES' => $pluginPath . 'uploads/services/images/',
2257
-            'SRC' => $pluginPath . 'src/',
2258
-            'VIEW' => $pluginPath . 'view/',
2259
-            'UPLOADS' => $pluginPath . 'uploads/',
2260
-            'LANGUAGES' => $pluginPath . 'lang/',
2261
-            'RESOURCES' => $pluginPath . 'resources/',
2262
-            'RESOURCES_IMG' => $pluginPath . 'resources/img/',
2263
-            'RESOURCES_CSS' => $pluginPath . 'resources/css/',
2264
-            'RESOURCES_JS' => $pluginPath . 'resources/js/',
2256
+            'SERVICE_IMAGES' => $pluginPath.'uploads/services/images/',
2257
+            'SRC' => $pluginPath.'src/',
2258
+            'VIEW' => $pluginPath.'view/',
2259
+            'UPLOADS' => $pluginPath.'uploads/',
2260
+            'LANGUAGES' => $pluginPath.'lang/',
2261
+            'RESOURCES' => $pluginPath.'resources/',
2262
+            'RESOURCES_IMG' => $pluginPath.'resources/img/',
2263
+            'RESOURCES_CSS' => $pluginPath.'resources/css/',
2264
+            'RESOURCES_JS' => $pluginPath.'resources/js/',
2265 2265
         ];
2266 2266
 
2267 2267
         return $paths[$var];
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Component/Utils/ChamiloApi.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
         $themeDir = \Template::getThemeDir($theme);
75 75
         $customLogoPath = "$themeDir/images/header-logo-custom$accessUrlId.png";
76 76
 
77
-        if (file_exists(api_get_path(SYS_PUBLIC_PATH) . "css/$customLogoPath")) {
78
-            return api_get_path(WEB_CSS_PATH) . $customLogoPath;
77
+        if (file_exists(api_get_path(SYS_PUBLIC_PATH)."css/$customLogoPath")) {
78
+            return api_get_path(WEB_CSS_PATH).$customLogoPath;
79 79
         }
80 80
 
81 81
         $originalLogoPath = "$themeDir/images/header-logo.png";
82 82
 
83
-        if (file_exists(api_get_path(SYS_CSS_PATH) . $originalLogoPath)) {
84
-            return api_get_path(WEB_CSS_PATH) . $originalLogoPath;
83
+        if (file_exists(api_get_path(SYS_CSS_PATH).$originalLogoPath)) {
84
+            return api_get_path(WEB_CSS_PATH).$originalLogoPath;
85 85
         }
86 86
 
87 87
         return null;
@@ -101,10 +101,10 @@  discard block
 block discarded – undo
101 101
         $siteName = api_get_setting('siteName');
102 102
 
103 103
         if ($logoPath === null) {
104
-            $headerLogo = \Display::url($siteName, api_get_path(WEB_PATH) . 'index.php');
104
+            $headerLogo = \Display::url($siteName, api_get_path(WEB_PATH).'index.php');
105 105
 
106 106
             if (!empty($institutionUrl) && !empty($institution)) {
107
-                $headerLogo .= ' - ' . \Display::url($institution, $institutionUrl);
107
+                $headerLogo .= ' - '.\Display::url($institution, $institutionUrl);
108 108
             }
109 109
 
110 110
             $courseInfo = api_get_course_info();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 
128 128
         $image = \Display::img($logoPath, $institution, $imageAttributes);
129 129
 
130
-        return \Display::url($image, api_get_path(WEB_PATH) . 'index.php');
130
+        return \Display::url($image, api_get_path(WEB_PATH).'index.php');
131 131
     }
132 132
 
133 133
     /**
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
     public static function stripGivenTags($string, $tags)
140 140
     {
141 141
         foreach ($tags as $tag) {
142
-            $string2 = preg_replace('#</' . $tag . '[^>]*>#i', ' ', $string);
142
+            $string2 = preg_replace('#</'.$tag.'[^>]*>#i', ' ', $string);
143 143
             if ($string2 != $string) {
144
-                $string = preg_replace('/<' . $tag . '[^>]*>/i', ' ', $string2);
144
+                $string = preg_replace('/<'.$tag.'[^>]*>/i', ' ', $string2);
145 145
             }
146 146
         }
147 147
 
@@ -162,9 +162,9 @@  discard block
 block discarded – undo
162 162
         sscanf($time, "%d:%d:%d", $hours, $minutes, $seconds);
163 163
         $timeSeconds = isset($seconds) ? $hours * 3600 + $minutes * 60 + $seconds : $hours * 60 + $minutes;
164 164
         if ($operation) {
165
-            $date->add(new \DateInterval('PT' . $timeSeconds . 'S'));
165
+            $date->add(new \DateInterval('PT'.$timeSeconds.'S'));
166 166
         } else {
167
-            $date->sub(new \DateInterval('PT' . $timeSeconds . 'S'));
167
+            $date->sub(new \DateInterval('PT'.$timeSeconds.'S'));
168 168
         }
169 169
 
170 170
         return $date->format('Y-m-d H:i:s');
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Component/Editor/Editor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
             case 'integer':
132 132
                 //no break
133 133
             case 'double':
134
-                return (string)$var;
134
+                return (string) $var;
135 135
                 //no break
136 136
             case 'resource':
137 137
                 //no break
Please login to merge, or discard this patch.
main/inc/ajax/course_home.ajax.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
                 $na_image = CourseHome::getCustomWebIconPath().CourseHome::getDisableIcon($tool_info['custom_icon']);
49 49
             }
50 50
 
51
-            $requested_image = ($tool_visibility == 0 ) ? $tool_image : $na_image;
52
-            $requested_class = ($tool_visibility == 0 ) ? '' : 'text-muted';
53
-            $requested_message = ($tool_visibility == 0 ) ? 'is_active' : 'is_inactive';
54
-            $requested_view = ($tool_visibility == 0 ) ? 'visible.png' : 'invisible.png';
55
-            $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;
56
-            $requested_view = ($tool_visibility == 0 ) ? 'visible.png' : 'invisible.png';
57
-            $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;
51
+            $requested_image = ($tool_visibility == 0) ? $tool_image : $na_image;
52
+            $requested_class = ($tool_visibility == 0) ? '' : 'text-muted';
53
+            $requested_message = ($tool_visibility == 0) ? 'is_active' : 'is_inactive';
54
+            $requested_view = ($tool_visibility == 0) ? 'visible.png' : 'invisible.png';
55
+            $requested_visible = ($tool_visibility == 0) ? 1 : 0;
56
+            $requested_view = ($tool_visibility == 0) ? 'visible.png' : 'invisible.png';
57
+            $requested_visible = ($tool_visibility == 0) ? 1 : 0;
58 58
 
59 59
             // HIDE AND REACTIVATE TOOL
60 60
             if ($_GET["id"] == strval(intval($_GET["id"]))) {
61 61
                 $sql = "UPDATE $tool_table SET
62 62
                         visibility = $requested_visible
63
-                        WHERE c_id = $course_id AND id='" . intval($_GET['id']) . "'";
63
+                        WHERE c_id = $course_id AND id='".intval($_GET['id'])."'";
64 64
                 Database::query($sql);
65 65
             }
66 66
             $response_data = array(
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
          */
113 113
         require_once __DIR__.'/../global.inc.php';
114 114
         $now = time();
115
-        $page  = intval($_REQUEST['page']);     //page
116
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
115
+        $page  = intval($_REQUEST['page']); //page
116
+        $limit = intval($_REQUEST['rows']); // quantity of rows
117 117
         //index to filter
118 118
         $sidx  = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
119
-        $sord  = $_REQUEST['sord'];    //asc or desc
120
-        if (!in_array($sord, array('asc','desc'))) {
119
+        $sord  = $_REQUEST['sord']; //asc or desc
120
+        if (!in_array($sord, array('asc', 'desc'))) {
121 121
             $sord = 'desc';
122 122
         }
123 123
         $session_id  = intval($_REQUEST['session_id']);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             }
138 138
         }
139 139
 
140
-        $start = $limit*$page - $limit;
140
+        $start = $limit * $page - $limit;
141 141
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
142 142
         $count = 0;
143 143
         $temp = array();
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
             $item['title'] = Display::url($item['title'], $course_url, array('target' => SESSION_LINK_TARGET));
150 150
 
151 151
             foreach ($flat_list as $lp_id => $lp_item) {
152
-                $temp[$count]['id']= $lp_id;
152
+                $temp[$count]['id'] = $lp_id;
153 153
 
154 154
                 $lp = new learnpath($item['code'], $lp_id, api_get_user_id());
155 155
                 if ($lp->progress_db == 100) {
156 156
                     continue;
157 157
                 }
158 158
 
159
-                $lp_url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
159
+                $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
160 160
 
161 161
                 $last_date = Tracking::get_last_connection_date_on_the_course(
162 162
                     api_get_user_id(),
@@ -212,25 +212,25 @@  discard block
 block discarded – undo
212 212
         }
213 213
         $temp = msort($temp, $sidx, $sord);
214 214
 
215
-        $i =0;
215
+        $i = 0;
216 216
         $response = new stdClass();
217 217
         foreach ($temp as $key => $row) {
218 218
             $row = $row['cell'];
219 219
             if (!empty($row)) {
220
-                if ($key >= $start  && $key < ($start + $limit)) {
221
-                    $response->rows[$i]['id']= $key;
222
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]);
220
+                if ($key >= $start && $key < ($start + $limit)) {
221
+                    $response->rows[$i]['id'] = $key;
222
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]);
223 223
                     $i++;
224 224
                 }
225 225
             }
226 226
         }
227 227
         $total_pages = 0;
228 228
         if ($count > 0 && $limit > 0) {
229
-            $total_pages = ceil($count/$limit);
229
+            $total_pages = ceil($count / $limit);
230 230
         }
231 231
         $response->total = $total_pages;
232 232
         if ($page > $total_pages) {
233
-            $response->page= $total_pages;
233
+            $response->page = $total_pages;
234 234
         } else {
235 235
             $response->page = $page;
236 236
         }
@@ -240,12 +240,12 @@  discard block
 block discarded – undo
240 240
     case 'session_courses_lp_by_week':
241 241
         require_once __DIR__.'/../global.inc.php';
242 242
         $now = time();
243
-        $page = intval($_REQUEST['page']);     //page
244
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
243
+        $page = intval($_REQUEST['page']); //page
244
+        $limit = intval($_REQUEST['rows']); // quantity of rows
245 245
         $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'course';
246 246
         $sidx = str_replace(array('week desc,', ' '), '', $sidx);
247
-        $sord = $_REQUEST['sord'];    //asc or desc
248
-        if (!in_array($sord, array('asc','desc'))) {
247
+        $sord = $_REQUEST['sord']; //asc or desc
248
+        if (!in_array($sord, array('asc', 'desc'))) {
249 249
             $sord = 'desc';
250 250
         }
251 251
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
             );
294 294
 
295 295
             foreach ($flat_list as $lp_id => $lp_item) {
296
-                $temp[$count]['id']= $lp_id;
297
-                $lp_url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
296
+                $temp[$count]['id'] = $lp_id;
297
+                $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
298 298
 
299 299
                 $last_date = Tracking::get_last_connection_date_on_the_course(
300 300
                     api_get_user_id(),
@@ -356,20 +356,20 @@  discard block
 block discarded – undo
356 356
         }
357 357
 
358 358
         $response = new stdClass();
359
-        $i =0;
359
+        $i = 0;
360 360
         foreach ($temp as $key => $row) {
361 361
             $row = $row['cell'];
362 362
             if (!empty($row)) {
363
-                if ($key >= $start  && $key < ($start + $limit)) {
364
-                    $response->rows[$i]['id']= $key;
365
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2],$row[3]);
363
+                if ($key >= $start && $key < ($start + $limit)) {
364
+                    $response->rows[$i]['id'] = $key;
365
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2], $row[3]);
366 366
                     $i++;
367 367
                 }
368 368
             }
369 369
         }
370 370
         $total_pages = 0;
371 371
         if ($count > 0 && $limit > 0) {
372
-            $total_pages = ceil($count/$limit);
372
+            $total_pages = ceil($count / $limit);
373 373
         }
374 374
         $response->total = $total_pages;
375 375
         if ($page > $total_pages) {
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
     case 'session_courses_lp_by_course':
384 384
         require_once __DIR__.'/../global.inc.php';
385 385
         $now = time();
386
-        $page  = intval($_REQUEST['page']);     //page
387
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
386
+        $page  = intval($_REQUEST['page']); //page
387
+        $limit = intval($_REQUEST['rows']); // quantity of rows
388 388
         $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
389 389
         $sidx = str_replace(array('course asc,', ' '), '', $sidx);
390 390
 
391
-        $sord = $_REQUEST['sord'];    //asc or desc
391
+        $sord = $_REQUEST['sord']; //asc or desc
392 392
         if (!in_array($sord, array('asc', 'desc'))) {
393 393
             $sord = 'desc';
394 394
         }
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
             }
410 410
         }
411 411
 
412
-        $start = $limit*$page - $limit;
412
+        $start = $limit * $page - $limit;
413 413
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
414 414
         $count = 0;
415 415
 
@@ -431,9 +431,9 @@  discard block
 block discarded – undo
431 431
                 $item['title'],
432 432
                 api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET)
433 433
             );
434
-            foreach($flat_list as $lp_id => $lp_item) {
435
-                $temp[$count]['id']= $lp_id;
436
-                $lp_url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
434
+            foreach ($flat_list as $lp_id => $lp_item) {
435
+                $temp[$count]['id'] = $lp_id;
436
+                $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
437 437
                 $last_date = Tracking::get_last_connection_date_on_the_course(
438 438
                     api_get_user_id(),
439 439
                     $item,
@@ -485,13 +485,13 @@  discard block
 block discarded – undo
485 485
 
486 486
         $temp = msort($temp, $sidx, $sord);
487 487
         $response = new stdClass();
488
-        $i =0;
488
+        $i = 0;
489 489
         foreach ($temp as $key => $row) {
490 490
             $row = $row['cell'];
491 491
             if (!empty($row)) {
492
-                if ($key >= $start  && $key < ($start + $limit)) {
493
-                    $response->rows[$i]['id']= $key;
494
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]);
492
+                if ($key >= $start && $key < ($start + $limit)) {
493
+                    $response->rows[$i]['id'] = $key;
494
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]);
495 495
                     $i++;
496 496
                 }
497 497
             }
Please login to merge, or discard this patch.
main/inc/lib/events.lib.php 1 patch
Spacing   +9 added lines, -11 removed lines patch added patch discarded remove patch
@@ -78,9 +78,7 @@  discard block
 block discarded – undo
78 78
         Database::query($sql);
79 79
 
80 80
         // Auto subscribe
81
-        $user_status = $userInfo['status']  == SESSIONADMIN ? 'sessionadmin' :
82
-            $userInfo['status'] == COURSEMANAGER ? 'teacher' :
83
-                $userInfo['status'] == DRH ? 'DRH' : 'student';
81
+        $user_status = $userInfo['status'] == SESSIONADMIN ? 'sessionadmin' : $userInfo['status'] == COURSEMANAGER ? 'teacher' : $userInfo['status'] == DRH ? 'DRH' : 'student';
84 82
         $autoSubscribe = api_get_setting($user_status.'_autosubscribe');
85 83
         if ($autoSubscribe) {
86 84
             $autoSubscribe = explode('|', $autoSubscribe);
@@ -337,7 +335,7 @@  discard block
 block discarded – undo
337 335
         global $debug;
338 336
 
339 337
         if ($debug) error_log('Called to update_event_exercice');
340
-        if ($debug) error_log('duration:' . $duration);
338
+        if ($debug) error_log('duration:'.$duration);
341 339
 
342 340
         if ($exeid != '') {
343 341
             /*
@@ -385,7 +383,7 @@  discard block
 block discarded – undo
385 383
         		   status = '".$status."',
386 384
         		   questions_to_check = '".$remind_list."',
387 385
         		   data_tracking = '".implode(',', $question_list)."',
388
-                   user_ip = '" . Database::escape_string(api_get_real_ip()) . "'
386
+                   user_ip = '" . Database::escape_string(api_get_real_ip())."'
389 387
         		 WHERE exe_id = '".Database::escape_string($exeid)."'";
390 388
             $res = Database::query($sql);
391 389
 
@@ -1069,15 +1067,15 @@  discard block
 block discarded – undo
1069 1067
 
1070 1068
         if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
1071 1069
             $sql = "DELETE FROM $track_e_exercises
1072
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1070
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1073 1071
             Database::query($sql);
1074 1072
 
1075 1073
             $sql = "DELETE FROM $track_attempts
1076
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1074
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1077 1075
             Database::query($sql);
1078 1076
 
1079 1077
             $sql = "DELETE FROM $recording_table
1080
-                WHERE exe_id IN (" . implode(',', $exe_list) . ")";
1078
+                WHERE exe_id IN (".implode(',', $exe_list).")";
1081 1079
             Database::query($sql);
1082 1080
         }
1083 1081
 
@@ -1119,7 +1117,7 @@  discard block
 block discarded – undo
1119 1117
             self::addEvent(
1120 1118
                 LOG_EXERCISE_RESULT_DELETE,
1121 1119
                 LOG_EXERCISE_AND_USER_ID,
1122
-                $exercise_id . '-' . $user_id,
1120
+                $exercise_id.'-'.$user_id,
1123 1121
                 null,
1124 1122
                 null,
1125 1123
                 $course_id,
@@ -1725,7 +1723,7 @@  discard block
 block discarded – undo
1725 1723
         self::addEvent(
1726 1724
             LOG_QUESTION_RESULT_DELETE,
1727 1725
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1728
-            $exe_id . '-' . $question_id,
1726
+            $exe_id.'-'.$question_id,
1729 1727
             null,
1730 1728
             null,
1731 1729
             $courseId,
@@ -1762,7 +1760,7 @@  discard block
 block discarded – undo
1762 1760
         self::addEvent(
1763 1761
             LOG_QUESTION_RESULT_DELETE,
1764 1762
             LOG_EXERCISE_ATTEMPT_QUESTION_ID,
1765
-            $exe_id . '-' . $question_id,
1763
+            $exe_id.'-'.$question_id,
1766 1764
             null,
1767 1765
             null,
1768 1766
             $courseId,
Please login to merge, or discard this patch.