Completed
Pull Request — 1.11.x (#1458)
by José
138:44 queued 104:05
created
main/mySpace/works_in_session_report.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     foreach ($sessionCourses as $sessionCourse) {
47 47
         $course = $sessionCourse->getCourse();
48
-        $coursesInfo[$course->getId()] =  $course->getCode();
48
+        $coursesInfo[$course->getId()] = $course->getCode();
49 49
         $criteria = Criteria::create()->where(
50 50
             Criteria::expr()->eq("status", Session::STUDENT)
51 51
         );
@@ -68,21 +68,21 @@  discard block
 block discarded – undo
68 68
                 ];
69 69
             }
70 70
 
71
-            $usersInfo[$user->getId()][$course->getId() . '_score'] = null;
72
-            $usersInfo[$user->getId()][$course->getId() . '_progress'] = null;
73
-            $usersInfo[$user->getId()][$course->getId() . '_last_sent_date'] = null;
71
+            $usersInfo[$user->getId()][$course->getId().'_score'] = null;
72
+            $usersInfo[$user->getId()][$course->getId().'_progress'] = null;
73
+            $usersInfo[$user->getId()][$course->getId().'_last_sent_date'] = null;
74 74
 
75 75
             if (!$session->hasStudentInCourse($user, $course)) {
76 76
                 continue;
77 77
             }
78 78
 
79
-            $usersInfo[$user->getId()][$course->getId() . '_score'] = Tracking::get_avg_student_score(
79
+            $usersInfo[$user->getId()][$course->getId().'_score'] = Tracking::get_avg_student_score(
80 80
                 $user->getId(),
81 81
                 $course->getCode(),
82 82
                 null,
83 83
                 $session->getId()
84 84
             );
85
-            $usersInfo[$user->getId()][$course->getId() . '_progress'] = Tracking::get_avg_student_progress(
85
+            $usersInfo[$user->getId()][$course->getId().'_progress'] = Tracking::get_avg_student_progress(
86 86
                 $user->getId(),
87 87
                 $course->getCode(),
88 88
                 null,
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                 continue;
96 96
             }
97 97
 
98
-            $usersInfo[$user->getId()][$course->getId() . '_last_sent_date'] = api_format_date(
98
+            $usersInfo[$user->getId()][$course->getId().'_last_sent_date'] = api_format_date(
99 99
                 $lastPublication->getSentDate()->getTimestamp(),
100 100
                 DATE_TIME_FORMAT_SHORT
101 101
             );
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     $dataToExport = [
108 108
         [$toolName]
109 109
     ];
110
-    $fileName = 'works_in_session_' . api_get_local_time();
110
+    $fileName = 'works_in_session_'.api_get_local_time();
111 111
 
112 112
     $dataToExport['headers'][] = get_lang('OfficialCode');
113 113
     $dataToExport['headers'][] = get_lang('StudentName');
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 }
139 139
 
140 140
 $interbreadcrumb[] = [
141
-    'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/index.php',
141
+    'url' => api_get_path(WEB_CODE_PATH).'mySpace/index.php',
142 142
     'name' => get_lang('MySpace')
143 143
 ];
144 144
 
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
     $actions = [
149 149
         Display::url(
150 150
             Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM),
151
-            api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()])
151
+            api_get_self().'?'.http_build_query(['export' => 'csv', 'session' => $session->getId()])
152 152
         ),
153 153
         Display::url(
154 154
             Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM),
155
-            api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()])
155
+            api_get_self().'?'.http_build_query(['export' => 'xls', 'session' => $session->getId()])
156 156
         )
157 157
     ];
158 158
 }
Please login to merge, or discard this patch.
main/tracking/userLog.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 require_once api_get_path(SYS_CODE_PATH).'exercise/hotpotatoes.lib.php';
30 30
 
31 31
 if (isset($uInfo)) {
32
-    $interbreadcrumb[]= array(
32
+    $interbreadcrumb[] = array(
33 33
         'url'=>'../user/userInfo.php?uInfo='.Security::remove_XSS($uInfo), 
34 34
         "name"=> api_ucfirst(get_lang('Users'))
35 35
     );
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 /*]]>*/
51 51
 </style>";
52 52
 
53
-Display::display_header($nameTools,"Tracking");
53
+Display::display_header($nameTools, "Tracking");
54 54
 
55 55
 /*	Constants and variables */
56 56
 
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
 $is_course_member = CourseManager::is_user_subscribed_in_real_or_linked_course($user_id, $courseId);
59 59
 
60 60
 // Database Table Definitions
61
-$TABLECOURSUSER	        	= Database::get_main_table(TABLE_MAIN_COURSE_USER);
62
-$TABLEUSER	        		= Database::get_main_table(TABLE_MAIN_USER);
63
-$tbl_session_course_user 	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
64
-$tbl_session 				= Database::get_main_table(TABLE_MAIN_SESSION);
65
-$TABLECOURSE_GROUPSUSER 	= Database::get_course_table(TABLE_GROUP_USER);
61
+$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
62
+$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
63
+$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
64
+$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
65
+$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
66 66
 $now = api_get_utc_datetime();
67 67
 
68 68
 $sql = "SELECT 1
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
             OR (access_start_date='0000-00-00' AND access_end_date='0000-00-00'))
75 75
         WHERE session_id='".api_get_session_id()."' AND c_id = $courseId";
76 76
 //echo $sql;
77
-$result=Database::query($sql);
78
-if(!Database::num_rows($result)){
77
+$result = Database::query($sql);
78
+if (!Database::num_rows($result)) {
79 79
     $disabled = true;
80 80
 }
81 81
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
 $tbl_learnpath_view = Database::get_course_table(TABLE_LP_VIEW);
85 85
 $tbl_learnpath_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW);
86 86
 
87
-$documentPath=api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
87
+$documentPath = api_get_path(SYS_COURSE_PATH).$_course['path'].'/document';
88 88
 
89 89
 // The variables for the days and the months
90 90
 $DaysShort = api_get_week_days_short();
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
 <table width="100%" cellpadding="2" cellspacing="3" border="0">
110 110
 <?php
111 111
 // check if uid is tutor of this group
112
-if (( $is_allowedToTrack || $is_allowedToTrackEverybodyInCourse )) {
112
+if (($is_allowedToTrack || $is_allowedToTrackEverybodyInCourse)) {
113 113
     if (!$uInfo && !isset($uInfo)) {
114 114
         /*
115 115
         *		Display list of user of this group
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         $step = 25; // number of student per page
134 134
         if ($userGroupNb > $step) {
135 135
             if (!isset($offset)) {
136
-                    $offset=0;
136
+                    $offset = 0;
137 137
             }
138 138
 
139 139
             $next     = $offset + $step;
@@ -186,13 +186,13 @@  discard block
 block discarded – undo
186 186
         $list_users = getManyResults3Col($sql);
187 187
         echo "<table width='100%' cellpadding='2' cellspacing='1' border='0'>\n"
188 188
                     ."<tr align='center' valign='top' bgcolor='#E6E6E6'>\n"
189
-                    ."<td align='left'>",get_lang('UserName'),"</td>\n"
189
+                    ."<td align='left'>", get_lang('UserName'), "</td>\n"
190 190
                     ."</tr>\n";
191 191
         for ($i = 0; $i < sizeof($list_users); $i++) {
192 192
             echo    "<tr valign='top' align='center'>\n"
193 193
                     ."<td align='left'>"
194
-                    ."<a href='".api_get_self()."?uInfo=",$list_users[$i][0],"'>"
195
-                    .$list_users[$i][1]," ",$list_users[$i][2]
194
+                    ."<a href='".api_get_self()."?uInfo=", $list_users[$i][0], "'>"
195
+                    .$list_users[$i][1], " ", $list_users[$i][2]
196 196
                     ."</a>".
197 197
                     "</td>\n";
198 198
         }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
             ";
250 250
 
251 251
             if (!isset($view)) {
252
-                $view ='0000000';
252
+                $view = '0000000';
253 253
             }
254 254
             //Logins
255 255
             TrackingUserLog::display_login_tracking_info($view, $uInfo, $courseId);
@@ -281,8 +281,8 @@  discard block
 block discarded – undo
281 281
                 </tr>";
282 282
 
283 283
             $sql = "SELECT id, name FROM $tbl_learnpath_main";
284
-            $result=Database::query($sql);
285
-            $ar=Database::fetch_array($result);
284
+            $result = Database::query($sql);
285
+            $ar = Database::fetch_array($result);
286 286
 
287 287
             echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>";
288 288
             echo "<table cellpadding='2' cellspacing='1' border='0' align='center'><tr>
@@ -299,14 +299,14 @@  discard block
 block discarded – undo
299 299
                     if ($ar['id'] == $scormcontopen) {
300 300
                         //have to list the students here
301 301
                         $contentId = intval($ar['id']);
302
-                        $sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time " .
303
-                                "FROM $tbl_learnpath_item i " .
304
-                                "INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id " .
305
-                                "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id " .
302
+                        $sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time ".
303
+                                "FROM $tbl_learnpath_item i ".
304
+                                "INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id ".
305
+                                "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id ".
306 306
                                 "WHERE (v.user_id=".intval($uInfo)." and v.lp_id=$contentId)
307 307
                                 ORDER BY v.id, i.id";
308
-                        $result3=Database::query($sql3);
309
-                        $ar3=Database::fetch_array($result3);
308
+                        $result3 = Database::query($sql3);
309
+                        $ar3 = Database::fetch_array($result3);
310 310
                         if (is_array($ar3)) {
311 311
                             echo "<tr><td>&nbsp;&nbsp;&nbsp;</td>
312 312
                                    <td class='secLine'>
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
                                 echo "<tr><td>&nbsp;&nbsp;&nbsp;</td><td>";
329 329
                                 echo "$title</td><td align=right>{$ar3['status']}</td><td align=right>{$ar3['score']}</td><td align=right>$time</td>";
330 330
                                 echo "</tr>";
331
-                                $ar3=Database::fetch_array($result3);
331
+                                $ar3 = Database::fetch_array($result3);
332 332
                             }
333 333
                         } else {
334 334
                             echo "<tr>";
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
                     $ar = Database::fetch_array($result);
340 340
                 }
341 341
             } else {
342
-                $noscorm=true;
342
+                $noscorm = true;
343 343
             }
344 344
 
345 345
             if ($noscorm) {
Please login to merge, or discard this patch.
main/auth/openid/login.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     // Now that there is an association created, move on
65 65
     // to request authentication from the IdP
66 66
     $identity = (!empty($services[0]['delegate'])) ? $services[0]['delegate'] : $claimed_id;
67
-    if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0 . '/server', $services[0]['types'])) {
67
+    if (isset($services[0]['types']) && is_array($services[0]['types']) && in_array(OPENID_NS_2_0.'/server', $services[0]['types'])) {
68 68
         $identity = 'http://openid.net/identifier_select/2.0';
69 69
     }
70 70
     $authn_request = openid_authentication_request($claimed_id, $identity, $return_to, $assoc_handle, $services[0]['version']);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 
120 120
     $xrds_url = $claimed_id;
121 121
     if (_openid_is_xri($claimed_id)) {
122
-        $xrds_url = 'http://xri.net/' . $claimed_id;
122
+        $xrds_url = 'http://xri.net/'.$claimed_id;
123 123
     }
124 124
     $url = @parse_url($xrds_url);
125 125
     if ($url['scheme'] == 'http' || $url['scheme'] == 'https') {
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     //@todo Remove Old Associations:
183 183
     $openid_association = Database::get_main_table(TABLE_MAIN_OPENID_ASSOCIATION);
184 184
     $sql = "DELETE FROM $openid_association
185
-            WHERE created + expires_in < '" . api_get_utc_datetime() . "'";
185
+            WHERE created + expires_in < '".api_get_utc_datetime()."'";
186 186
     Database::query($sql);
187 187
 
188 188
     // Check to see if we have an association for this IdP already
@@ -339,17 +339,17 @@  discard block
 block discarded – undo
339 339
     switch ($uri['scheme']) {
340 340
         case 'http':
341 341
             $port = isset($uri['port']) ? $uri['port'] : 80;
342
-            $host = $uri['host'] . ($port != 80 ? ':' . $port : '');
342
+            $host = $uri['host'].($port != 80 ? ':'.$port : '');
343 343
             $fp = @fsockopen($uri['host'], $port, $errno, $errstr, 15);
344 344
             break;
345 345
         case 'https':
346 346
             // Note: Only works for PHP 4.3 compiled with OpenSSL.
347 347
             $port = isset($uri['port']) ? $uri['port'] : 443;
348
-            $host = $uri['host'] . ($port != 443 ? ':' . $port : '');
349
-            $fp = @fsockopen('ssl://' . $uri['host'], $port, $errno, $errstr, 20);
348
+            $host = $uri['host'].($port != 443 ? ':'.$port : '');
349
+            $fp = @fsockopen('ssl://'.$uri['host'], $port, $errno, $errstr, 20);
350 350
             break;
351 351
         default:
352
-            $result->error = 'invalid schema ' . $uri['scheme'];
352
+            $result->error = 'invalid schema '.$uri['scheme'];
353 353
             return $result;
354 354
     }
355 355
 
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
     // Construct the path to act on.
366 366
     $path = isset($uri['path']) ? $uri['path'] : '/';
367 367
     if (isset($uri['query'])) {
368
-        $path .= '?' . $uri['query'];
368
+        $path .= '?'.$uri['query'];
369 369
     }
370 370
 
371 371
     // Create HTTP request.
@@ -375,23 +375,23 @@  discard block
 block discarded – undo
375 375
         // host that do not take into account the port number.
376 376
         'Host' => "Host: $host",
377 377
         'User-Agent' => 'User-Agent: Chamilo (+http://www.chamilo.org/)',
378
-        'Content-Length' => 'Content-Length: ' . strlen($data)
378
+        'Content-Length' => 'Content-Length: '.strlen($data)
379 379
     );
380 380
 
381 381
     // If the server url has a user then attempt to use basic authentication
382 382
     if (isset($uri['user'])) {
383
-        $defaults['Authorization'] = 'Authorization: Basic ' . base64_encode($uri['user'] . (!empty($uri['pass']) ? ":" . $uri['pass'] : ''));
383
+        $defaults['Authorization'] = 'Authorization: Basic '.base64_encode($uri['user'].(!empty($uri['pass']) ? ":".$uri['pass'] : ''));
384 384
     }
385 385
 
386 386
     foreach ($headers as $header => $value) {
387
-        $defaults[$header] = $header . ': ' . $value;
387
+        $defaults[$header] = $header.': '.$value;
388 388
     }
389 389
 
390
-    $request = $method . ' ' . $path . " HTTP/1.0\r\n";
390
+    $request = $method.' '.$path." HTTP/1.0\r\n";
391 391
     $request .= implode("\r\n", $defaults);
392 392
     $request .= "\r\n\r\n";
393 393
     if ($data) {
394
-        $request .= $data . "\r\n";
394
+        $request .= $data."\r\n";
395 395
     }
396 396
     $result->request = $request;
397 397
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
         if (isset($result->headers[$header]) && $header == 'Set-Cookie') {
418 418
             // RFC 2109: the Set-Cookie response header comprises the token Set-
419 419
             // Cookie:, followed by a comma-separated list of one or more cookies.
420
-            $result->headers[$header] .= ',' . trim($value);
420
+            $result->headers[$header] .= ','.trim($value);
421 421
         } else {
422 422
             $result->headers[$header] = trim($value);
423 423
         }
Please login to merge, or discard this patch.
main/exercise/exercise_history.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,41 +10,41 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 require_once '../inc/global.inc.php';
13
-$this_section=SECTION_COURSES;
13
+$this_section = SECTION_COURSES;
14 14
 api_protect_course_script(true);
15 15
 
16 16
 // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
17 17
 $show = (isset($_GET['show']) && $_GET['show'] == 'result') ? 'result' : 'test';
18 18
 
19 19
 /* 	Constants and variables */
20
-$is_allowedToEdit = api_is_allowed_to_edit(null,true);
20
+$is_allowedToEdit = api_is_allowed_to_edit(null, true);
21 21
 $is_tutor = api_is_allowed_to_edit(true);
22 22
 
23
-if (!$is_allowedToEdit){
24
-    header('Location: ' . api_get_path(WEB_CODE_PATH) . 'exercise/exercise.php?' . api_get_cidreq());
23
+if (!$is_allowedToEdit) {
24
+    header('Location: '.api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq());
25 25
     exit;
26 26
 }
27 27
 
28
-$interbreadcrumb[]= array ('url' => 'exercise_report.php?'.api_get_cidreq(),'name' => get_lang('Exercises'));
29
-$interbreadcrumb[]= array ('url' => 'exercise_report.php?filter=2&'.api_get_cidreq(),'name' => get_lang('StudentScore'));
30
-$interbreadcrumb[]= array ('url' => 'exercise_history.php?exe_id='.intval($_GET['exe_id']).'&'.api_get_cidreq(), 'name' => get_lang('Details'));
28
+$interbreadcrumb[] = array('url' => 'exercise_report.php?'.api_get_cidreq(), 'name' => get_lang('Exercises'));
29
+$interbreadcrumb[] = array('url' => 'exercise_report.php?filter=2&'.api_get_cidreq(), 'name' => get_lang('StudentScore'));
30
+$interbreadcrumb[] = array('url' => 'exercise_history.php?exe_id='.intval($_GET['exe_id']).'&'.api_get_cidreq(), 'name' => get_lang('Details'));
31 31
 
32 32
 $TBL_USER          	    = Database::get_main_table(TABLE_MAIN_USER);
33
-$TBL_EXERCISES			= Database::get_course_table(TABLE_QUIZ_TEST);
33
+$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
34 34
 $TBL_EXERCISES_QUESTION	= Database::get_course_table(TABLE_QUIZ_QUESTION);
35
-$TBL_TRACK_ATTEMPT_RECORDING= Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
36
-Display::display_header($nameTools,get_lang('Exercise'));
35
+$TBL_TRACK_ATTEMPT_RECORDING = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
36
+Display::display_header($nameTools, get_lang('Exercise'));
37 37
 
38 38
 if (isset($_GET['message'])) {
39 39
     if (in_array($_GET['message'], array('ExerciseEdited'))) {
40
-        $my_message_history=Security::remove_XSS($_GET['message']);
40
+        $my_message_history = Security::remove_XSS($_GET['message']);
41 41
         Display::display_confirmation_message(get_lang($my_message_history));
42 42
     }
43 43
 }
44 44
 
45 45
 echo '<div class="actions">';
46
-echo '<a href="exercise_report.php?' . api_get_cidreq() . '&filter=2">' .
47
-    Display :: return_icon('back.png', get_lang('BackToResultList'),'',ICON_SIZE_MEDIUM).'</a>';
46
+echo '<a href="exercise_report.php?'.api_get_cidreq().'&filter=2">'.
47
+    Display :: return_icon('back.png', get_lang('BackToResultList'), '', ICON_SIZE_MEDIUM).'</a>';
48 48
 echo '</div>';
49 49
 
50 50
 ?>
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 <?php
61 61
 
62 62
 $sql = "SELECT *, quiz_question.question, firstname, lastname FROM $TBL_TRACK_ATTEMPT_RECORDING t, $TBL_USER,$TBL_EXERCISES_QUESTION quiz_question
63
-      WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY position";
63
+      WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int) $_GET['exe_id']."' ORDER BY position";
64 64
 $query = Database::query($sql);
65
-while($row = Database::fetch_array($query)){
65
+while ($row = Database::fetch_array($query)) {
66 66
     echo '<tr';
67 67
     if ($i % 2 == 0) {
68 68
         echo 'class="row_odd"';
Please login to merge, or discard this patch.
main/inc/introductionSection.inc.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
     if ($displayMode == '1') {
206 206
         // Show only the current course progress step
207 207
         // $information_title = get_lang('InfoAboutLastDoneAdvance');
208
-        $last_done_advance =  $thematic->get_last_done_thematic_advance();
208
+        $last_done_advance = $thematic->get_last_done_thematic_advance();
209 209
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
210 210
         $subTitle1 = get_lang('CurrentTopic');
211 211
         $class1 = ' current';
212
-    } else if($displayMode == '2') {
212
+    } else if ($displayMode == '2') {
213 213
         // Show only the two next course progress steps
214 214
         // $information_title = get_lang('InfoAboutNextAdvanceNotDone');
215 215
         $last_done_advance = $thematic->get_next_thematic_advance_not_done();
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
218 218
         $thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
219 219
         $subTitle1 = $subTitle2 = get_lang('NextTopic');
220
-    } else if($displayMode == '3') {
220
+    } else if ($displayMode == '3') {
221 221
         // Show the current and next course progress steps
222 222
         // $information_title = get_lang('InfoAboutLastDoneAdvanceAndNextAdvanceNotDone');
223
-        $last_done_advance =  $thematic->get_last_done_thematic_advance();
223
+        $last_done_advance = $thematic->get_last_done_thematic_advance();
224 224
         $next_advance_not_done = $thematic->get_next_thematic_advance_not_done();
225 225
         $thematic_advance_info = $thematic->get_thematic_advance_list($last_done_advance);
226 226
         $thematic_advance_info2 = $thematic->get_thematic_advance_list($next_advance_not_done);
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
 
232 232
     if (!empty($thematic_advance_info)) {
233 233
         $thematic_advance = get_lang('CourseThematicAdvance');
234
-        $thematicScore = $thematic->get_total_average_of_thematic_advances() . '%';
235
-        $thematicUrl = api_get_path(WEB_CODE_PATH) .
234
+        $thematicScore = $thematic->get_total_average_of_thematic_advances().'%';
235
+        $thematicUrl = api_get_path(WEB_CODE_PATH).
236 236
             'course_progress/index.php?action=thematic_details&'.api_get_cidreq();
237 237
         $thematic_info = $thematic->get_thematic_list(
238 238
             $thematic_advance_info['thematic_id']
@@ -247,13 +247,13 @@  discard block
 block discarded – undo
247 247
         );
248 248
         $userInfo = $_SESSION['_user'];
249 249
         $courseInfo = api_get_course_info();
250
-        $titleThematic = $thematic_advance .' : '. $courseInfo['name'] . ' <b>( '. $thematicScore .' )</b>';
250
+        $titleThematic = $thematic_advance.' : '.$courseInfo['name'].' <b>( '.$thematicScore.' )</b>';
251 251
 
252 252
 
253 253
 
254
-        $infoUser = '<div class="thematic-avatar"><img src="' . $userInfo['avatar'] . '" class="img-circle img-responsive"></div>';
254
+        $infoUser = '<div class="thematic-avatar"><img src="'.$userInfo['avatar'].'" class="img-circle img-responsive"></div>';
255 255
         $infoUser .= '<div class="progress">
256
-                        <div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore . ';">
256
+                        <div class="progress-bar progress-bar-danger" role="progressbar" style="width: ' . $thematicScore.';">
257 257
                         '.$thematicScore.'
258 258
                         </div>
259 259
                     </div>';
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
         $thematicItemOne = '
263 263
         <div class="col-md-6 items-progress">
264 264
             <div class="thematic-cont '.$class1.'">
265
-            <div class="topics">' . $subTitle1 . '</div>
266
-            <h4 class="title-topics">' . Display::returnFontAwesomeIcon('book') . $thematic_info['title'] . '</h4>
267
-            <p class="date">' .  Display::returnFontAwesomeIcon('calendar-o') . $thematic_advance_info['start_date'] . '</p>
268
-            <div class="views">' . Display::returnFontAwesomeIcon('file-text-o')  . strip_tags($thematic_advance_info['content']). '</div>
269
-            <p class="time">'. Display::returnFontAwesomeIcon('clock-o') . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
265
+            <div class="topics">' . $subTitle1.'</div>
266
+            <h4 class="title-topics">' . Display::returnFontAwesomeIcon('book').$thematic_info['title'].'</h4>
267
+            <p class="date">' .  Display::returnFontAwesomeIcon('calendar-o').$thematic_advance_info['start_date'].'</p>
268
+            <div class="views">' . Display::returnFontAwesomeIcon('file-text-o').strip_tags($thematic_advance_info['content']).'</div>
269
+            <p class="time">'. Display::returnFontAwesomeIcon('clock-o').get_lang('DurationInHours').' : '.$thematic_advance_info['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
270 270
             </div>
271 271
         </div>';
272 272
 
@@ -279,21 +279,21 @@  discard block
 block discarded – undo
279 279
                 <div class="col-md-6 items-progress">
280 280
                     <div class="thematic-cont">
281 281
                     <div class="topics">'.$subTitle2.'</div>
282
-                    <h4 class="title-topics">'. Display::returnFontAwesomeIcon('book')  . $thematic_info2['title'].'</h4>
283
-                    <p class="date">' . Display::returnFontAwesomeIcon('calendar-o') .$thematic_advance_info2['start_date'].'</p>
284
-                    <div class="views">' . Display::returnFontAwesomeIcon('file-text-o')  . strip_tags($thematic_advance_info2['content']).'</div>
285
-                    <p class="time">'. Display::returnFontAwesomeIcon('clock-o') .get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
282
+                    <h4 class="title-topics">'. Display::returnFontAwesomeIcon('book').$thematic_info2['title'].'</h4>
283
+                    <p class="date">' . Display::returnFontAwesomeIcon('calendar-o').$thematic_advance_info2['start_date'].'</p>
284
+                    <div class="views">' . Display::returnFontAwesomeIcon('file-text-o').strip_tags($thematic_advance_info2['content']).'</div>
285
+                    <p class="time">'. Display::returnFontAwesomeIcon('clock-o').get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
286 286
                     </div>
287 287
                 </div>';
288 288
         }
289 289
 
290 290
 
291 291
         $thematicPanel = '<div class="row">';
292
-        $thematicPanel .= '<div class="col-md-2">' . $infoUser . '</div>';
293
-        $thematicPanel .= '<div class="col-md-10"><div class="row">' . $thematicItemOne . $thematicItemTwo . '</div></div>';
292
+        $thematicPanel .= '<div class="col-md-2">'.$infoUser.'</div>';
293
+        $thematicPanel .= '<div class="col-md-10"><div class="row">'.$thematicItemOne.$thematicItemTwo.'</div></div>';
294 294
         $thematicPanel .= '</div>';
295 295
         $thematicPanel .= '<div class="separate">
296
-                        <a href="' . $thematicUrl . '" class="btn btn-default btn-block">' . get_lang('ShowFullCourseAdvance') . '</a>
296
+                        <a href="' . $thematicUrl.'" class="btn btn-default btn-block">'.get_lang('ShowFullCourseAdvance').'</a>
297 297
                     </div>';
298 298
         $thematicProgress = Display::panelCollapse($titleThematic, $thematicPanel, 'thematic', null, 'accordion-thematic', 'collapse-thematic', false);
299 299
     }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
     $editIconButton = Display::url(
311 311
         '<em class="fa fa-wrench"></em> ',
312 312
         api_get_path(WEB_CODE_PATH).'course_info/tools.php?'.api_get_cidreq(),
313
-        ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons') ]
313
+        ['class' => 'btn btn-default', 'title' => get_lang('CustomizeIcons')]
314 314
     );
315 315
 }
316 316
 
@@ -321,12 +321,12 @@  discard block
 block discarded – undo
321 321
         // Displays "Add intro" commands
322 322
         $toolbar = '<div class="btn-group pull-right" role="group">';
323 323
         if (!empty($courseId)) {
324
-            $textIntro  = '<a class="btn btn-default" title="' . get_lang('AddIntro') . '" href="'.api_get_self().'?' . api_get_cidreq().'&intro_cmdAdd=1">';
324
+            $textIntro  = '<a class="btn btn-default" title="'.get_lang('AddIntro').'" href="'.api_get_self().'?'.api_get_cidreq().'&intro_cmdAdd=1">';
325 325
             $textIntro .= '<em class="fa fa-file-text"></em> ';
326 326
             $textIntro .= "</a>";
327
-            $toolbar .= $textIntro . $editIconButton;
327
+            $toolbar .= $textIntro.$editIconButton;
328 328
         } else {
329
-            $toolbar .= '<a class="btn btn-default" href="' . api_get_self() . '?intro_cmdAdd=1">"' . get_lang('AddIntro') . '</a>';
329
+            $toolbar .= '<a class="btn btn-default" href="'.api_get_self().'?intro_cmdAdd=1">"'.get_lang('AddIntro').'</a>';
330 330
             $toolbar .= $editIconButton;
331 331
         }
332 332
         $toolbar .= '</div>';
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
                 '<a  class="btn btn-default" href="'.api_get_self().'?'.api_get_cidreq().'&intro_cmdEdit=1" title="'.get_lang('Modify').'">
340 340
                 <em class="fa fa-pencil"></em></a>';
341 341
             $toolbar .= $editIconButton;
342
-            $toolbar .="<a class=\"btn btn-default\" href=\"".api_get_self()."?".api_get_cidreq()."&intro_cmdDel=1\" onclick=\"javascript:
342
+            $toolbar .= "<a class=\"btn btn-default\" href=\"".api_get_self()."?".api_get_cidreq()."&intro_cmdDel=1\" onclick=\"javascript:
343 343
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
344 344
                 "')) return false;\"><em class=\"fa fa-trash-o\"></em></a>";
345 345
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
                 if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)).
354 354
                 "')) return false;\"><em class=\"fa fa-trash-o\"></em></a>";
355 355
         }
356
-        $toolbar .=  "</div>";
356
+        $toolbar .= "</div>";
357 357
         // Fix for chrome XSS filter for videos in iframes - BT#7930
358 358
         $browser = api_get_navigator();
359 359
         if (strpos($introduction_section, '<iframe') !== false && $browser['name'] == 'Chrome') {
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
     } else {
373 373
         if (api_is_allowed_to_edit()) {
374 374
             $introduction_section .= '<div class="help-course">';
375
-            $introduction_section .= get_lang('AddCustomCourseIntro') . ' ' . $textIntro;
375
+            $introduction_section .= get_lang('AddCustomCourseIntro').' '.$textIntro;
376 376
             $introduction_section .= '</div>';
377 377
         }
378 378
     }
Please login to merge, or discard this patch.
main/ticket/projects.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $form = TicketManager::getCategoryForm($url, $projectId);
64 64
         $formToString = $form->returnForm();
65 65
         if ($form->validate()) {
66
-            $values =$form->getSubmitValues();
66
+            $values = $form->getSubmitValues();
67 67
 
68 68
             $params = [
69 69
                 'name' => $values['name'],
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $form->setDefaults($cat);
96 96
         $formToString = $form->returnForm();
97 97
         if ($form->validate()) {
98
-            $values =$form->getSubmitValues();
98
+            $values = $form->getSubmitValues();
99 99
 
100 100
             $params = [
101 101
                 'name' => $values['name'],
Please login to merge, or discard this patch.
main/inc/lib/formvalidator/Rule/CompareFields.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,24 +6,24 @@
 block discarded – undo
6 6
  */
7 7
 class HTML_QuickForm_Compare_Fields extends HTML_QuickForm_Rule_Compare 
8 8
 {
9
-	/**
10
-	 * Function to check an array of fields 	 
11
-	 * @param   array of field names
9
+    /**
10
+     * Function to check an array of fields 	 
11
+     * @param   array of field names
12 12
      * @param   string operator ==, >=, etc
13 13
      * @param   string the value to compare
14
-	 * @return boolean True if date is valid
15
-	 */
16
-	function validate($values = [], $operator_and_max_value = null) {
14
+     * @return boolean True if date is valid
15
+     */
16
+    function validate($values = [], $operator_and_max_value = null) {
17 17
         if (is_array($values) && !empty($values) && !empty($operator_and_max_value)) {
18
-           $final_value = 0;
19
-           foreach ($values as $value) {
20
-               $final_value += $value;
21
-           }
22
-           $params = explode('@', $operator_and_max_value);
23
-           $operator    = $params[0];
24
-           $max_value   = $params[1];                      
25
-           return parent::validate(array($final_value, $max_value), $operator);
18
+            $final_value = 0;
19
+            foreach ($values as $value) {
20
+                $final_value += $value;
21
+            }
22
+            $params = explode('@', $operator_and_max_value);
23
+            $operator    = $params[0];
24
+            $max_value   = $params[1];                      
25
+            return parent::validate(array($final_value, $max_value), $operator);
26 26
         }
27 27
         return false;        
28
-	}
28
+    }
29 29
 }
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
main/course_progress/thematic_advance.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
     $form = new FormValidator(
23 23
         'thematic_advance',
24 24
         'POST',
25
-        api_get_self() . '?' . api_get_cidreq()
25
+        api_get_self().'?'.api_get_cidreq()
26 26
     );
27 27
     $form->addElement('header', $header_form);
28 28
     //$form->addElement('hidden', 'thematic_advance_token',$token);
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 
192 192
         $thematic = new Thematic();
193 193
         $thematic->set_thematic_advance_attributes(
194
-            isset($values['thematic_advance_id']) ? $values['thematic_advance_id']: null,
194
+            isset($values['thematic_advance_id']) ? $values['thematic_advance_id'] : null,
195 195
             $values['thematic_id'],
196 196
             $values['start_date_type'] == 1 && isset($values['attendance_select']) ? $values['attendance_select'] : 0,
197 197
             $values['content'],
@@ -210,13 +210,13 @@  discard block
 block discarded – undo
210 210
             }
211 211
         }
212 212
 
213
-        $redirectUrlParams = 'course_progress/index.php?' .  api_get_cidreq() . '&' .
213
+        $redirectUrlParams = 'course_progress/index.php?'.api_get_cidreq().'&'.
214 214
             http_build_query([
215 215
                 'action' => 'thematic_advance_list',
216 216
                 'thematic_id' => $values['thematic_id']
217 217
             ]);
218 218
 
219
-        header('Location: ' . api_get_path(WEB_CODE_PATH) . $redirectUrlParams);
219
+        header('Location: '.api_get_path(WEB_CODE_PATH).$redirectUrlParams);
220 220
         exit;
221 221
     }
222 222
 
@@ -226,10 +226,10 @@  discard block
 block discarded – undo
226 226
     // thematic advance list
227 227
     echo '<div class="actions">';
228 228
     echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;action=thematic_details">'.
229
-            Display::return_icon('back.png', get_lang("BackTo"),'',ICON_SIZE_MEDIUM).'</a>';
229
+            Display::return_icon('back.png', get_lang("BackTo"), '', ICON_SIZE_MEDIUM).'</a>';
230 230
     if (api_is_allowed_to_edit(false, true)) {
231 231
         echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;action=thematic_advance_add&amp;thematic_id='.$thematic_id.'"> '.
232
-            Display::return_icon('add.png', get_lang('NewThematicAdvance'),'',ICON_SIZE_MEDIUM).'</a>';
232
+            Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM).'</a>';
233 233
     }
234 234
     echo '</div>';
235 235
     $table = new SortableTable(
Please login to merge, or discard this patch.
main/lp/lp_add.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 }
74 74
 
75 75
 if (!empty($gradebook) && $gradebook == 'view') {
76
-    $interbreadcrumb[]= array (
76
+    $interbreadcrumb[] = array(
77 77
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
78 78
         'name' => get_lang('ToolGradebook')
79 79
     );
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 $form = new FormValidator(
98 98
     'lp_add',
99 99
     'post',
100
-    api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?'.api_get_cidreq()
100
+    api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?'.api_get_cidreq()
101 101
 );
102 102
 
103 103
 // Form title
@@ -126,17 +126,17 @@  discard block
 block discarded – undo
126 126
 
127 127
 // Start date
128 128
 $form->addElement('checkbox', 'activate_start_date_check', null, get_lang('EnableStartTime'), array('onclick' => 'activate_start_date()'));
129
-$form->addElement('html','<div id="start_date_div" style="display:block;">');
129
+$form->addElement('html', '<div id="start_date_div" style="display:block;">');
130 130
 $form->addDatePicker('publicated_on', get_lang('PublicationDate'));
131
-$form->addElement('html','</div>');
131
+$form->addElement('html', '</div>');
132 132
 
133 133
 //End date
134 134
 $form->addElement('checkbox', 'activate_end_date_check', null, get_lang('EnableEndTime'), array('onclick' => 'activate_end_date()'));
135
-$form->addElement('html','<div id="end_date_div" style="display:none;">');
135
+$form->addElement('html', '<div id="end_date_div" style="display:none;">');
136 136
 $form->addDatePicker('expired_on', get_lang('ExpirationDate'));
137
-$form->addElement('html','</div>');
137
+$form->addElement('html', '</div>');
138 138
 
139
-$form->addElement('html','</div>');
139
+$form->addElement('html', '</div>');
140 140
 
141 141
 $defaults['activate_start_date_check']  = 1;
142 142
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 }
148 148
 
149 149
 $defaults['publicated_on'] = date('Y-m-d 08:00:00');
150
-$defaults['expired_on'] = date('Y-m-d 08:00:00',time()+86400);
150
+$defaults['expired_on'] = date('Y-m-d 08:00:00', time() + 86400);
151 151
 
152 152
 $form->setDefaults($defaults);
153 153
 $form->addButtonCreate(get_lang('CreateLearningPath'));
Please login to merge, or discard this patch.