Completed
Push — 1.10.x ( 3658ba...81c9ff )
by
unknown
91:59 queued 46:43
created
main/forum/forumsearch.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 // Are we in a lp ?
41 41
 $origin = '';
42 42
 if (isset($_GET['origin'])) {
43
-    $origin =  Security::remove_XSS($_GET['origin']);
43
+    $origin = Security::remove_XSS($_GET['origin']);
44 44
 }
45 45
 
46 46
 // Name of the tool
@@ -48,12 +48,12 @@  discard block
 block discarded – undo
48 48
 
49 49
 // Breadcrumbs
50 50
 
51
-if (isset($_SESSION['gradebook'])){
51
+if (isset($_SESSION['gradebook'])) {
52 52
     $gradebook = $_SESSION['gradebook'];
53 53
 }
54 54
 
55 55
 if (!empty($gradebook) && $gradebook == 'view') {
56
-    $interbreadcrumb[] = array (
56
+    $interbreadcrumb[] = array(
57 57
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
58 58
         'name' => get_lang('ToolGradebook')
59 59
     );
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq(), 'name' => get_lang('Groups'));
67 67
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), 'name' => get_lang('GroupSpace').' ('.$group_properties['name'].')');
68 68
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?origin='.$origin.'&forum='.intval($_GET['forum']).'&'.api_get_cidreq(), 'name' => prepare4display($current_forum['forum_title']));
69
-    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(),'name' => get_lang('ForumSearch'));
69
+    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/forumsearch.php?'.api_get_cidreq(), 'name' => get_lang('ForumSearch'));
70 70
 } else {
71 71
     $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.api_get_cidreq(), 'name' => $nameTools);
72 72
     $nameTools = get_lang('ForumSearch');
Please login to merge, or discard this patch.
main/group/group_space.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 require_once '../inc/global.inc.php';
13
-$current_course_tool  = TOOL_GROUP;
13
+$current_course_tool = TOOL_GROUP;
14 14
 
15 15
 // Notice for unauthorized people.
16 16
 api_protect_course_script(true);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
 echo '<div class="actions">';
71 71
 echo '<a href="group.php">'.
72
-    Display::return_icon('back.png',get_lang('BackToGroupList'),'',ICON_SIZE_MEDIUM).
72
+    Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM).
73 73
     '</a>';
74 74
 
75 75
 /*
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  */
87 87
 $unsubscribe_group = '';
88 88
 if (GroupManager :: is_self_unregistration_allowed($user_id, $current_group['id'])) {
89
-    $unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."'".')) return false;">'.
89
+    $unsubscribe_group = '<a class="btn btn-default" href="'.api_get_self().'?selfUnReg=1" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."'".')) return false;">'.
90 90
         get_lang("StudentUnsubscribe").'</a>';
91 91
 }
92 92
 echo '&nbsp;</div>';
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
     GroupManager::is_tutor_of_group(api_get_user_id(), api_get_group_id())
99 99
 ) {
100 100
     $my_origin = isset($origin) ? $origin : '';
101
-    $edit_url =  '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'&origin='.$my_origin.'">'.
102
-        Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>';
101
+    $edit_url = '<a href="'.api_get_path(WEB_CODE_PATH).'group/settings.php?'.api_get_cidreq().'&origin='.$my_origin.'">'.
102
+        Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>';
103 103
 }
104 104
 
105 105
 echo Display::page_header(
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
     $forums_of_groups = get_forums_of_group($current_group['id']);
217 217
 
218 218
     if (is_array($forums_of_groups)) {
219
-        if ( $current_group['forum_state'] == GroupManager::TOOL_PUBLIC) {
219
+        if ($current_group['forum_state'] == GroupManager::TOOL_PUBLIC) {
220 220
             foreach ($forums_of_groups as $key => $value) {
221 221
                 if ($value['forum_group_public_private'] == 'public') {
222 222
                     $actions_array[] = array(
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 if (count($tutors) == 0) {
299 299
     $tutor_info = get_lang('GroupNoneMasc');
300 300
 } else {
301
-    isset($origin) ? $my_origin = $origin:$my_origin='';
301
+    isset($origin) ? $my_origin = $origin : $my_origin = '';
302 302
     $tutor_info .= '<ul class="thumbnails">';
303 303
     foreach ($tutors as $index => $tutor) {
304 304
         $userInfo = api_get_user_info($tutor['user_id']);
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
     global $current_group;
405 405
 
406 406
     // Database table definition
407
-    $table_group_user 	= Database :: get_course_table(TABLE_GROUP_USER);
408
-    $table_user 		= Database :: get_main_table(TABLE_MAIN_USER);
407
+    $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
408
+    $table_user = Database :: get_main_table(TABLE_MAIN_USER);
409 409
 
410 410
     $course_id = api_get_course_int_id();
411 411
 
Please login to merge, or discard this patch.
main/inc/lib/groupmanager.lib.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -221,8 +221,8 @@  discard block
 block discarded – undo
221 221
             $sql = "UPDATE $table_group SET id = iid WHERE iid = $lastId";
222 222
             Database::query($sql);
223 223
 
224
-            $desired_dir_name= '/'.api_replace_dangerous_char($name).'_groupdocs';
225
-            $my_path = api_get_path(SYS_COURSE_PATH) . $currentCourseRepository . '/document';
224
+            $desired_dir_name = '/'.api_replace_dangerous_char($name).'_groupdocs';
225
+            $my_path = api_get_path(SYS_COURSE_PATH).$currentCourseRepository.'/document';
226 226
 
227 227
             $newFolderData = create_unexisting_directory(
228 228
                 $_course,
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
                 $values['default_view_type_group']['default_view_type'] = api_get_setting('default_forum_view');
286 286
                 $values['group_forum'] = $lastId;
287 287
                 if ($forumState == '1') {
288
-                    $values['public_private_group_forum_group']['public_private_group_forum']='public';
288
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'public';
289 289
                 } elseif ($forumState == '2') {
290
-                    $values['public_private_group_forum_group']['public_private_group_forum']='private';
290
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'private';
291 291
                 } elseif ($forumState == '0') {
292
-                    $values['public_private_group_forum_group']['public_private_group_forum']='unavailable';
292
+                    $values['public_private_group_forum_group']['public_private_group_forum'] = 'unavailable';
293 293
                 }
294 294
                 store_forum($values);
295 295
             }
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
             1
321 321
         );
322 322
         $users = self::get_users($group_id);
323
-        $group_ids = array ();
323
+        $group_ids = array();
324 324
 
325
-        for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr ++) {
325
+        for ($group_nr = 1; $group_nr <= $number_of_groups; $group_nr++) {
326 326
             $group_ids[] = self::create_group(
327 327
                 get_lang('Subgroup').' '.$group_nr,
328 328
                 $category_id,
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 0,
367 367
                 count($users_ids)
368 368
             );
369
-            self::subscribe_users($users_ids,$group_id);
369
+            self::subscribe_users($users_ids, $group_id);
370 370
             $group_ids[] = $group_id;
371 371
         }
372 372
         return $group_ids;
@@ -391,14 +391,14 @@  discard block
 block discarded – undo
391 391
         $group_table = Database:: get_course_table(TABLE_GROUP);
392 392
         $forum_table = Database:: get_course_table(TABLE_FORUM);
393 393
 
394
-        $group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
395
-        $group_ids = array_map('intval',$group_ids);
394
+        $group_ids = is_array($group_ids) ? $group_ids : array($group_ids);
395
+        $group_ids = array_map('intval', $group_ids);
396 396
 
397 397
         if (api_is_course_coach()) {
398 398
             //a coach can only delete courses from his session
399
-            for ($i=0 ; $i<count($group_ids) ; $i++) {
400
-                if (!api_is_element_in_the_session(TOOL_GROUP,$group_ids[$i])) {
401
-                    array_splice($group_ids,$i,1);
399
+            for ($i = 0; $i < count($group_ids); $i++) {
400
+                if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])) {
401
+                    array_splice($group_ids, $i, 1);
402 402
                     $i--;
403 403
                 }
404 404
             }
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
         } elseif ($forum_state === 0) {
634 634
             $sql2 .= " forum_group_public_private='unavailable' ";
635 635
         }
636
-        $sql2 .=" WHERE c_id = $course_id AND forum_of_group=".$group_id;
636
+        $sql2 .= " WHERE c_id = $course_id AND forum_of_group=".$group_id;
637 637
         Database::query($sql2);
638 638
         return $result;
639 639
     }
@@ -662,13 +662,13 @@  discard block
 block discarded – undo
662 662
     public static function get_categories($course_code = null)
663 663
     {
664 664
         $course_info = api_get_course_info($course_code);
665
-        $course_id     = $course_info['real_id'];
665
+        $course_id = $course_info['real_id'];
666 666
         $table_group_cat = Database :: get_course_table(TABLE_GROUP_CATEGORY);
667 667
         $sql = "SELECT * FROM $table_group_cat
668 668
                 WHERE c_id = $course_id
669 669
                 ORDER BY display_order";
670 670
         $res = Database::query($sql);
671
-        $cats = array ();
671
+        $cats = array();
672 672
         while ($cat = Database::fetch_array($res)) {
673 673
             $cats[] = $cat;
674 674
         }
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
                 WHERE c_id = $course_id AND category_id='".$cat_id."'";
780 780
         $res = Database::query($sql);
781 781
         if (Database::num_rows($res) > 0) {
782
-            $groups_to_delete = array ();
782
+            $groups_to_delete = array();
783 783
             while ($group = Database::fetch_object($res)) {
784 784
                 $groups_to_delete[] = $group->id;
785 785
             }
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
      */
948 948
     public static function get_current_max_groups_per_user($category_id = null, $course_code = null)
949 949
     {
950
-        $course_info = api_get_course_info ($course_code);
950
+        $course_info = api_get_course_info($course_code);
951 951
         $group_table = Database :: get_course_table(TABLE_GROUP);
952 952
         $group_user_table = Database :: get_course_table(TABLE_GROUP_USER);
953 953
         $sql = 'SELECT COUNT(gu.group_id) AS current_max
@@ -1186,17 +1186,17 @@  discard block
 block discarded – undo
1186 1186
     {
1187 1187
         $_course = api_get_course_info();
1188 1188
 
1189
-        $group_ids = is_array($group_ids) ? $group_ids : array ($group_ids);
1189
+        $group_ids = is_array($group_ids) ? $group_ids : array($group_ids);
1190 1190
         $group_ids = array_map('intval', $group_ids);
1191 1191
 
1192 1192
         if (api_is_course_coach()) {
1193
-            for ($i=0 ; $i< count($group_ids) ; $i++) {
1194
-                if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])){
1195
-                    array_splice($group_ids,$i,1);
1193
+            for ($i = 0; $i < count($group_ids); $i++) {
1194
+                if (!api_is_element_in_the_session(TOOL_GROUP, $group_ids[$i])) {
1195
+                    array_splice($group_ids, $i, 1);
1196 1196
                     $i--;
1197 1197
                 }
1198 1198
             }
1199
-            if (count($group_ids)==0) {
1199
+            if (count($group_ids) == 0) {
1200 1200
                 return false;
1201 1201
             }
1202 1202
         }
@@ -1235,9 +1235,9 @@  discard block
 block discarded – undo
1235 1235
          * Retrieve course users (reverse) ordered by the number
1236 1236
          * of group they are already enrolled
1237 1237
          */
1238
-        for ($i = 0; $i < count($complete_user_list); $i ++) {
1238
+        for ($i = 0; $i < count($complete_user_list); $i++) {
1239 1239
             //find # of groups the user is enrolled in
1240
-            $number_of_groups = self :: user_in_number_of_groups($complete_user_list[$i]["user_id"], (isset($category['id'])?$category['id']:null));
1240
+            $number_of_groups = self :: user_in_number_of_groups($complete_user_list[$i]["user_id"], (isset($category['id']) ? $category['id'] : null));
1241 1241
             //add # of groups to user list
1242 1242
             $complete_user_list[$i]['number_groups_left'] = $number_groups_per_user - $number_of_groups;
1243 1243
         }
@@ -1249,7 +1249,7 @@  discard block
 block discarded – undo
1249 1249
 
1250 1250
         //now sort by # of group left
1251 1251
         $complete_user_list = TableSort :: sort_table($complete_user_list, 'number_groups_left', SORT_DESC);
1252
-        $userToken = array ();
1252
+        $userToken = array();
1253 1253
         foreach ($complete_user_list as $this_user) {
1254 1254
             if ($this_user['number_groups_left'] > 0) {
1255 1255
                 $userToken[$this_user['user_id']] = $this_user['number_groups_left'];
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
                 if ($category['groups_per_user'] == self::GROUP_PER_MEMBER_NO_LIMIT) {
1445 1445
                     $category['groups_per_user'] = self::INFINITE;
1446 1446
                 }
1447
-                $result = self:: user_in_number_of_groups($user_id, $category['id'] ) < $category['groups_per_user'];
1447
+                $result = self:: user_in_number_of_groups($user_id, $category['id']) < $category['groups_per_user'];
1448 1448
                 if ($result == false) {
1449 1449
                     return false;
1450 1450
                 }
@@ -1555,7 +1555,7 @@  discard block
 block discarded – undo
1555 1555
                     tg.group_id='".$group_id."' AND
1556 1556
                     tg.user_id=u.user_id".$order_clause;
1557 1557
         $db_result = Database::query($sql);
1558
-        $users = array ();
1558
+        $users = array();
1559 1559
         while ($user = Database::fetch_object($db_result)) {
1560 1560
             if (!$id_only) {
1561 1561
                 $member['user_id'] = $user->user_id;
@@ -1620,8 +1620,8 @@  discard block
 block discarded – undo
1620 1620
         foreach ($user_ids as $user_id) {
1621 1621
             $user_id = intval($user_id);
1622 1622
             if (self::can_user_subscribe($user_id, $group_id, false)) {
1623
-                $sql = "INSERT INTO " . $table_group_tutor . " (c_id, user_id, group_id)
1624
-                        VALUES ('$course_id', '" . $user_id . "', '" . $group_id . "')";
1623
+                $sql = "INSERT INTO ".$table_group_tutor." (c_id, user_id, group_id)
1624
+                        VALUES ('$course_id', '".$user_id."', '".$group_id."')";
1625 1625
                 $result &= Database::query($sql);
1626 1626
             }
1627 1627
         }
@@ -1637,7 +1637,7 @@  discard block
 block discarded – undo
1637 1637
      */
1638 1638
     public static function unsubscribe_users($user_ids, $group_id)
1639 1639
     {
1640
-        $user_ids = is_array($user_ids) ? $user_ids : array ($user_ids);
1640
+        $user_ids = is_array($user_ids) ? $user_ids : array($user_ids);
1641 1641
         $table_group_user = Database :: get_course_table(TABLE_GROUP_USER);
1642 1642
         $group_id = intval($group_id);
1643 1643
         $course_id = api_get_course_int_id();
@@ -2183,7 +2183,7 @@  discard block
 block discarded – undo
2183 2183
          * Retrieve course users (reverse) ordered by the number
2184 2184
          * of group they are already enrolled
2185 2185
          */
2186
-        for ($i = 0; $i < count($complete_user_list); $i ++) {
2186
+        for ($i = 0; $i < count($complete_user_list); $i++) {
2187 2187
             // find # of groups the user is enrolled in
2188 2188
             $number_of_groups = self:: user_in_number_of_groups(
2189 2189
                 $complete_user_list[$i]["user_id"],
@@ -2315,14 +2315,14 @@  discard block
 block discarded – undo
2315 2315
                 !(api_is_course_coach() && intval($this_group['session_id']) != $session_id)
2316 2316
             ) {
2317 2317
                 $edit_actions = '<a href="'.$url.'settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'"  title="'.get_lang('Edit').'">'.
2318
-                    Display::return_icon('edit.png', get_lang('EditGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2318
+                    Display::return_icon('edit.png', get_lang('EditGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2319 2319
 
2320 2320
                 if ($this_group['status'] == 1) {
2321
-                    $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true,false) . '&category=' . $category_id . '&action=set_invisible&id=' . $this_group['id'] . '" title="' . get_lang('Hide') . '">' .
2322
-                        Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
2321
+                    $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_invisible&id='.$this_group['id'].'" title="'.get_lang('Hide').'">'.
2322
+                        Display::return_icon('visible.png', get_lang('Hide'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2323 2323
                 } else {
2324
-                    $edit_actions .= '<a href="' . api_get_self() . '?' . api_get_cidreq(true, false) . '&category=' . $category_id . '&action=set_visible&id=' . $this_group['id'] . '" title="' . get_lang('Show') . '">' .
2325
-                        Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>&nbsp;';
2324
+                    $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=set_visible&id='.$this_group['id'].'" title="'.get_lang('Show').'">'.
2325
+                        Display::return_icon('invisible.png', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2326 2326
                 }
2327 2327
 
2328 2328
                 $edit_actions .= '<a href="'.$url.'member_settings.php?'.api_get_cidreq(true, false).'&gidReq='.$this_group['id'].'"  title="'.get_lang('GroupMembers').'">'.
@@ -2335,10 +2335,10 @@  discard block
 block discarded – undo
2335 2335
                     Display::return_icon('clean.png',get_lang('EmptyGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';*/
2336 2336
 
2337 2337
                 $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=fill_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('FillGroup').'">'.
2338
-                    Display::return_icon('fill.png',get_lang('FillGroup'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2338
+                    Display::return_icon('fill.png', get_lang('FillGroup'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2339 2339
 
2340 2340
                 $edit_actions .= '<a href="'.api_get_self().'?'.api_get_cidreq(true, false).'&category='.$category_id.'&action=delete_one&id='.$this_group['id'].'" onclick="javascript: if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('Delete').'">'.
2341
-                    Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>&nbsp;';
2341
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>&nbsp;';
2342 2342
 
2343 2343
                 $row[] = $edit_actions;
2344 2344
             }
@@ -2710,7 +2710,7 @@  discard block
 block discarded – undo
2710 2710
         $activeTutor = null;
2711 2711
         $activeMember = null;
2712 2712
 
2713
-        switch($default) {
2713
+        switch ($default) {
2714 2714
             case 'settings':
2715 2715
                 $activeSettings = 'active';
2716 2716
                 break;
Please login to merge, or discard this patch.
main/document/slideshow.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 if ($slide_id != 'all') {
65 65
 	$image = null;
66 66
 	if (isset($image_files_only[$slide])) {
67
-		$image = $sys_course_path . $_course['path'] . '/document' . $folder . $image_files_only[$slide];
67
+		$image = $sys_course_path.$_course['path'].'/document'.$folder.$image_files_only[$slide];
68 68
 	}
69 69
 	if (file_exists($image)) {
70 70
 		echo '<div class="actions-pagination">';
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
             $last = Display::return_icon('action_last_na.png', get_lang('LastSlide'));
106 106
 		} else {
107 107
 			$imgn = 'action_next.png';
108
-			$last = '<a href="slideshow.php?slide_id='.($total_slides-1).'&curdirpath='.$pathurl.'">
108
+			$last = '<a href="slideshow.php?slide_id='.($total_slides - 1).'&curdirpath='.$pathurl.'">
109 109
 			        '.Display::return_icon('action_last.png', get_lang('LastSlide')).'
110 110
                 </a>';
111 111
 		}
@@ -122,18 +122,18 @@  discard block
 block discarded – undo
122 122
 
123 123
 // Exit the slideshow
124 124
 echo '<a href="document.php?action=exit_slideshow&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
125
-    Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
125
+    Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('DocumentsOverview'), '', ICON_SIZE_MEDIUM).'</a>';
126 126
 
127 127
 // Show thumbnails
128 128
 if ($slide_id != 'all') {
129 129
 	echo '<a href="slideshow.php?slide_id=all&curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
130
-        Display::return_icon('thumbnails.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM).'</a>';
130
+        Display::return_icon('thumbnails.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM).'</a>';
131 131
 } else {
132
-	echo Display::return_icon('thumbnails_na.png',get_lang('ShowThumbnails'),'',ICON_SIZE_MEDIUM);
132
+	echo Display::return_icon('thumbnails_na.png', get_lang('ShowThumbnails'), '', ICON_SIZE_MEDIUM);
133 133
 }
134 134
 // Slideshow options
135 135
 echo '<a href="slideshowoptions.php?curdirpath='.$pathurl.'&'.api_get_cidreq().'">'.
136
-    Display::return_icon('settings.png', get_lang('SetSlideshowOptions'),'',ICON_SIZE_MEDIUM).'</a>';
136
+    Display::return_icon('settings.png', get_lang('SetSlideshowOptions'), '', ICON_SIZE_MEDIUM).'</a>';
137 137
 
138 138
 echo '</div>';
139 139
 echo '<br />';
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 }
158 158
 $target_width = $target_height = null;
159 159
 // The target height and width depends if we choose resizing or no resizing
160
-if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == "resizing") {
160
+if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == "resizing") {
161 161
 	$target_width = $_SESSION["image_resizing_width"];
162 162
 	$target_height = $_SESSION["image_resizing_height"];
163 163
 }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 /*	THUMBNAIL VIEW */
166 166
 
167 167
 // This is for viewing all the images in the slideshow as thumbnails.
168
-$image_tag = array ();
168
+$image_tag = array();
169 169
 $html = '';
170 170
 if ($slide_id == 'all') {
171 171
 
@@ -174,14 +174,14 @@  discard block
 block discarded – undo
174 174
 	$max_thumbnail_width     = 250;
175 175
 	$max_thumbnail_height    = 250;
176 176
 	$png_compression	     = 0; // 0(none)-9
177
-	$jpg_quality  	         = 75; // from 0 to 100 (default is 75). More quality less compression
177
+	$jpg_quality = 75; // from 0 to 100 (default is 75). More quality less compression
178 178
 
179 179
 	$directory_thumbnails = $sys_course_path.$_course['path'].'/document'.$folder.'.thumbs/';
180 180
 
181 181
 	//Other parameters only for show tumbnails
182
-	$row_items 			     = 4;//only in slideshow.php
183
-	$number_image 			 = 7;//num icons cols to show
184
-	$thumbnail_width_frame = $max_thumbnail_width;//optional $max_thumbnail_width+x
182
+	$row_items = 4; //only in slideshow.php
183
+	$number_image = 7; //num icons cols to show
184
+	$thumbnail_width_frame = $max_thumbnail_width; //optional $max_thumbnail_width+x
185 185
 	$thumbnail_height_frame = $max_thumbnail_height;
186 186
 
187 187
 	// Create the template_thumbnails folder (if no exist)
@@ -195,20 +195,20 @@  discard block
 block discarded – undo
195 195
 
196 196
 		foreach ($image_files_only as $one_image_file) {
197 197
 			$image = $sys_course_path.$_course['path'].'/document'.$folder.$one_image_file;
198
-			$image_thumbnail= $directory_thumbnails.'.'.$one_image_file;
198
+			$image_thumbnail = $directory_thumbnails.'.'.$one_image_file;
199 199
 
200 200
 			if (file_exists($image)) {
201 201
 				//check thumbnail
202 202
 				$imagetype = explode(".", $image);
203 203
                 //or check $imagetype = image_type_to_extension(exif_imagetype($image), false);
204
-				$imagetype = strtolower($imagetype[count($imagetype)-1]);
204
+				$imagetype = strtolower($imagetype[count($imagetype) - 1]);
205 205
 
206
-				if (in_array($imagetype,$allowed_thumbnail_types)) {
207
-					if (!file_exists($image_thumbnail)){
206
+				if (in_array($imagetype, $allowed_thumbnail_types)) {
207
+					if (!file_exists($image_thumbnail)) {
208 208
                         //run each once we view thumbnails is too heavy, then need move into  !file_exists($image_thumbnail, and only run when haven't the thumbnail
209 209
 						$original_image_size = api_getimagesize($image);
210 210
 
211
-						switch($imagetype) {
211
+						switch ($imagetype) {
212 212
 							case 'gif':
213 213
 								$source_img = imagecreatefromgif($image);
214 214
 								break;
@@ -229,17 +229,17 @@  discard block
 block discarded – undo
229 229
                             $max_thumbnail_width,
230 230
                             $max_thumbnail_height
231 231
                         );
232
-						if ($max_thumbnail_width>$original_image_size['width'] && $max_thumbnail_height>$original_image_size['height']){
233
-							$new_thumbnail_size['width']=$original_image_size['width'];
234
-							$new_thumbnail_size['height']=$original_image_size['height'];
232
+						if ($max_thumbnail_width > $original_image_size['width'] && $max_thumbnail_height > $original_image_size['height']) {
233
+							$new_thumbnail_size['width'] = $original_image_size['width'];
234
+							$new_thumbnail_size['height'] = $original_image_size['height'];
235 235
 						}
236 236
 
237 237
 						$crop = imagecreatetruecolor($new_thumbnail_size['width'], $new_thumbnail_size['height']);
238 238
 
239 239
 						// preserve transparency
240
-						if ($imagetype == "png"){
240
+						if ($imagetype == "png") {
241 241
 							imagesavealpha($crop, true);
242
-							$color = imagecolorallocatealpha($crop,0x00,0x00,0x00,127);
242
+							$color = imagecolorallocatealpha($crop, 0x00, 0x00, 0x00, 127);
243 243
 							imagefill($crop, 0, 0, $color);
244 244
 						}
245 245
 
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 							$transindex = imagecolortransparent($source_img);
248 248
                             $palletsize = imagecolorstotal($source_img);
249 249
 							 //GIF89a for transparent and anim (first clip), either GIF87a
250
-							 if ($transindex >= 0 && $transindex < $palletsize){
250
+							 if ($transindex >= 0 && $transindex < $palletsize) {
251 251
 								 $transcol = imagecolorsforindex($source_img, $transindex);
252 252
 								 $transindex = imagecolorallocatealpha($crop, $transcol['red'], $transcol['green'], $transcol['blue'], 127);
253 253
 								 imagefill($crop, 0, 0, $transindex);
@@ -271,16 +271,16 @@  discard block
 block discarded – undo
271 271
 
272 272
 						switch ($imagetype) {
273 273
 							case 'gif':
274
-								imagegif($crop,$image_thumbnail);
274
+								imagegif($crop, $image_thumbnail);
275 275
 								break;
276 276
 							case 'jpg':
277
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
277
+								imagejpeg($crop, $image_thumbnail, $jpg_quality);
278 278
 								break;
279 279
 							case 'jpeg':
280
-								imagejpeg($crop,$image_thumbnail,$jpg_quality);
280
+								imagejpeg($crop, $image_thumbnail, $jpg_quality);
281 281
 								break;
282 282
 							case 'png':
283
-								imagepng($crop,$image_thumbnail,$png_compression);
283
+								imagepng($crop, $image_thumbnail, $png_compression);
284 284
 								break;
285 285
 						}
286 286
 
@@ -290,26 +290,26 @@  discard block
 block discarded – undo
290 290
 
291 291
 					//show thumbnail and link
292 292
 
293
-					$one_image_thumbnail_file='.thumbs/.'.$one_image_file;//get path thumbnail
293
+					$one_image_thumbnail_file = '.thumbs/.'.$one_image_file; //get path thumbnail
294 294
 					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_thumbnail_file : $path.$one_image_thumbnail_file;
295 295
 					$image_tag[] = '<img class="img-gallery" src="download.php?doc_url='.$doc_url.'" border="0" title="'.$one_image_file.'">';
296 296
 				} else {
297 297
 					//if images aren't support by gd (not gif, jpg, jpeg, png)
298
-					if ($imagetype=="bmp") {
298
+					if ($imagetype == "bmp") {
299 299
                         // use getimagesize instead api_getimagesize($image); becasuse api_getimagesize doesn't support bmp files. Put here for each show, only for a few bmp files isn't heavy
300 300
 						$original_image_size = getimagesize($image);
301
-						if ($max_thumbnail_width<$original_image_size[0] || $max_thumbnail_height<$original_image_size[1]){
302
-							$thumbnail_size=api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height);//don't use resize_image because doesn't run with bmp files
301
+						if ($max_thumbnail_width < $original_image_size[0] || $max_thumbnail_height < $original_image_size[1]) {
302
+							$thumbnail_size = api_calculate_image_size($original_image_size[0], $original_image_size[1], $max_thumbnail_width, $max_thumbnail_height); //don't use resize_image because doesn't run with bmp files
303 303
 							$image_height = $thumbnail_size['height'];
304 304
 							$image_width  = $thumbnail_size['width'];
305 305
 						} else {
306
-							$image_height=$original_image_size[0];
307
-							$image_width=$original_image_size[1];
306
+							$image_height = $original_image_size[0];
307
+							$image_width = $original_image_size[1];
308 308
 						}
309 309
 					} else {
310 310
 						//example for svg files,...
311
-						$image_width=$max_thumbnail_width;
312
-						$image_height=$max_thumbnail_height;
311
+						$image_width = $max_thumbnail_width;
312
+						$image_height = $max_thumbnail_height;
313 313
 					}
314 314
 
315 315
 					$doc_url = ($path && $path !== '/') ? $path.'/'.$one_image_file : $path.$one_image_file;
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 
326 326
 	$i = 0;
327 327
 	$count_image = count($image_tag);
328
-	$number_iteration = ceil($count_image/$number_image);
328
+	$number_iteration = ceil($count_image / $number_image);
329 329
 	$p = 0;
330 330
     $html = '';
331 331
     $html .= '<div class="gallery">';
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                             $html .= '<a class="canvas-two" href="slideshow.php?slide_id='.$p.'&curdirpath='.$pathurl.'">';
338 338
                             $html .= '<div class="frame">';
339 339
                             $html .= '<div class="photo">';
340
-                            $html .=  $image_tag[$p];
340
+                            $html .= $image_tag[$p];
341 341
                             $html .= '</div>';
342 342
                             $html .= '</div>';
343 343
                             $html .= '</a>';
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 
393 393
 		list($width, $height) = getimagesize($image);
394 394
 		// Auto resize
395
-		if (isset($_SESSION["image_resizing"]) &&  $_SESSION["image_resizing"] == 'resizing') {
395
+		if (isset($_SESSION["image_resizing"]) && $_SESSION["image_resizing"] == 'resizing') {
396 396
 		?>
397 397
 
398 398
 		<script type="text/javascript">
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 				start_height=initial_height;
410 410
 			}
411 411
 
412
-			document.write('<img id="image"  src="<?php echo  'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'"  border="0"  alt="<?php echo $image_files_only[$slide] ;?>">');
412
+			document.write('<img id="image"  src="<?php echo  'download.php?doc_url='.$path.'/'.$image_files_only[$slide]; ?>" width="'+start_width+'" height="'+start_height+'"  border="0"  alt="<?php echo $image_files_only[$slide]; ?>">');
413 413
 
414 414
 			function resizeImage() {
415 415
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 		echo '</a>';
454 454
         echo '<div class="caption text-center">';
455 455
         echo Display::tag('h3', $row['title']);
456
-        echo '<p>' . $row['comment'] . '</p>';
456
+        echo '<p>'.$row['comment'].'</p>';
457 457
         echo '</div>';
458 458
         echo '</div>';
459 459
 
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
                 $resize_info = get_lang('Resizing').'<br />';
467 467
                 $resize_width = $_SESSION["image_resizing_width"].' x ';
468 468
                 $resize_height = $_SESSION['image_resizing_height'];
469
-            } elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing'){
469
+            } elseif (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing'] != 'noresizing') {
470 470
                 $resize_info = get_lang('Resizing').'<br />';
471 471
                 $resize_width = get_lang('Auto').' x ';
472 472
                 $resize_height = get_lang('Auto');
@@ -477,10 +477,10 @@  discard block
 block discarded – undo
477 477
             }
478 478
 
479 479
             echo '<li class="text-center">';
480
-            echo $image_files_only[$slide] . ' ';
480
+            echo $image_files_only[$slide].' ';
481 481
             echo Display::toolbarButton(
482 482
                 get_lang('Modify'),
483
-                'edit_document.php?' . api_get_cidreq() . '&' . http_build_query([
483
+                'edit_document.php?'.api_get_cidreq().'&'.http_build_query([
484 484
                     'id' => $row['id'],
485 485
                     'origin' => 'slideshow',
486 486
                     'origin_opt' => $edit_slide_id,
@@ -492,11 +492,11 @@  discard block
 block discarded – undo
492 492
                 false
493 493
             );
494 494
             echo '</li>';
495
-            echo '<li class="text-center">' . $width.' x '.$height . '</li>';
496
-			echo '<li class="text-center">' . round((filesize($image) / 1024), 2) . ' KB - ' . $ext . '</li>';
497
-            echo '<li class="text-center">' . $resize_info . '</li>';
498
-			echo '<li class="text-center">' . $resize_width . '</li>';
499
-			echo '<li class="text-center">' . $resize_height . '</li>';
495
+            echo '<li class="text-center">'.$width.' x '.$height.'</li>';
496
+			echo '<li class="text-center">'.round((filesize($image) / 1024), 2).' KB - '.$ext.'</li>';
497
+            echo '<li class="text-center">'.$resize_info.'</li>';
498
+			echo '<li class="text-center">'.$resize_width.'</li>';
499
+			echo '<li class="text-center">'.$resize_height.'</li>';
500 500
             echo '</ul>';
501 501
 		}
502 502
 
Please login to merge, or discard this patch.
main/inc/lib/tracking.lib.php 1 patch
Spacing   +423 added lines, -423 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         $extendedAttempt = null,
112 112
         $extendedAll = null,
113 113
         $type = 'classic',
114
-        $allowExtend =  true
114
+        $allowExtend = true
115 115
     ) {
116 116
         if (empty($courseInfo) || empty($lp_id)) {
117 117
             return null;
@@ -135,22 +135,22 @@  discard block
 block discarded – undo
135 135
         $extend_all = 0;
136 136
 
137 137
         if ($origin == 'tracking') {
138
-            $url_suffix = '&session_id=' . $session_id . '&course=' . $courseCode . '&student_id=' . $user_id . '&lp_id=' . $lp_id . '&origin=' . $origin;
138
+            $url_suffix = '&session_id='.$session_id.'&course='.$courseCode.'&student_id='.$user_id.'&lp_id='.$lp_id.'&origin='.$origin;
139 139
         } else {
140
-            $url_suffix = '&lp_id=' . $lp_id;
140
+            $url_suffix = '&lp_id='.$lp_id;
141 141
         }
142 142
 
143 143
         if (!empty($extendedAll)) {
144 144
             $extend_all_link = Display::url(
145 145
                 Display::return_icon('view_less_stats.gif', get_lang('HideAllAttempts')),
146
-                api_get_self() . '?action=stats' . $url_suffix
146
+                api_get_self().'?action=stats'.$url_suffix
147 147
             );
148 148
 
149 149
             $extend_all = 1;
150 150
         } else {
151 151
             $extend_all_link = Display::url(
152 152
                 Display::return_icon('view_more_stats.gif', get_lang('ShowAllAttempts')),
153
-                api_get_self() . '?action=stats&extend_all=1' . $url_suffix
153
+                api_get_self().'?action=stats&extend_all=1'.$url_suffix
154 154
             );
155 155
         }
156 156
 
@@ -162,24 +162,24 @@  discard block
 block discarded – undo
162 162
 
163 163
         $actionColumn = null;
164 164
         if ($type == 'classic') {
165
-            $actionColumn = ' <th>' . get_lang('Actions') . '</th>';
165
+            $actionColumn = ' <th>'.get_lang('Actions').'</th>';
166 166
         }
167 167
         $output .= '<div class="table-responsive">';
168 168
         $output .= '<table class="table tracking">
169 169
             <thead>
170 170
             <tr class="table-header">
171
-                <th width="16">' . ($allowExtend == true ? $extend_all_link : '&nbsp;') . '</th>
171
+                <th width="16">' . ($allowExtend == true ? $extend_all_link : '&nbsp;').'</th>
172 172
                 <th colspan="4">
173
-                    ' . get_lang('ScormLessonTitle') .'
173
+                    ' . get_lang('ScormLessonTitle').'
174 174
                 </th>
175 175
                 <th colspan="2">
176
-                    ' . get_lang('ScormStatus') . '
176
+                    ' . get_lang('ScormStatus').'
177 177
                 </th>
178 178
                 <th colspan="2">
179
-                    ' . get_lang('ScormScore') . '
179
+                    ' . get_lang('ScormScore').'
180 180
                 </th>
181 181
                 <th colspan="2">
182
-                    ' . get_lang('ScormTime') . '
182
+                    ' . get_lang('ScormTime').'
183 183
                 </th>
184 184
                 '.$actionColumn.'
185 185
                 </tr>
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                 // Prepare statement to go through each attempt.
243 243
                 $viewCondition = null;
244 244
                 if (!empty($view)) {
245
-                    $viewCondition =  " AND v.view_count = $view  ";
245
+                    $viewCondition = " AND v.view_count = $view  ";
246 246
                 }
247 247
 
248 248
                 $sql = "SELECT
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                                 FROM $TBL_QUIZ
291 291
                                 WHERE
292 292
                                     c_id = $course_id AND
293
-                                    id ='" . $my_path . "'";
293
+                                    id ='".$my_path."'";
294 294
                         $res_result_disabled = Database::query($sql);
295 295
                         $row_result_disabled = Database::fetch_row($res_result_disabled);
296 296
 
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
                     if (!empty($inter_num)) {
313 313
                         $extend_link = Display::url(
314 314
                               Display::return_icon('visible.gif', get_lang('HideAttemptView')),
315
-                              api_get_self() . '?action=stats&fold_id=' . $my_item_id . $url_suffix
315
+                              api_get_self().'?action=stats&fold_id='.$my_item_id.$url_suffix
316 316
                         );
317 317
                     }
318 318
                     $title = $row['mytitle'];
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 
331 331
                     $action = null;
332 332
                     if ($type == 'classic') {
333
-                        $action =  '<td></td>';
333
+                        $action = '<td></td>';
334 334
                     }
335 335
 
336 336
                     if (in_array($row['item_type'], $chapterTypes)) {
@@ -374,13 +374,13 @@  discard block
 block discarded – undo
374 374
                                 $extend_this_attempt = 1;
375 375
                                 $extend_attempt_link = Display::url(
376 376
                                     Display::return_icon('visible.gif', get_lang('HideAttemptView')),
377
-                                    api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix
377
+                                    api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix
378 378
                                 );
379 379
                             } else { // Same case if fold_attempt_id is set, so not implemented explicitly.
380 380
                                 // The extend button for this attempt has not been clicked.
381 381
                                 $extend_attempt_link = Display::url(
382 382
                                     Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')),
383
-                                    api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix
383
+                                    api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix
384 384
                                 );
385 385
                             }
386 386
                         }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
                         }
414 414
 
415 415
                         // Remove "NaN" if any (@todo: locate the source of these NaN)
416
-                        $time = str_replace('NaN', '00' . $h . '00\'00"', $time);
416
+                        $time = str_replace('NaN', '00'.$h.'00\'00"', $time);
417 417
 
418 418
                         if ($row['item_type'] != 'dokeos_chapter') {
419 419
                             if (!$is_allowed_to_edit && $result_disabled_ext_all) {
@@ -441,13 +441,13 @@  discard block
 block discarded – undo
441 441
                                 $action = '<td></td>';
442 442
                             }
443 443
 
444
-                            $output .= '<tr class="' . $oddclass . '">
444
+                            $output .= '<tr class="'.$oddclass.'">
445 445
                                     <td></td>
446
-                                    <td>' . $extend_attempt_link . '</td>
447
-                                    <td colspan="3">' . get_lang('Attempt') . ' ' . $attemptCount . '</td>
448
-                                    <td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type) . '</td>
449
-                                    <td colspan="2">' . $view_score . '</td>
450
-                                    <td colspan="2">' . $time . '</td>
446
+                                    <td>' . $extend_attempt_link.'</td>
447
+                                    <td colspan="3">' . get_lang('Attempt').' '.$attemptCount.'</td>
448
+                                    <td colspan="2">' . learnpathItem::humanize_status($lesson_status, true, $type).'</td>
449
+                                    <td colspan="2">' . $view_score.'</td>
450
+                                    <td colspan="2">' . $time.'</td>
451 451
                                     '.$action.'
452 452
                                 </tr>';
453 453
                             $attemptCount++;
@@ -460,10 +460,10 @@  discard block
 block discarded – undo
460 460
                                     if (!$is_allowed_to_edit && $result_disabled_ext_all) {
461 461
                                         $temp[] = '/';
462 462
                                     } else {
463
-                                        $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
463
+                                        $temp[] = ($score == 0 ? '0/'.$maxscore : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1)));
464 464
                                     }
465 465
                                 } else {
466
-                                    $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
466
+                                    $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1)));
467 467
                                 }
468 468
                                 $temp[] = $time;
469 469
                                 $csv_content[] = $temp;
@@ -500,13 +500,13 @@  discard block
 block discarded – undo
500 500
                                         <td></td>
501 501
                                         <td></td>
502 502
                                         <td></td>
503
-                                        <td>'.$interaction['order_id'] . '</td>
504
-                                        <td>'.$interaction['id'] . '</td>
503
+                                        <td>'.$interaction['order_id'].'</td>
504
+                                        <td>'.$interaction['id'].'</td>
505 505
                                         <td colspan="2">' . $interaction['type'].'</td>
506
-                                        <td>'.$student_response . '</td>
507
-                                        <td>'.$interaction['result'] . '</td>
508
-                                        <td>'.$interaction['latency'] . '</td>
509
-                                        <td>'.$interaction['time'] . '</td>
506
+                                        <td>'.$student_response.'</td>
507
+                                        <td>'.$interaction['result'].'</td>
508
+                                        <td>'.$interaction['latency'].'</td>
509
+                                        <td>'.$interaction['time'].'</td>
510 510
                                         '.$action.'
511 511
                                     </tr>';
512 512
                                 $counter++;
@@ -523,12 +523,12 @@  discard block
 block discarded – undo
523 523
                                         <td></td>
524 524
                                         <td></td>
525 525
                                         <td></td>
526
-                                        <td>' . $interaction['order_id'] . '</td>
527
-                                        <td colspan="2">' . $interaction['objective_id'] . '</td>
528
-                                        <td colspan="2">' . $interaction['status'] .'</td>
529
-                                        <td>' . $interaction['score_raw'] . '</td>
530
-                                        <td>' . $interaction['score_max'] . '</td>
531
-                                        <td>' . $interaction['score_min'] . '</td>
526
+                                        <td>' . $interaction['order_id'].'</td>
527
+                                        <td colspan="2">' . $interaction['objective_id'].'</td>
528
+                                        <td colspan="2">' . $interaction['status'].'</td>
529
+                                        <td>' . $interaction['score_raw'].'</td>
530
+                                        <td>' . $interaction['score_max'].'</td>
531
+                                        <td>' . $interaction['score_min'].'</td>
532 532
                                         '.$action.'
533 533
                                      </tr>';
534 534
                                 $counter++;
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
                         $my_path = Database::escape_string($my_path);
552 552
                         $sql = "SELECT results_disabled
553 553
                                 FROM $TBL_QUIZ
554
-                                WHERE c_id = $course_id AND id ='" . $my_path . "'";
554
+                                WHERE c_id = $course_id AND id ='".$my_path."'";
555 555
                         $res_result_disabled = Database::query($sql);
556 556
                         $row_result_disabled = Database::fetch_row($res_result_disabled);
557 557
 
@@ -575,14 +575,14 @@  discard block
 block discarded – undo
575 575
                             $extend_this_attempt = 1;
576 576
                             $extend_attempt_link = Display::url(
577 577
                                 Display::return_icon('visible.gif', get_lang('HideAttemptView')),
578
-                                api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&fold_attempt_id=' . $row['iv_id'] . $url_suffix
578
+                                api_get_self().'?action=stats&extend_id='.$my_item_id.'&fold_attempt_id='.$row['iv_id'].$url_suffix
579 579
                             );
580 580
                         } else {
581 581
                             // Same case if fold_attempt_id is set, so not implemented explicitly.
582 582
                             // The extend button for this attempt has not been clicked.
583 583
                             $extend_attempt_link = Display::url(
584 584
                                 Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')),
585
-                                api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix
585
+                                api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix
586 586
                             );
587 587
                         }
588 588
                     }
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
                     if ($inter_num > 1) {
598 598
                         $extend_link = Display::url(
599 599
                             Display::return_icon('invisible.gif', get_lang('ExtendAttemptView')),
600
-                            api_get_self() . '?action=stats&extend_id=' . $my_item_id . '&extend_attempt_id=' . $row['iv_id'] . $url_suffix
600
+                            api_get_self().'?action=stats&extend_id='.$my_item_id.'&extend_attempt_id='.$row['iv_id'].$url_suffix
601 601
                         );
602 602
                     }
603 603
 
@@ -613,15 +613,15 @@  discard block
 block discarded – undo
613 613
 
614 614
                     // Selecting the exe_id from stats attempts tables in order to look the max score value.
615 615
 
616
-                    $sql = 'SELECT * FROM ' . $tbl_stats_exercices . '
616
+                    $sql = 'SELECT * FROM '.$tbl_stats_exercices.'
617 617
                              WHERE
618
-                                exe_exo_id="' . $row['path'] . '" AND
619
-                                exe_user_id="' . $user_id . '" AND
620
-                                orig_lp_id = "' . $lp_id . '" AND
621
-                                orig_lp_item_id = "' . $row['myid'] . '" AND
622
-                                c_id = ' . $course_id . ' AND
618
+                                exe_exo_id="' . $row['path'].'" AND
619
+                                exe_user_id="' . $user_id.'" AND
620
+                                orig_lp_id = "' . $lp_id.'" AND
621
+                                orig_lp_item_id = "' . $row['myid'].'" AND
622
+                                c_id = ' . $course_id.' AND
623 623
                                 status <> "incomplete" AND
624
-                                session_id = ' . $session_id . '
624
+                                session_id = ' . $session_id.'
625 625
                              ORDER BY exe_date DESC
626 626
                              LIMIT 1';
627 627
 
@@ -652,8 +652,8 @@  discard block
 block discarded – undo
652 652
                                         FROM $TBL_LP_ITEM_VIEW
653 653
                                         WHERE
654 654
                                             c_id = $course_id AND
655
-                                            lp_item_id = '" . (int) $my_id . "' AND
656
-                                            lp_view_id = '" . (int) $my_lp_view_id . "'
655
+                                            lp_item_id = '".(int) $my_id."' AND
656
+                                            lp_view_id = '" . (int) $my_lp_view_id."'
657 657
                                         ORDER BY view_count DESC limit 1";
658 658
                                 $res_score = Database::query($sql);
659 659
                                 $row_score = Database::fetch_array($res_score);
@@ -662,8 +662,8 @@  discard block
 block discarded – undo
662 662
                                         FROM $TBL_LP_ITEM_VIEW
663 663
                                         WHERE
664 664
                                             c_id = $course_id AND
665
-                                            lp_item_id = '" . (int) $my_id . "' AND
666
-                                            lp_view_id = '" . (int) $my_lp_view_id . "'";
665
+                                            lp_item_id = '".(int) $my_id."' AND
666
+                                            lp_view_id = '" . (int) $my_lp_view_id."'";
667 667
                                 $res_time = Database::query($sql);
668 668
                                 $row_time = Database::fetch_array($res_time);
669 669
 
@@ -722,16 +722,16 @@  discard block
 block discarded – undo
722 722
                     } else {
723 723
                         $correct_test_link = '-';
724 724
                         if ($row['item_type'] == 'quiz') {
725
-                            $my_url_suffix = '&course=' . $courseCode . '&student_id=' . $user_id . '&lp_id=' . intval($row['mylpid']) . '&origin=' . $origin;
726
-                            $sql = 'SELECT * FROM ' . $tbl_stats_exercices . '
725
+                            $my_url_suffix = '&course='.$courseCode.'&student_id='.$user_id.'&lp_id='.intval($row['mylpid']).'&origin='.$origin;
726
+                            $sql = 'SELECT * FROM '.$tbl_stats_exercices.'
727 727
                                      WHERE
728
-                                        exe_exo_id="' . $row['path'] . '" AND
729
-                                        exe_user_id="' . $user_id . '" AND
730
-                                        orig_lp_id = "' . $lp_id . '" AND
731
-                                        orig_lp_item_id = "' . $row['myid'] . '" AND
732
-                                        c_id = ' . $course_id . ' AND
728
+                                        exe_exo_id="' . $row['path'].'" AND
729
+                                        exe_user_id="' . $user_id.'" AND
730
+                                        orig_lp_id = "' . $lp_id.'" AND
731
+                                        orig_lp_item_id = "' . $row['myid'].'" AND
732
+                                        c_id = ' . $course_id.' AND
733 733
                                         status <> "incomplete" AND
734
-                                        session_id = ' . $session_id . '
734
+                                        session_id = ' . $session_id.'
735 735
                                      ORDER BY exe_date DESC ';
736 736
 
737 737
                             $resultLastAttempt = Database::query($sql);
@@ -743,12 +743,12 @@  discard block
 block discarded – undo
743 743
                                 ) {
744 744
                                     $correct_test_link = Display::url(
745 745
                                         Display::return_icon('view_less_stats.gif', get_lang('HideAllAttempts')),
746
-                                        api_get_self() . '?action=stats' . $my_url_suffix . '&session_id=' . $session_id . '&lp_item_id=' . $my_id
746
+                                        api_get_self().'?action=stats'.$my_url_suffix.'&session_id='.$session_id.'&lp_item_id='.$my_id
747 747
                                     );
748 748
                                 } else {
749 749
                                     $correct_test_link = Display::url(
750 750
                                         Display::return_icon('view_more_stats.gif', get_lang('ShowAllAttemptsByExercise')),
751
-                                        api_get_self() . '?action=stats&extend_attempt=1' . $my_url_suffix . '&session_id=' . $session_id . '&lp_item_id=' . $my_id
751
+                                        api_get_self().'?action=stats&extend_attempt=1'.$my_url_suffix.'&session_id='.$session_id.'&lp_item_id='.$my_id
752 752
                                     );
753 753
                                 }
754 754
                             }
@@ -758,14 +758,14 @@  discard block
 block discarded – undo
758 758
 
759 759
                         $action = null;
760 760
                         if ($type == 'classic') {
761
-                            $action =  '<td>' . $correct_test_link . '</td>';
761
+                            $action = '<td>'.$correct_test_link.'</td>';
762 762
                         }
763 763
 
764 764
                         if ($lp_id == $my_lp_id && false) {
765 765
 
766
-                            $output .= '<tr class =' . $oddclass . '>
767
-                                    <td>' . $extend_link . '</td>
768
-                                    <td colspan="4">' . $title . '</td>
766
+                            $output .= '<tr class ='.$oddclass.'>
767
+                                    <td>' . $extend_link.'</td>
768
+                                    <td colspan="4">' . $title.'</td>
769 769
                                     <td colspan="2">&nbsp;</td>
770 770
                                     <td colspan="2">&nbsp;</td>
771 771
                                     <td colspan="2">&nbsp;</td>
@@ -790,13 +790,13 @@  discard block
 block discarded – undo
790 790
                                     $scoreItem .= ExerciseLib::show_score($score, $maxscore, false);
791 791
                                 }
792 792
                             } else {
793
-                                $scoreItem .= $score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . $maxscore);
793
+                                $scoreItem .= $score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.$maxscore);
794 794
                             }
795 795
 
796 796
                             $output .= '
797 797
                                 <td>'.$extend_link.'</td>
798
-                                <td colspan="4">' . $title . '</td>
799
-                                <td colspan="2">' . learnpathitem::humanize_status($lesson_status) .'</td>
798
+                                <td colspan="4">' . $title.'</td>
799
+                                <td colspan="2">' . learnpathitem::humanize_status($lesson_status).'</td>
800 800
                                 <td colspan="2">'.$scoreItem.'</td>
801 801
                                 <td colspan="2">'.$time.'</td>
802 802
                                 '.$action.'
@@ -813,10 +813,10 @@  discard block
 block discarded – undo
813 813
                                 if (!$is_allowed_to_edit && $result_disabled_ext_all) {
814 814
                                     $temp[] = '/';
815 815
                                 } else {
816
-                                    $temp[] = ($score == 0 ? '0/' . $maxscore : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
816
+                                    $temp[] = ($score == 0 ? '0/'.$maxscore : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1)));
817 817
                                 }
818 818
                             } else {
819
-                                $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score . '/' . float_format($maxscore, 1)));
819
+                                $temp[] = ($score == 0 ? '/' : ($maxscore == 0 ? $score : $score.'/'.float_format($maxscore, 1)));
820 820
                             }
821 821
                             $temp[] = $time;
822 822
                             $csv_content[] = $temp;
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
 
828 828
                     $action = null;
829 829
                     if ($type == 'classic') {
830
-                        $action =  '<td></td>';
830
+                        $action = '<td></td>';
831 831
                     }
832 832
 
833 833
                     if ($extend_this_attempt || $extend_all) {
@@ -864,11 +864,11 @@  discard block
 block discarded – undo
864 864
                                     <td></td>
865 865
                                     <td></td>
866 866
                                     <td></td>
867
-                                    <td>' . $interaction['order_id'] . '</td>
868
-                                    <td colspan="2">'.$interaction['objective_id'] . '</td>
869
-                                    <td colspan="2">' . $interaction['status'] . '</td>
867
+                                    <td>' . $interaction['order_id'].'</td>
868
+                                    <td colspan="2">'.$interaction['objective_id'].'</td>
869
+                                    <td colspan="2">' . $interaction['status'].'</td>
870 870
                                     <td>' . $interaction['score_raw'].'</td>
871
-                                    <td>' . $interaction['score_max'] .'</td>
871
+                                    <td>' . $interaction['score_max'].'</td>
872 872
                                     <td>' . $interaction['score_min'].'</td>
873 873
                                     '.$action.'
874 874
                                </tr>';
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
                     }
878 878
 
879 879
                     // Attempts listing by exercise.
880
-                    if ($lp_id == $my_lp_id && $lp_item_id== $my_id && $extendedAttempt) {
880
+                    if ($lp_id == $my_lp_id && $lp_item_id == $my_id && $extendedAttempt) {
881 881
                         // Get attempts of a exercise.
882 882
                         if (!empty($lp_id) &&
883 883
                             !empty($lp_item_id) &&
@@ -892,15 +892,15 @@  discard block
 block discarded – undo
892 892
                             $row_path = Database::fetch_array($res_path);
893 893
 
894 894
                             if (Database::num_rows($res_path) > 0) {
895
-                                $sql = 'SELECT * FROM ' . $tbl_stats_exercices . '
895
+                                $sql = 'SELECT * FROM '.$tbl_stats_exercices.'
896 896
                                         WHERE
897
-                                            exe_exo_id="' . (int) $row_path['path'] . '" AND
897
+                                            exe_exo_id="' . (int) $row_path['path'].'" AND
898 898
                                             status <> "incomplete" AND
899
-                                            exe_user_id="' . $user_id . '" AND
900
-                                            orig_lp_id = "' . (int) $lp_id . '" AND
901
-                                            orig_lp_item_id = "' . (int) $lp_item_id . '" AND
902
-                                            c_id = ' . $course_id . '  AND
903
-                                            session_id = ' . $session_id . '
899
+                                            exe_user_id="' . $user_id.'" AND
900
+                                            orig_lp_id = "' . (int) $lp_id.'" AND
901
+                                            orig_lp_item_id = "' . (int) $lp_item_id.'" AND
902
+                                            c_id = ' . $course_id.'  AND
903
+                                            session_id = ' . $session_id.'
904 904
                                         ORDER BY exe_date';
905 905
                                 $res_attempts = Database::query($sql);
906 906
                                 $num_attempts = Database::num_rows($res_attempts);
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
                                         if ($mktime_start_date && $mktime_exe_date) {
919 919
                                             $mytime = ((int) $mktime_exe_date - (int) $mktime_start_date);
920 920
                                             $time_attemp = learnpathItem :: getScormTimeFromParameter('js', $mytime);
921
-                                            $time_attemp = str_replace('NaN', '00' . $h . '00\'00"', $time_attemp);
921
+                                            $time_attemp = str_replace('NaN', '00'.$h.'00\'00"', $time_attemp);
922 922
                                         } else {
923 923
                                             $time_attemp = ' - ';
924 924
                                         }
@@ -944,33 +944,33 @@  discard block
 block discarded – undo
944 944
                                             $my_lesson_status = learnpathitem::humanize_status('incomplete');
945 945
                                         }
946 946
 
947
-                                        $output .= '<tr class="' . $oddclass . '" >
947
+                                        $output .= '<tr class="'.$oddclass.'" >
948 948
                                         <td></td>
949
-                                        <td>' . $extend_attempt_link . '</td>
950
-                                        <td colspan="3">' . get_lang('Attempt').' '. $n.'</td>
951
-                                        <td colspan="2">' . $my_lesson_status . '</td>
952
-                                        <td colspan="2">'.$view_score . '</td>
953
-                                        <td colspan="2">'.$time_attemp . '</td>';
949
+                                        <td>' . $extend_attempt_link.'</td>
950
+                                        <td colspan="3">' . get_lang('Attempt').' '.$n.'</td>
951
+                                        <td colspan="2">' . $my_lesson_status.'</td>
952
+                                        <td colspan="2">'.$view_score.'</td>
953
+                                        <td colspan="2">'.$time_attemp.'</td>';
954 954
                                         if ($action == 'classic') {
955 955
                                             if ($origin != 'tracking') {
956 956
                                                 if (!$is_allowed_to_edit && $result_disabled_ext_all) {
957 957
                                                     $output .= '<td>
958
-                                                            <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
958
+                                                            <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'">
959 959
                                                             </td>';
960 960
                                                 } else {
961 961
                                                     $output .= '<td>
962
-                                                            <a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
963
-                                                            <img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
962
+                                                            <a href="../exercice/exercise_show.php?origin=' . $origin.'&id='.$my_exe_id.'&cidReq='.$courseCode.'" target="_parent">
963
+                                                            <img src="' . Display::returnIconPath('quiz.gif').'" alt="'.get_lang('ShowAttempt').'" title="'.get_lang('ShowAttempt').'">
964 964
                                                             </a></td>';
965 965
                                                 }
966 966
                                             } else {
967 967
                                                 if (!$is_allowed_to_edit && $result_disabled_ext_all) {
968 968
                                                     $output .= '<td>
969
-                                                                <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>';
969
+                                                                <img src="' . Display::returnIconPath('quiz_na.gif').'" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></td>';
970 970
                                                 } else {
971 971
                                                     $output .= '<td>
972
-                                                                    <a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
973
-                                                                    <img src="' . Display::returnIconPath('quiz.gif').'" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>';
972
+                                                                    <a href="../exercice/exercise_show.php?cidReq=' . $courseCode.'&origin=correct_exercise_in_lp&id='.$my_exe_id.'" target="_parent">
973
+                                                                    <img src="' . Display::returnIconPath('quiz.gif').'" alt="'.get_lang('ShowAndQualifyAttempt').'" title="'.get_lang('ShowAndQualifyAttempt').'"></a></td>';
974 974
                                                 }
975 975
                                             }
976 976
                                         }
@@ -1029,13 +1029,13 @@  discard block
 block discarded – undo
1029 1029
         }
1030 1030
 
1031 1031
         $total_time = learnpathItem::getScormTimeFromParameter('js', $total_time);
1032
-        $total_time = str_replace('NaN', '00' . $h . '00\'00"', $total_time);
1032
+        $total_time = str_replace('NaN', '00'.$h.'00\'00"', $total_time);
1033 1033
 
1034 1034
         if (!$is_allowed_to_edit && $result_disabled_ext_all) {
1035 1035
             $final_score = Display::return_icon('invisible.gif', get_lang('ResultsHiddenByExerciseSetting'));
1036 1036
         } else {
1037 1037
             if (is_numeric($total_score)) {
1038
-                $final_score = $total_score . '%';
1038
+                $final_score = $total_score.'%';
1039 1039
             } else {
1040 1040
                 $final_score = $total_score;
1041 1041
             }
@@ -1051,19 +1051,19 @@  discard block
 block discarded – undo
1051 1051
 
1052 1052
         $action = null;
1053 1053
         if ($type == 'classic') {
1054
-            $action =  '<td></td>';
1054
+            $action = '<td></td>';
1055 1055
         }
1056 1056
 
1057 1057
         $output .= '<tr class="'.$oddclass.'">
1058 1058
                 <td></td>
1059 1059
                 <td colspan="4">
1060
-                    <i>' . get_lang('AccomplishedStepsTotal') .'</i>
1060
+                    <i>' . get_lang('AccomplishedStepsTotal').'</i>
1061 1061
                 </td>
1062 1062
                 <td colspan="2">'.$progress.'%</td>
1063 1063
                 <td colspan="2">
1064 1064
                     ' . $final_score.'
1065 1065
                 </td>
1066
-                <td colspan="2">' . $total_time . '</div>
1066
+                <td colspan="2">' . $total_time.'</div>
1067 1067
                 '.$action.'
1068 1068
            </tr>';
1069 1069
 
@@ -1359,7 +1359,7 @@  discard block
 block discarded – undo
1359 1359
     	$tbl_track_course = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
1360 1360
     	if (is_array($user_id)) {
1361 1361
     	    $user_id = array_map('intval', $user_id);
1362
-    		$condition_user = " AND user_id IN (".implode(',',$user_id).") ";
1362
+    		$condition_user = " AND user_id IN (".implode(',', $user_id).") ";
1363 1363
     	} else {
1364 1364
     		$user_id = intval($user_id);
1365 1365
     		$condition_user = " AND user_id = $user_id ";
@@ -1396,13 +1396,13 @@  discard block
 block discarded – undo
1396 1396
     {
1397 1397
     	$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
1398 1398
     	$sql = 'SELECT login_date
1399
-    	        FROM ' . $tbl_track_login . '
1400
-                WHERE login_user_id = ' . intval($student_id) . '
1399
+    	        FROM ' . $tbl_track_login.'
1400
+                WHERE login_user_id = ' . intval($student_id).'
1401 1401
                 ORDER BY login_date ASC
1402 1402
                 LIMIT 0,1';
1403 1403
 
1404 1404
     	$rs = Database::query($sql);
1405
-    	if (Database::num_rows($rs)>0) {
1405
+    	if (Database::num_rows($rs) > 0) {
1406 1406
     		if ($first_login_date = Database::result($rs, 0, 0)) {
1407 1407
                 return api_convert_and_format_date(
1408 1408
                     $first_login_date,
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
     {
1428 1428
     	$table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
1429 1429
     	$sql = 'SELECT login_date
1430
-    	        FROM ' . $table . '
1431
-                WHERE login_user_id = ' . intval($student_id) . '
1430
+    	        FROM ' . $table.'
1431
+                WHERE login_user_id = ' . intval($student_id).'
1432 1432
                 ORDER BY login_date
1433 1433
                 DESC LIMIT 0,1';
1434 1434
 
@@ -1437,18 +1437,18 @@  discard block
 block discarded – undo
1437 1437
     		if ($last_login_date = Database::result($rs, 0, 0)) {
1438 1438
     			$last_login_date = api_get_local_time($last_login_date);
1439 1439
     			if ($return_timestamp) {
1440
-    				return api_strtotime($last_login_date,'UTC');
1440
+    				return api_strtotime($last_login_date, 'UTC');
1441 1441
     			} else {
1442 1442
     				if (!$warning_message) {
1443 1443
     					return api_format_date($last_login_date, DATE_FORMAT_SHORT);
1444 1444
     				} else {
1445
-    					$timestamp = api_strtotime($last_login_date,'UTC');
1445
+    					$timestamp = api_strtotime($last_login_date, 'UTC');
1446 1446
     					$currentTimestamp = time();
1447 1447
 
1448 1448
     					//If the last connection is > than 7 days, the text is red
1449 1449
     					//345600 = 7 days in seconds
1450 1450
     					if ($currentTimestamp - $timestamp > 604800) {
1451
-    						return '<span style="color: #F00;">' . api_format_date($last_login_date, DATE_FORMAT_SHORT) . '</span>';
1451
+    						return '<span style="color: #F00;">'.api_format_date($last_login_date, DATE_FORMAT_SHORT).'</span>';
1452 1452
     					} else {
1453 1453
     						return api_format_date($last_login_date, DATE_FORMAT_SHORT);
1454 1454
     					}
@@ -1483,7 +1483,7 @@  discard block
 block discarded – undo
1483 1483
         $sql = "$select
1484 1484
                 FROM $tbl_track_login
1485 1485
                 WHERE
1486
-                    login_user_id IN (' ". implode("','", $studentList) . "' ) AND
1486
+                    login_user_id IN (' ".implode("','", $studentList)."' ) AND
1487 1487
                     login_date < '$date'
1488 1488
                 ";
1489 1489
         $rs = Database::query($sql);
@@ -1582,7 +1582,7 @@  discard block
 block discarded – undo
1582 1582
                               '.Display::return_icon('messagebox_warning.gif').'
1583 1583
                              </a>'
1584 1584
                             : null;
1585
-    					return $icon. Display::label($last_login_date, 'warning');
1585
+    					return $icon.Display::label($last_login_date, 'warning');
1586 1586
     				} else {
1587 1587
     					return $last_login_date;
1588 1588
     				}
@@ -1632,7 +1632,7 @@  discard block
 block discarded – undo
1632 1632
                     session_id = $session_id
1633 1633
                     $month_filter";
1634 1634
     	$rs = Database::query($sql);
1635
-    	if (Database::num_rows($rs)>0) {
1635
+    	if (Database::num_rows($rs) > 0) {
1636 1636
     		$row = Database::fetch_object($rs);
1637 1637
     		$count = $row->count_connections;
1638 1638
     	}
@@ -1653,14 +1653,14 @@  discard block
 block discarded – undo
1653 1653
     	$tbl_session_course_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1654 1654
 
1655 1655
     	$sql = 'SELECT DISTINCT c_id
1656
-                FROM ' . $tbl_course_rel_user . '
1656
+                FROM ' . $tbl_course_rel_user.'
1657 1657
                 WHERE user_id = ' . $user_id.' AND relation_type<>'.COURSE_RELATION_TYPE_RRHH;
1658 1658
     	$rs = Database::query($sql);
1659 1659
     	$nb_courses = Database::num_rows($rs);
1660 1660
 
1661 1661
     	if ($include_sessions) {
1662 1662
     		$sql = 'SELECT DISTINCT c_id
1663
-                    FROM ' . $tbl_session_course_rel_user . '
1663
+                    FROM ' . $tbl_session_course_rel_user.'
1664 1664
                     WHERE user_id = ' . $user_id;
1665 1665
     		$rs = Database::query($sql);
1666 1666
     		$nb_courses += Database::num_rows($rs);
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
     		$condition_quiz = "";
1708 1708
     		if (!empty($exercise_id)) {
1709 1709
     			$exercise_id = intval($exercise_id);
1710
-    			$condition_quiz =" AND id = $exercise_id ";
1710
+    			$condition_quiz = " AND id = $exercise_id ";
1711 1711
     		}
1712 1712
 
1713 1713
     		// Compose a filter based on optional session id given
@@ -1756,7 +1756,7 @@  discard block
 block discarded – undo
1756 1756
                         }
1757 1757
                     }
1758 1758
                     if (!empty($exercise_list)) {
1759
-                        $exercise_id = implode("','",$exercise_list);
1759
+                        $exercise_id = implode("','", $exercise_list);
1760 1760
                     }
1761 1761
     			}
1762 1762
 
@@ -1781,10 +1781,10 @@  discard block
 block discarded – undo
1781 1781
     			$quiz_avg_score = null;
1782 1782
 
1783 1783
     			if (!empty($row['avg_score'])) {
1784
-    				$quiz_avg_score = round($row['avg_score'],2);
1784
+    				$quiz_avg_score = round($row['avg_score'], 2);
1785 1785
     			}
1786 1786
 
1787
-    			if(!empty($row['num_attempts'])) {
1787
+    			if (!empty($row['num_attempts'])) {
1788 1788
     				$quiz_avg_score = round($quiz_avg_score / $row['num_attempts'], 2);
1789 1789
     			}
1790 1790
     			if (is_array($student_id)) {
@@ -1914,7 +1914,7 @@  discard block
 block discarded – undo
1914 1914
             $row = Database::fetch_row($rs);
1915 1915
             $count = $row[0];
1916 1916
         }
1917
-        $count = ($count != 0 ) ? 100*round(intval($count)/count($exercise_list), 2) .'%' : '0%';
1917
+        $count = ($count != 0) ? 100 * round(intval($count) / count($exercise_list), 2).'%' : '0%';
1918 1918
         return $count;
1919 1919
     }
1920 1920
 
@@ -1939,7 +1939,7 @@  discard block
 block discarded – undo
1939 1939
                 );
1940 1940
 
1941 1941
                 if (!empty($best_attempt) && !empty($best_attempt['exe_weighting'])) {
1942
-                    $result += $best_attempt['exe_result']/$best_attempt['exe_weighting'];
1942
+                    $result += $best_attempt['exe_result'] / $best_attempt['exe_weighting'];
1943 1943
                 }
1944 1944
             }
1945 1945
             $result = $result / count($exercise_list);
@@ -1976,7 +1976,7 @@  discard block
 block discarded – undo
1976 1976
         $query = sprintf($sql, intval($courseId), $sessionId);
1977 1977
         $rs = Database::query($query);
1978 1978
         $teachers = array();
1979
-        while ($teacher = Database::fetch_array($rs,'ASSOC')) {
1979
+        while ($teacher = Database::fetch_array($rs, 'ASSOC')) {
1980 1980
             $teachers[] = $teacher;
1981 1981
         }
1982 1982
         $data = array();
@@ -2100,7 +2100,7 @@  discard block
 block discarded – undo
2100 2100
             $data[] = array(
2101 2101
                 'course' => $course['title'],
2102 2102
                 'session' => $teacher['name'],
2103
-                'tutor' => $tutor['username'] . ' - ' . $tutor['lastname'] . ' ' . $tutor['firstname'],
2103
+                'tutor' => $tutor['username'].' - '.$tutor['lastname'].' '.$tutor['firstname'],
2104 2104
                 'documents' => $totalDocuments,
2105 2105
                 'links' => $totalLinks,
2106 2106
                 'forums' => $totalForums,
@@ -2163,7 +2163,7 @@  discard block
 block discarded – undo
2163 2163
             for ($i = 0; $i < count($lpIdList); $i++) {
2164 2164
                 $placeHolders[] = '?';
2165 2165
             }
2166
-            $lpConditions['AND id IN(' . implode(', ', $placeHolders) . ') '] = $lpIdList;
2166
+            $lpConditions['AND id IN('.implode(', ', $placeHolders).') '] = $lpIdList;
2167 2167
         }
2168 2168
 
2169 2169
         if ($onlySeriousGame) {
@@ -2183,12 +2183,12 @@  discard block
 block discarded – undo
2183 2183
 
2184 2184
         $conditions = [
2185 2185
             " c_id = {$courseInfo['real_id']} ",
2186
-            " lp_view.lp_id IN(" . implode(', ', $filteredLP) . ") "
2186
+            " lp_view.lp_id IN(".implode(', ', $filteredLP).") "
2187 2187
         ];
2188 2188
 
2189 2189
         if (is_array($studentId)) {
2190 2190
             $studentId = array_map('intval', $studentId);
2191
-            $conditions[] = " lp_view.user_id IN (" . implode(',', $studentId) . ")  ";
2191
+            $conditions[] = " lp_view.user_id IN (".implode(',', $studentId).")  ";
2192 2192
 
2193 2193
             $groupBy = 'GROUP BY lp_id';
2194 2194
         } else {
@@ -2329,7 +2329,7 @@  discard block
 block discarded – undo
2329 2329
             // Compose a filter based on optional learning paths list given
2330 2330
             $condition_lp = "";
2331 2331
             if (count($lp_ids) > 0) {
2332
-                $condition_lp =" AND id IN(".implode(',',$lp_ids).") ";
2332
+                $condition_lp = " AND id IN(".implode(',', $lp_ids).") ";
2333 2333
             }
2334 2334
 
2335 2335
             // Compose a filter based on optional session id
@@ -2369,9 +2369,9 @@  discard block
 block discarded – undo
2369 2369
             // prepare filter on users
2370 2370
             if (is_array($student_id)) {
2371 2371
                 array_walk($student_id, 'intval');
2372
-                $condition_user1 =" AND user_id IN (".implode(',', $student_id).") ";
2372
+                $condition_user1 = " AND user_id IN (".implode(',', $student_id).") ";
2373 2373
             } else {
2374
-                $condition_user1 =" AND user_id = $student_id ";
2374
+                $condition_user1 = " AND user_id = $student_id ";
2375 2375
             }
2376 2376
 
2377 2377
             if ($count_row_lp > 0 && !empty($student_id)) {
@@ -2414,7 +2414,7 @@  discard block
 block discarded – undo
2414 2414
                                     ORDER BY lp_item_id";
2415 2415
                             $res_lp_item = Database::query($sql);
2416 2416
 
2417
-                            while ($row_lp_item = Database::fetch_array($res_lp_item,'ASSOC')) {
2417
+                            while ($row_lp_item = Database::fetch_array($res_lp_item, 'ASSOC')) {
2418 2418
                                 $my_lp_item_id = $row_lp_item['lp_item_id'];
2419 2419
 
2420 2420
                                 // Getting the most recent attempt
@@ -2437,8 +2437,8 @@  discard block
 block discarded – undo
2437 2437
                                         ORDER BY view_count DESC
2438 2438
                                         LIMIT 1";
2439 2439
                                 $res_lp_item_result = Database::query($sql);
2440
-                                while ($row_max_score = Database::fetch_array($res_lp_item_result,'ASSOC')) {
2441
-                                    $list[]= $row_max_score;
2440
+                                while ($row_max_score = Database::fetch_array($res_lp_item_result, 'ASSOC')) {
2441
+                                    $list[] = $row_max_score;
2442 2442
                                 }
2443 2443
                             }
2444 2444
                         } else {
@@ -2462,8 +2462,8 @@  discard block
 block discarded – undo
2462 2462
                             if ($debug) echo $sql.'<br />';
2463 2463
                             $res_max_score = Database::query($sql);
2464 2464
 
2465
-                            while ($row_max_score = Database::fetch_array($res_max_score,'ASSOC')) {
2466
-                                $list[]= $row_max_score;
2465
+                            while ($row_max_score = Database::fetch_array($res_max_score, 'ASSOC')) {
2466
+                                $list[] = $row_max_score;
2467 2467
                             }
2468 2468
                         }
2469 2469
 
@@ -2478,7 +2478,7 @@  discard block
 block discarded – undo
2478 2478
                             $max_score_item_view = $row_max_score['max_score_item_view'];
2479 2479
                             $score = $row_max_score['score'];
2480 2480
 
2481
-                            if ($debug) echo '<h3>Item Type: ' .$row_max_score['item_type'].'</h3>';
2481
+                            if ($debug) echo '<h3>Item Type: '.$row_max_score['item_type'].'</h3>';
2482 2482
 
2483 2483
                             if ($row_max_score['item_type'] == 'sco') {
2484 2484
                                 /* Check if it is sco (easier to get max_score)
@@ -2496,7 +2496,7 @@  discard block
 block discarded – undo
2496 2496
                                 }
2497 2497
                                 // Avoid division by zero errors
2498 2498
                                 if (!empty($max_score)) {
2499
-                                    $lp_partial_total += $score/$max_score;
2499
+                                    $lp_partial_total += $score / $max_score;
2500 2500
                                 }
2501 2501
                                 if ($debug) echo '<b>$lp_partial_total, $score, $max_score '.$lp_partial_total.' '.$score.' '.$max_score.'</b><br />';
2502 2502
                             } else {
@@ -2520,10 +2520,10 @@  discard block
 block discarded – undo
2520 2520
                                         ORDER BY exe_date DESC
2521 2521
                                         LIMIT 1";
2522 2522
 
2523
-                                if ($debug) echo $sql .'<br />';
2523
+                                if ($debug) echo $sql.'<br />';
2524 2524
                                 $result_last_attempt = Database::query($sql);
2525 2525
                                 $num = Database :: num_rows($result_last_attempt);
2526
-                                if ($num > 0 ) {
2526
+                                if ($num > 0) {
2527 2527
                                     $id_last_attempt = Database :: result($result_last_attempt, 0, 0);
2528 2528
                                     if ($debug) echo $id_last_attempt.'<br />';
2529 2529
 
@@ -2552,13 +2552,13 @@  discard block
 block discarded – undo
2552 2552
                                         $max_score = $row_max_score_bis['maxscore'];
2553 2553
                                     }
2554 2554
                                     if (!empty($max_score) && floatval($max_score) > 0) {
2555
-                                        $lp_partial_total += $score/$max_score;
2555
+                                        $lp_partial_total += $score / $max_score;
2556 2556
                                     }
2557 2557
                                     if ($debug) echo '$lp_partial_total, $score, $max_score <b>'.$lp_partial_total.' '.$score.' '.$max_score.'</b><br />';
2558 2558
                                 }
2559 2559
                             }
2560 2560
 
2561
-                            if (in_array($row_max_score['item_type'], array('quiz','sco'))) {
2561
+                            if (in_array($row_max_score['item_type'], array('quiz', 'sco'))) {
2562 2562
                                 // Normal way
2563 2563
                                 if ($use_max_score[$lp_id]) {
2564 2564
                                     $count_items++;
@@ -2593,8 +2593,8 @@  discard block
 block discarded – undo
2593 2593
                     if ($debug) echo $sql;
2594 2594
                     $result_have_quiz = Database::query($sql);
2595 2595
 
2596
-                    if (Database::num_rows($result_have_quiz) > 0 ) {
2597
-                        $row = Database::fetch_array($result_have_quiz,'ASSOC');
2596
+                    if (Database::num_rows($result_have_quiz) > 0) {
2597
+                        $row = Database::fetch_array($result_have_quiz, 'ASSOC');
2598 2598
                         if (is_numeric($row['count']) && $row['count'] != 0) {
2599 2599
                             $lp_with_quiz++;
2600 2600
                         }
@@ -2606,7 +2606,7 @@  discard block
 block discarded – undo
2606 2606
 
2607 2607
                 if ($lp_with_quiz != 0) {
2608 2608
                     if (!$return_array) {
2609
-                        $score_of_scorm_calculate = round(($global_result/$lp_with_quiz),2);
2609
+                        $score_of_scorm_calculate = round(($global_result / $lp_with_quiz), 2);
2610 2610
                         if ($debug) var_dump($score_of_scorm_calculate);
2611 2611
                         if (empty($lp_ids)) {
2612 2612
                             if ($debug) echo '<h2>All lps fix: '.$score_of_scorm_calculate.'</h2>';
@@ -2680,9 +2680,9 @@  discard block
 block discarded – undo
2680 2680
 
2681 2681
         if (is_array($student_id)) {
2682 2682
             array_walk($student_id, 'intval');
2683
-            $conditions[] =" lp_view.user_id IN (".implode(',', $student_id).") ";
2683
+            $conditions[] = " lp_view.user_id IN (".implode(',', $student_id).") ";
2684 2684
         } else {
2685
-            $conditions[] =" lp_view.user_id = $student_id ";
2685
+            $conditions[] = " lp_view.user_id = $student_id ";
2686 2686
         }
2687 2687
 
2688 2688
         $conditionsToString = implode('AND ', $conditions);
@@ -2706,7 +2706,7 @@  discard block
 block discarded – undo
2706 2706
             return 0;
2707 2707
         }
2708 2708
 
2709
-        return ($row['sum_score'] / $row['sum_max_score'])*100;
2709
+        return ($row['sum_score'] / $row['sum_max_score']) * 100;
2710 2710
 
2711 2711
     }
2712 2712
 
@@ -2736,7 +2736,7 @@  discard block
 block discarded – undo
2736 2736
             // Compose a filter based on optional learning paths list given
2737 2737
             $condition_lp = "";
2738 2738
             if (count($lp_ids) > 0) {
2739
-                $condition_lp =" AND id IN(".implode(',',$lp_ids).") ";
2739
+                $condition_lp = " AND id IN(".implode(',', $lp_ids).") ";
2740 2740
             }
2741 2741
 
2742 2742
             // Compose a filter based on optional session id
@@ -2795,7 +2795,7 @@  discard block
 block discarded – undo
2795 2795
 
2796 2796
         if (!empty($course)) {
2797 2797
 
2798
-            $course_id	 = $course['real_id'];
2798
+            $course_id = $course['real_id'];
2799 2799
 
2800 2800
             $lp_table    = Database :: get_course_table(TABLE_LP_MAIN);
2801 2801
             $t_lpv       = Database :: get_course_table(TABLE_LP_VIEW);
@@ -2809,8 +2809,8 @@  discard block
 block discarded – undo
2809 2809
             // calculates last connection time
2810 2810
             if ($count_row_lp > 0) {
2811 2811
                 $sql = 'SELECT MAX(start_time)
2812
-                        FROM ' . $t_lpiv . ' AS item_view
2813
-                        INNER JOIN ' . $t_lpv . ' AS view
2812
+                        FROM ' . $t_lpiv.' AS item_view
2813
+                        INNER JOIN ' . $t_lpv.' AS view
2814 2814
                             ON item_view.lp_view_id = view.id
2815 2815
                         WHERE
2816 2816
                             item_view.c_id 		= '.$course_id.' AND
@@ -2846,15 +2846,15 @@  discard block
 block discarded – undo
2846 2846
 
2847 2847
         // At first, courses where $coach_id is coach of the course //
2848 2848
         $sql = 'SELECT session_id, c_id
2849
-                FROM ' . $tbl_session_course_user . '
2849
+                FROM ' . $tbl_session_course_user.'
2850 2850
                 WHERE user_id=' . $coach_id.' AND status=2';
2851 2851
 
2852 2852
         if (api_is_multiple_url_enabled()) {
2853
-            $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
2853
+            $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
2854 2854
             $access_url_id = api_get_current_access_url_id();
2855 2855
             if ($access_url_id != -1) {
2856 2856
                 $sql = 'SELECT scu.session_id, scu.c_id
2857
-                    FROM ' . $tbl_session_course_user . ' scu
2857
+                    FROM ' . $tbl_session_course_user.' scu
2858 2858
                     INNER JOIN '.$tbl_session_rel_access_url.'  sru
2859 2859
                     ON (scu.session_id=sru.session_id)
2860 2860
                     WHERE
@@ -2888,28 +2888,28 @@  discard block
 block discarded – undo
2888 2888
 
2889 2889
         // Then, courses where $coach_id is coach of the session    //
2890 2890
         $sql = 'SELECT session_course_user.user_id
2891
-                FROM ' . $tbl_session_course_user . ' as session_course_user
2891
+                FROM ' . $tbl_session_course_user.' as session_course_user
2892 2892
                 INNER JOIN     '.$tbl_session_user.' sru
2893 2893
                 ON session_course_user.user_id = sru.user_id AND session_course_user.session_id = sru.session_id
2894
-                INNER JOIN ' . $tbl_session_course . ' as session_course
2894
+                INNER JOIN ' . $tbl_session_course.' as session_course
2895 2895
                 ON session_course.c_id = session_course_user.c_id
2896 2896
                 AND session_course_user.session_id = session_course.session_id
2897
-                INNER JOIN ' . $tbl_session . ' as session
2897
+                INNER JOIN ' . $tbl_session.' as session
2898 2898
                 ON session.id = session_course.session_id
2899 2899
                 AND session.id_coach = ' . $coach_id;
2900 2900
         if (api_is_multiple_url_enabled()) {
2901
-            $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
2901
+            $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
2902 2902
             $access_url_id = api_get_current_access_url_id();
2903
-            if ($access_url_id != -1){
2903
+            if ($access_url_id != -1) {
2904 2904
                 $sql = 'SELECT session_course_user.user_id
2905
-                        FROM ' . $tbl_session_course_user . ' as session_course_user
2905
+                        FROM ' . $tbl_session_course_user.' as session_course_user
2906 2906
                         INNER JOIN     '.$tbl_session_user.' sru
2907 2907
                             ON session_course_user.user_id = sru.user_id AND
2908 2908
                                session_course_user.session_id = sru.session_id
2909
-                        INNER JOIN ' . $tbl_session_course . ' as session_course
2909
+                        INNER JOIN ' . $tbl_session_course.' as session_course
2910 2910
                             ON session_course.c_id = session_course_user.c_id AND
2911 2911
                             session_course_user.session_id = session_course.session_id
2912
-                        INNER JOIN ' . $tbl_session . ' as session
2912
+                        INNER JOIN ' . $tbl_session.' as session
2913 2913
                             ON session.id = session_course.session_id AND
2914 2914
                             session.id_coach = ' . $coach_id.'
2915 2915
                         INNER JOIN '.$tbl_session_rel_access_url.' session_rel_url
@@ -2939,8 +2939,8 @@  discard block
 block discarded – undo
2939 2939
 
2940 2940
         $students = [];
2941 2941
         // At first, courses where $coach_id is coach of the course //
2942
-        $sql = 'SELECT c_id FROM ' . $tbl_session_course_user . '
2943
-                WHERE session_id="' . $id_session . '" AND user_id=' . $coach_id.' AND status=2';
2942
+        $sql = 'SELECT c_id FROM '.$tbl_session_course_user.'
2943
+                WHERE session_id="' . $id_session.'" AND user_id='.$coach_id.' AND status=2';
2944 2944
         $result = Database::query($sql);
2945 2945
 
2946 2946
         while ($a_courses = Database::fetch_array($result)) {
@@ -2950,7 +2950,7 @@  discard block
 block discarded – undo
2950 2950
                     FROM $tbl_session_course_user AS srcru
2951 2951
                     WHERE
2952 2952
                         c_id = '$courseId' AND
2953
-                        session_id = '" . $id_session . "'";
2953
+                        session_id = '".$id_session."'";
2954 2954
             $rs = Database::query($sql);
2955 2955
             while ($row = Database::fetch_array($rs)) {
2956 2956
                 $students[$row['user_id']] = $row['user_id'];
@@ -2958,15 +2958,15 @@  discard block
 block discarded – undo
2958 2958
         }
2959 2959
 
2960 2960
         // Then, courses where $coach_id is coach of the session
2961
-        $sql = 'SELECT id_coach FROM ' . $tbl_session . '
2962
-                WHERE id="' . $id_session.'" AND id_coach="' . $coach_id . '"';
2961
+        $sql = 'SELECT id_coach FROM '.$tbl_session.'
2962
+                WHERE id="' . $id_session.'" AND id_coach="'.$coach_id.'"';
2963 2963
         $result = Database::query($sql);
2964 2964
 
2965 2965
         //He is the session_coach so we select all the users in the session
2966 2966
         if (Database::num_rows($result) > 0) {
2967 2967
             $sql = 'SELECT DISTINCT srcru.user_id
2968
-                    FROM ' . $tbl_session_course_user . ' AS srcru
2969
-                    WHERE session_id="' . $id_session . '"';
2968
+                    FROM ' . $tbl_session_course_user.' AS srcru
2969
+                    WHERE session_id="' . $id_session.'"';
2970 2970
             $result = Database::query($sql);
2971 2971
             while ($row = Database::fetch_array($result)) {
2972 2972
                 $students[$row['user_id']] = $row['user_id'];
@@ -2993,8 +2993,8 @@  discard block
 block discarded – undo
2993 2993
 
2994 2994
         // At first, courses where $coach_id is coach of the course //
2995 2995
 
2996
-        $sql = 'SELECT 1 FROM ' . $tbl_session_course_user . '
2997
-                WHERE user_id=' . $coach_id .' AND status=2';
2996
+        $sql = 'SELECT 1 FROM '.$tbl_session_course_user.'
2997
+                WHERE user_id=' . $coach_id.' AND status=2';
2998 2998
         $result = Database::query($sql);
2999 2999
         if (Database::num_rows($result) > 0) {
3000 3000
             return true;
@@ -3002,12 +3002,12 @@  discard block
 block discarded – undo
3002 3002
 
3003 3003
         // Then, courses where $coach_id is coach of the session
3004 3004
         $sql = 'SELECT session_course_user.user_id
3005
-                FROM ' . $tbl_session_course_user . ' as session_course_user
3006
-                INNER JOIN ' . $tbl_session_course . ' as session_course
3005
+                FROM ' . $tbl_session_course_user.' as session_course_user
3006
+                INNER JOIN ' . $tbl_session_course.' as session_course
3007 3007
                     ON session_course.c_id = session_course_user.c_id
3008
-                INNER JOIN ' . $tbl_session . ' as session
3008
+                INNER JOIN ' . $tbl_session.' as session
3009 3009
                     ON session.id = session_course.session_id
3010
-                    AND session.id_coach = ' . $coach_id . '
3010
+                    AND session.id_coach = ' . $coach_id.'
3011 3011
                 WHERE user_id = ' . $student_id;
3012 3012
         $result = Database::query($sql);
3013 3013
         if (Database::num_rows($result) > 0) {
@@ -3039,16 +3039,16 @@  discard block
 block discarded – undo
3039 3039
         // At first, courses where $coach_id is coach of the course.
3040 3040
 
3041 3041
         $sql = 'SELECT DISTINCT c.code
3042
-                FROM ' . $tbl_session_course_user . ' sc
3042
+                FROM ' . $tbl_session_course_user.' sc
3043 3043
                 INNER JOIN '.$tbl_course.' c
3044 3044
                 ON (c.id = sc.c_id)
3045 3045
                 WHERE user_id = ' . $coach_id.' AND status = 2';
3046 3046
 
3047 3047
         if (api_is_multiple_url_enabled()) {
3048 3048
             $access_url_id = api_get_current_access_url_id();
3049
-            if ($access_url_id != -1){
3049
+            if ($access_url_id != -1) {
3050 3050
                 $sql = 'SELECT DISTINCT c.code
3051
-                        FROM ' . $tbl_session_course_user . ' scu
3051
+                        FROM ' . $tbl_session_course_user.' scu
3052 3052
                         INNER JOIN '.$tbl_course.' c
3053 3053
                         ON (c.code = scu.c_id)
3054 3054
                         INNER JOIN '.$tbl_course_rel_access_url.' cru
@@ -3061,7 +3061,7 @@  discard block
 block discarded – undo
3061 3061
         }
3062 3062
 
3063 3063
         if (!empty($id_session)) {
3064
-            $sql .= ' AND session_id=' . $id_session;
3064
+            $sql .= ' AND session_id='.$id_session;
3065 3065
         }
3066 3066
 
3067 3067
         $courseList = array();
@@ -3073,25 +3073,25 @@  discard block
 block discarded – undo
3073 3073
         // Then, courses where $coach_id is coach of the session
3074 3074
 
3075 3075
         $sql = 'SELECT DISTINCT course.code
3076
-                FROM ' . $tbl_session_course . ' as session_course
3077
-                INNER JOIN ' . $tbl_session . ' as session
3076
+                FROM ' . $tbl_session_course.' as session_course
3077
+                INNER JOIN ' . $tbl_session.' as session
3078 3078
                     ON session.id = session_course.session_id
3079
-                    AND session.id_coach = ' . $coach_id . '
3080
-                INNER JOIN ' . $tbl_course . ' as course
3079
+                    AND session.id_coach = ' . $coach_id.'
3080
+                INNER JOIN ' . $tbl_course.' as course
3081 3081
                     ON course.id = session_course.c_id';
3082 3082
 
3083 3083
         if (api_is_multiple_url_enabled()) {
3084 3084
             $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
3085 3085
             $access_url_id = api_get_current_access_url_id();
3086
-            if ($access_url_id != -1){
3086
+            if ($access_url_id != -1) {
3087 3087
                 $sql = 'SELECT DISTINCT c.code
3088
-                    FROM ' . $tbl_session_course . ' as session_course
3088
+                    FROM ' . $tbl_session_course.' as session_course
3089 3089
                     INNER JOIN '.$tbl_course.' c
3090 3090
                     ON (c.id = session_course.c_id)
3091
-                    INNER JOIN ' . $tbl_session . ' as session
3091
+                    INNER JOIN ' . $tbl_session.' as session
3092 3092
                     ON session.id = session_course.session_id
3093
-                        AND session.id_coach = ' . $coach_id . '
3094
-                    INNER JOIN ' . $tbl_course . ' as course
3093
+                        AND session.id_coach = ' . $coach_id.'
3094
+                    INNER JOIN ' . $tbl_course.' as course
3095 3095
                         ON course.id = session_course.c_id
3096 3096
                      INNER JOIN '.$tbl_course_rel_access_url.' course_rel_url
3097 3097
                     ON (course_rel_url.c_id = c.id)';
@@ -3099,12 +3099,12 @@  discard block
 block discarded – undo
3099 3099
         }
3100 3100
 
3101 3101
         if (!empty ($id_session)) {
3102
-            $sql .= ' WHERE session_course.session_id=' . $id_session;
3102
+            $sql .= ' WHERE session_course.session_id='.$id_session;
3103 3103
             if (api_is_multiple_url_enabled())
3104
-            $sql .=  ' AND access_url_id = '.$access_url_id;
3105
-        }  else {
3104
+            $sql .= ' AND access_url_id = '.$access_url_id;
3105
+        } else {
3106 3106
             if (api_is_multiple_url_enabled())
3107
-            $sql .=  ' WHERE access_url_id = '.$access_url_id;
3107
+            $sql .= ' WHERE access_url_id = '.$access_url_id;
3108 3108
         }
3109 3109
 
3110 3110
         $result = Database::query($sql);
@@ -3160,7 +3160,7 @@  discard block
 block discarded – undo
3160 3160
             }
3161 3161
         }
3162 3162
 
3163
-        $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
3163
+        $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
3164 3164
         $access_url_id = api_get_current_access_url_id();
3165 3165
 
3166 3166
         $sql = "
@@ -3280,7 +3280,7 @@  discard block
 block discarded – undo
3280 3280
             // table definition
3281 3281
             $tbl_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY);
3282 3282
             $tbl_document = Database :: get_course_table(TABLE_DOCUMENT);
3283
-            $course_id	 = $a_course['real_id'];
3283
+            $course_id = $a_course['real_id'];
3284 3284
             if (is_array($student_id)) {
3285 3285
                 $studentList = array_map('intval', $student_id);
3286 3286
                 $condition_user = " AND ip.insert_user_id IN ('".implode(',', $studentList)."') ";
@@ -3331,7 +3331,7 @@  discard block
 block discarded – undo
3331 3331
         $a_course = CourseManager::get_course_information($course_code);
3332 3332
         if (!empty($a_course)) {
3333 3333
             $course_id = $a_course['real_id'];
3334
-            $conditions[]= " ip.c_id  = $course_id AND pub.c_id  = $course_id ";
3334
+            $conditions[] = " ip.c_id  = $course_id AND pub.c_id  = $course_id ";
3335 3335
         }
3336 3336
 
3337 3337
         // table definition
@@ -3340,14 +3340,14 @@  discard block
 block discarded – undo
3340 3340
 
3341 3341
         if (is_array($student_id)) {
3342 3342
             $studentList = array_map('intval', $student_id);
3343
-            $conditions[]= " ip.insert_user_id IN ('".implode("','", $studentList)."') ";
3343
+            $conditions[] = " ip.insert_user_id IN ('".implode("','", $studentList)."') ";
3344 3344
         } else {
3345 3345
             $student_id = intval($student_id);
3346
-            $conditions[]= " ip.insert_user_id = '$student_id' ";
3346
+            $conditions[] = " ip.insert_user_id = '$student_id' ";
3347 3347
         }
3348 3348
         if (isset($session_id)) {
3349 3349
             $session_id = intval($session_id);
3350
-            $conditions[]= " pub.session_id = $session_id ";
3350
+            $conditions[] = " pub.session_id = $session_id ";
3351 3351
         }
3352 3352
         $conditionToString = implode('AND', $conditions);
3353 3353
 
@@ -3380,8 +3380,8 @@  discard block
 block discarded – undo
3380 3380
         $courseCondition = null;
3381 3381
         $conditions = array();
3382 3382
         if (!empty($courseInfo)) {
3383
-            $course_id	    = $courseInfo['real_id'];
3384
-            $conditions[]= " post.c_id  = $course_id AND forum.c_id = $course_id ";
3383
+            $course_id = $courseInfo['real_id'];
3384
+            $conditions[] = " post.c_id  = $course_id AND forum.c_id = $course_id ";
3385 3385
         }
3386 3386
 
3387 3387
         // Table definition.
@@ -3390,15 +3390,15 @@  discard block
 block discarded – undo
3390 3390
 
3391 3391
         if (is_array($student_id)) {
3392 3392
             $studentList = array_map('intval', $student_id);
3393
-            $conditions[]= " post.poster_id IN ('".implode("','", $studentList)."') ";
3393
+            $conditions[] = " post.poster_id IN ('".implode("','", $studentList)."') ";
3394 3394
         } else {
3395 3395
             $student_id = intval($student_id);
3396
-            $conditions[]= " post.poster_id = '$student_id' ";
3396
+            $conditions[] = " post.poster_id = '$student_id' ";
3397 3397
         }
3398 3398
 
3399 3399
         if (isset($session_id)) {
3400 3400
             $session_id = intval($session_id);
3401
-            $conditions[]= " forum.session_id = $session_id";
3401
+            $conditions[] = " forum.session_id = $session_id";
3402 3402
         }
3403 3403
 
3404 3404
         $conditionsToString = implode('AND ', $conditions);
@@ -3433,7 +3433,7 @@  discard block
 block discarded – undo
3433 3433
             $condition_session = '';
3434 3434
             if (isset($session_id)) {
3435 3435
                 $session_id = intval($session_id);
3436
-                $condition_session = api_get_session_condition($session_id, true,  false, 'f.session_id');
3436
+                $condition_session = api_get_session_condition($session_id, true, false, 'f.session_id');
3437 3437
             }
3438 3438
 
3439 3439
             $course_id = $courseInfo['real_id'];
@@ -3489,7 +3489,7 @@  discard block
 block discarded – undo
3489 3489
         $condition_session = '';
3490 3490
         if (isset($session_id)) {
3491 3491
             $session_id = intval($session_id);
3492
-            $condition_session = ' AND f.session_id = '. $session_id;
3492
+            $condition_session = ' AND f.session_id = '.$session_id;
3493 3493
         }
3494 3494
 
3495 3495
         $groupId = intval($groupId);
@@ -3550,7 +3550,7 @@  discard block
 block discarded – undo
3550 3550
         $condition_session = '';
3551 3551
         if (isset($session_id)) {
3552 3552
              $session_id = intval($session_id);
3553
-             $condition_session = ' AND f.session_id = '. $session_id;
3553
+             $condition_session = ' AND f.session_id = '.$session_id;
3554 3554
         }
3555 3555
 
3556 3556
         $groupId = intval($groupId);
@@ -3629,7 +3629,7 @@  discard block
 block discarded – undo
3629 3629
     {
3630 3630
         $student_id = intval($student_id);
3631 3631
         $courseId = intval($courseId);
3632
-        $session_id    = intval($session_id);
3632
+        $session_id = intval($session_id);
3633 3633
         $date_time  = '';
3634 3634
 
3635 3635
         // table definition
@@ -3698,7 +3698,7 @@  discard block
 block discarded – undo
3698 3698
         $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
3699 3699
 
3700 3700
         $sql = 'SELECT 1
3701
-                FROM ' . $table . '
3701
+                FROM ' . $table.'
3702 3702
                 WHERE down_user_id = '.$student_id.'
3703 3703
                 AND c_id  = "'.$courseId.'"
3704 3704
                 AND down_session_id = '.$session_id.' ';
@@ -3776,30 +3776,30 @@  discard block
 block discarded – undo
3776 3776
                 '.$inner.'
3777 3777
                 WHERE c.id = '.$courseId.'
3778 3778
                 GROUP BY stats_login.user_id
3779
-                HAVING DATE_SUB( "' . $now . '", INTERVAL '.$since.' DAY) > max_date ';
3779
+                HAVING DATE_SUB( "' . $now.'", INTERVAL '.$since.' DAY) > max_date ';
3780 3780
 
3781 3781
         if ($since == 'never') {
3782 3782
             if (empty($session_id)) {
3783 3783
                 $sql = 'SELECT course_user.user_id
3784
-                        FROM ' . $table_course_rel_user . ' course_user
3785
-                        LEFT JOIN ' . $tbl_track_login . ' stats_login
3784
+                        FROM ' . $table_course_rel_user.' course_user
3785
+                        LEFT JOIN ' . $tbl_track_login.' stats_login
3786 3786
                         ON course_user.user_id = stats_login.user_id AND
3787
-                        relation_type<>' . COURSE_RELATION_TYPE_RRHH . '
3788
-                        INNER JOIN ' . $tableCourse . ' c
3787
+                        relation_type<>' . COURSE_RELATION_TYPE_RRHH.'
3788
+                        INNER JOIN ' . $tableCourse.' c
3789 3789
                         ON (c.id = course_user.c_id)
3790 3790
                         WHERE
3791
-                            course_user.c_id = ' . $courseId . ' AND
3791
+                            course_user.c_id = ' . $courseId.' AND
3792 3792
                             stats_login.login_course_date IS NULL
3793 3793
                         GROUP BY course_user.user_id';
3794 3794
             } else {
3795 3795
                 $sql = 'SELECT session_course_user.user_id
3796 3796
                         FROM '.$tbl_session_course_user.' session_course_user
3797
-                        LEFT JOIN ' . $tbl_track_login . ' stats_login
3797
+                        LEFT JOIN ' . $tbl_track_login.' stats_login
3798 3798
                         ON session_course_user.user_id = stats_login.user_id
3799
-                        INNER JOIN ' . $tableCourse . ' c
3799
+                        INNER JOIN ' . $tableCourse.' c
3800 3800
                         ON (c.id = session_course_user.c_id)
3801 3801
                         WHERE
3802
-                            session_course_user.c_id = ' . $courseId . ' AND
3802
+                            session_course_user.c_id = ' . $courseId.' AND
3803 3803
                             stats_login.login_course_date IS NULL
3804 3804
                         GROUP BY session_course_user.user_id';
3805 3805
 
@@ -3808,7 +3808,7 @@  discard block
 block discarded – undo
3808 3808
 
3809 3809
         $rs = Database::query($sql);
3810 3810
         $inactive_users = array();
3811
-        while($user = Database::fetch_array($rs)) {
3811
+        while ($user = Database::fetch_array($rs)) {
3812 3812
             $inactive_users[] = $user['user_id'];
3813 3813
         }
3814 3814
 
@@ -3830,10 +3830,10 @@  discard block
 block discarded – undo
3830 3830
         $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
3831 3831
 
3832 3832
         $sql = 'SELECT '.$student_id.'
3833
-                FROM ' . $table . '
3833
+                FROM ' . $table.'
3834 3834
                 WHERE
3835
-                    access_user_id=' . $student_id . ' AND
3836
-                    c_id="' . $courseId . '" AND
3835
+                    access_user_id=' . $student_id.' AND
3836
+                    c_id="' . $courseId.'" AND
3837 3837
                     access_session_id = "'.$session_id.'" ';
3838 3838
 
3839 3839
         $rs = Database::query($sql);
@@ -3851,13 +3851,13 @@  discard block
 block discarded – undo
3851 3851
     {
3852 3852
         $hr_dept_id = intval($hr_dept_id);
3853 3853
         $a_students = array();
3854
-        $tbl_user     = Database :: get_main_table(TABLE_MAIN_USER);
3854
+        $tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
3855 3855
 
3856 3856
         $sql = 'SELECT DISTINCT user_id FROM '.$tbl_user.' as user
3857 3857
                 WHERE hr_dept_id='.$hr_dept_id;
3858 3858
         $rs = Database::query($sql);
3859 3859
 
3860
-        while($user = Database :: fetch_array($rs)) {
3860
+        while ($user = Database :: fetch_array($rs)) {
3861 3861
             $a_students[$user['user_id']] = $user['user_id'];
3862 3862
         }
3863 3863
 
@@ -3882,7 +3882,7 @@  discard block
 block discarded – undo
3882 3882
         $condition_session     = '';
3883 3883
         if (isset($session_id)) {
3884 3884
             $session_id = intval($session_id);
3885
-            $condition_session = ' AND access_session_id = '. $session_id;
3885
+            $condition_session = ' AND access_session_id = '.$session_id;
3886 3886
         }
3887 3887
         $sql = "SELECT
3888 3888
                     access_tool,
@@ -3994,7 +3994,7 @@  discard block
 block discarded – undo
3994 3994
             if (!empty($date_from) && !empty($date_to)) {
3995 3995
                 $fieldStartDate = $fields['start_date'];
3996 3996
                 if (!isset($fields['end_date'])) {
3997
-                    $where .= sprintf(" AND ($fieldStartDate BETWEEN '%s' AND '%s' )", $date_from, $date_to) ;
3997
+                    $where .= sprintf(" AND ($fieldStartDate BETWEEN '%s' AND '%s' )", $date_from, $date_to);
3998 3998
                 } else {
3999 3999
                     $fieldEndDate = $fields['end_date'];
4000 4000
                     $where .= sprintf(" AND fieldStartDate >= '%s'
@@ -4010,12 +4010,12 @@  discard block
 block discarded – undo
4010 4010
                 $where
4011 4011
                 GROUP BY %s";
4012 4012
             $sql = sprintf($sql,
4013
-                $fields['user'],    //user field
4014
-                $tableName,         //FROM
4015
-                $fields['course'],  //course condition
4016
-                $course['real_id'],    //course condition
4017
-                $fields['user'],    //user condition
4018
-                $userId,            //user condition
4013
+                $fields['user'], //user field
4014
+                $tableName, //FROM
4015
+                $fields['course'], //course condition
4016
+                $course['real_id'], //course condition
4017
+                $fields['user'], //user condition
4018
+                $userId, //user condition
4019 4019
                 $fields['user']     //GROUP BY
4020 4020
                 );
4021 4021
             $rs = Database::query($sql);
@@ -4023,7 +4023,7 @@  discard block
 block discarded – undo
4023 4023
             //iterate query
4024 4024
             if (Database::num_rows($rs) > 0) {
4025 4025
                 while ($row = Database::fetch_array($rs)) {
4026
-                    $data[$row['user']] = (isset($data[$row['user']])) ?  $data[$row['user']] + $row[total]: $row['total'];
4026
+                    $data[$row['user']] = (isset($data[$row['user']])) ? $data[$row['user']] + $row[total] : $row['total'];
4027 4027
                 }
4028 4028
             }
4029 4029
         }
@@ -4046,11 +4046,11 @@  discard block
 block discarded – undo
4046 4046
         $courseId = api_get_course_int_id($course_code);
4047 4047
         $data = array();
4048 4048
 
4049
-        $TABLETRACK_DOWNLOADS   = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
4049
+        $TABLETRACK_DOWNLOADS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
4050 4050
         $condition_session = '';
4051 4051
         if (isset($session_id)) {
4052 4052
             $session_id = intval($session_id);
4053
-            $condition_session = ' AND down_session_id = '. $session_id;
4053
+            $condition_session = ' AND down_session_id = '.$session_id;
4054 4054
         }
4055 4055
         $sql = "SELECT down_doc_path, COUNT(DISTINCT down_user_id), COUNT(down_doc_path) as count_down
4056 4056
                 FROM $TABLETRACK_DOWNLOADS
@@ -4235,7 +4235,7 @@  discard block
 block discarded – undo
4235 4235
 
4236 4236
             $final_course_data = array();
4237 4237
 
4238
-            foreach($my_course_data as $course_id => $value) {
4238
+            foreach ($my_course_data as $course_id => $value) {
4239 4239
                 $final_course_data[$course_id] = $course_list[$course_id];
4240 4240
             }
4241 4241
             $course_in_session[$my_session_id]['course_list'] = $final_course_data;
@@ -4256,7 +4256,7 @@  discard block
 block discarded – undo
4256 4256
                           '.Display::tag('th', get_lang('Course'), array('width'=>'300px')).'
4257 4257
                           '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).'
4258 4258
                           '.Display::tag('th', get_lang('Progress'), array('class'=>'head')).'
4259
-                          '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')),array('class'=>'head')).'
4259
+                          '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).'
4260 4260
                           '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).'
4261 4261
                           '.Display::tag('th', get_lang('Details'), array('class'=>'head')).'
4262 4262
                         </tr>';
@@ -4343,7 +4343,7 @@  discard block
 block discarded – undo
4343 4343
             $all_exercise_start_time = array();
4344 4344
 
4345 4345
             foreach ($course_in_session as $my_session_id => $session_data) {
4346
-                $course_list  = $session_data['course_list'];
4346
+                $course_list = $session_data['course_list'];
4347 4347
                 $user_count = count(SessionManager::get_users_by_session($my_session_id));
4348 4348
                 $exercise_graph_name_list = array();
4349 4349
                 //$user_results = array();
@@ -4388,20 +4388,20 @@  discard block
 block discarded – undo
4388 4388
 
4389 4389
                             $score = 0;
4390 4390
                             if (!empty($user_result_data['exe_weighting']) && intval($user_result_data['exe_weighting']) != 0) {
4391
-                                $score = intval($user_result_data['exe_result']/$user_result_data['exe_weighting'] * 100);
4391
+                                $score = intval($user_result_data['exe_result'] / $user_result_data['exe_weighting'] * 100);
4392 4392
                             }
4393 4393
                             $time = api_strtotime($exercise_data['start_time']) ? api_strtotime($exercise_data['start_time'], 'UTC') : 0;
4394 4394
                             $all_exercise_start_time[] = $time;
4395 4395
                             $my_results[] = $score;
4396
-                            if (count($exercise_list)<=10) {
4396
+                            if (count($exercise_list) <= 10) {
4397 4397
                                 $title = cut($course_data['title'], 30)." \n ".cut($exercise_data['title'], 30);
4398
-                                $exercise_graph_name_list[]= $title;
4398
+                                $exercise_graph_name_list[] = $title;
4399 4399
                                 $all_exercise_graph_name_list[] = $title;
4400 4400
                             } else {
4401 4401
                                 // if there are more than 10 results, space becomes difficult to find, so only show the title of the exercise, not the tool
4402 4402
                                 $title = cut($exercise_data['title'], 30);
4403
-                                $exercise_graph_name_list[]= $title;
4404
-                                $all_exercise_graph_name_list[]= $title;
4403
+                                $exercise_graph_name_list[] = $title;
4404
+                                $all_exercise_graph_name_list[] = $title;
4405 4405
                             }
4406 4406
                         }
4407 4407
                     }
@@ -4434,7 +4434,7 @@  discard block
 block discarded – undo
4434 4434
             }
4435 4435
 
4436 4436
             $html .= Display::page_subheader(
4437
-                Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL) . ' ' . get_lang('Sessions')
4437
+                Display::return_icon('session.png', get_lang('Sessions'), array(), ICON_SIZE_SMALL).' '.get_lang('Sessions')
4438 4438
             );
4439 4439
 
4440 4440
             $html .= '<table class="data_table" width="100%">';
@@ -4484,7 +4484,7 @@  discard block
 block discarded – undo
4484 4484
                                 $courseInfo['real_id'],
4485 4485
                                 $my_session_id
4486 4486
                             );
4487
-                            if ($attempts > 1)  {
4487
+                            if ($attempts > 1) {
4488 4488
                                 $answered_exercises++;
4489 4489
                             }
4490 4490
                         }
@@ -4497,7 +4497,7 @@  discard block
 block discarded – undo
4497 4497
                     $all_average += $average;
4498 4498
                 }
4499 4499
 
4500
-                $all_average = $all_average /  count($course_list);
4500
+                $all_average = $all_average / count($course_list);
4501 4501
 
4502 4502
                 if (isset($_GET['session_id']) && $my_session_id == $_GET['session_id']) {
4503 4503
                     $html .= '<tr style="background-color:#FBF09D">';
@@ -4522,31 +4522,31 @@  discard block
 block discarded – undo
4522 4522
                 $html .= '</tr>';
4523 4523
             }
4524 4524
             $html .= '</table><br />';
4525
-            $html .= Display::div($main_session_graph, array('id'=>'session_graph','class'=>'chart-session', 'style'=>'position:relative; text-align: center;') );
4525
+            $html .= Display::div($main_session_graph, array('id'=>'session_graph', 'class'=>'chart-session', 'style'=>'position:relative; text-align: center;'));
4526 4526
 
4527 4527
             // Checking selected session.
4528 4528
 
4529 4529
             if (isset($_GET['session_id'])) {
4530 4530
                 $session_id_from_get = intval($_GET['session_id']);
4531
-                $session_data 	= $course_in_session[$session_id_from_get];
4532
-                $course_list 	= $session_data['course_list'];
4531
+                $session_data = $course_in_session[$session_id_from_get];
4532
+                $course_list = $session_data['course_list'];
4533 4533
 
4534
-                $html .= Display::tag('h3',$session_data['name'].' - '.get_lang('CourseList'));
4534
+                $html .= Display::tag('h3', $session_data['name'].' - '.get_lang('CourseList'));
4535 4535
 
4536 4536
                 $html .= '<table class="data_table" width="100%">';
4537 4537
                 //'.Display::tag('th', get_lang('DoneExercises'),         array('class'=>'head')).'
4538 4538
                 $html .= '
4539 4539
                     <tr>
4540 4540
                       <th width="300px">'.get_lang('Course').'</th>
4541
-                      '.Display::tag('th', get_lang('PublishedExercises'),    	array('class'=>'head')).'
4542
-                      '.Display::tag('th', get_lang('NewExercises'),    		array('class'=>'head')).'
4543
-                      '.Display::tag('th', get_lang('MyAverage'), 				array('class'=>'head')).'
4544
-                      '.Display::tag('th', get_lang('AverageExerciseResult'), 	array('class'=>'head')).'
4545
-                      '.Display::tag('th', get_lang('TimeSpentInTheCourse'),    array('class'=>'head')).'
4546
-                      '.Display::tag('th', get_lang('LPProgress')     ,      	array('class'=>'head')).'
4547
-                      '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array ('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).'
4548
-                      '.Display::tag('th', get_lang('LastConnexion'),         	array('class'=>'head')).'
4549
-                      '.Display::tag('th', get_lang('Details'),               	array('class'=>'head')).'
4541
+                      '.Display::tag('th', get_lang('PublishedExercises'), array('class'=>'head')).'
4542
+                      '.Display::tag('th', get_lang('NewExercises'), array('class'=>'head')).'
4543
+                      '.Display::tag('th', get_lang('MyAverage'), array('class'=>'head')).'
4544
+                      '.Display::tag('th', get_lang('AverageExerciseResult'), array('class'=>'head')).'
4545
+                      '.Display::tag('th', get_lang('TimeSpentInTheCourse'), array('class'=>'head')).'
4546
+                      '.Display::tag('th', get_lang('LPProgress'), array('class'=>'head')).'
4547
+                      '.Display::tag('th', get_lang('Score').Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), array('align' => 'absmiddle', 'hspace' => '3px')), array('class'=>'head')).'
4548
+                      '.Display::tag('th', get_lang('LastConnexion'), array('class'=>'head')).'
4549
+                      '.Display::tag('th', get_lang('Details'), array('class'=>'head')).'
4550 4550
                     </tr>';
4551 4551
 
4552 4552
                 foreach ($course_list as $course_data) {
@@ -4562,14 +4562,14 @@  discard block
 block discarded – undo
4562 4562
                         $count_exercises = count($exercises);
4563 4563
                     }
4564 4564
                     $answered_exercises = 0;
4565
-                    foreach($exercises as $exercise_item) {
4565
+                    foreach ($exercises as $exercise_item) {
4566 4566
                         $attempts = Event::count_exercise_attempts_by_user(
4567 4567
                             api_get_user_id(),
4568 4568
                             $exercise_item['id'],
4569 4569
                             $courseId,
4570 4570
                             $session_id_from_get
4571 4571
                         );
4572
-                        if ($attempts > 1)  {
4572
+                        if ($attempts > 1) {
4573 4573
                             $answered_exercises++;
4574 4574
                         }
4575 4575
                     }
@@ -4578,7 +4578,7 @@  discard block
 block discarded – undo
4578 4578
 
4579 4579
                     // Average
4580 4580
                     $average = ExerciseLib::get_average_score_by_course($courseId, $session_id_from_get);
4581
-                    $my_average	= ExerciseLib::get_average_score_by_course_by_user(api_get_user_id(), $courseId, $session_id_from_get);
4581
+                    $my_average = ExerciseLib::get_average_score_by_course_by_user(api_get_user_id(), $courseId, $session_id_from_get);
4582 4582
 
4583 4583
                     $stats_array[$course_code] = array(
4584 4584
                         'exercises' => $count_exercises,
@@ -4648,11 +4648,11 @@  discard block
 block discarded – undo
4648 4648
                     }
4649 4649
                     //Score
4650 4650
                     $html .= Display::tag('td', $percentage_score, array('align'=>'center'));
4651
-                    $html .= Display::tag('td', $last_connection,  array('align'=>'center'));
4651
+                    $html .= Display::tag('td', $last_connection, array('align'=>'center'));
4652 4652
 
4653 4653
                     if ($course_code == $courseCodeFromGet && $_GET['session_id'] == $session_id_from_get) {
4654 4654
                         $details = '<a href="#">';
4655
-                        $details .=Display::return_icon('2rightarrow_na.png', get_lang('Details'));
4655
+                        $details .= Display::return_icon('2rightarrow_na.png', get_lang('Details'));
4656 4656
                     } else {
4657 4657
                         $details = '<a href="'.api_get_self().'?course='.$course_code.'&session_id='.$session_id_from_get.$extra_params.'">';
4658 4658
                         $details .= Display::return_icon('2rightarrow.png', get_lang('Details'));
@@ -4775,7 +4775,7 @@  discard block
 block discarded – undo
4775 4775
                         );
4776 4776
 
4777 4777
                         $latest_attempt_url = '';
4778
-                        $best_score = $position = $percentage_score_result  = '-';
4778
+                        $best_score = $position = $percentage_score_result = '-';
4779 4779
                         $graph = $normal_graph = null;
4780 4780
 
4781 4781
                         // Getting best results
@@ -4811,7 +4811,7 @@  discard block
 block discarded – undo
4811 4811
                                 $percentage_score_result = Display::url(ExerciseLib::show_score($score, $weighting), $latest_attempt_url);
4812 4812
                                 $my_score = 0;
4813 4813
                                 if (!empty($weighting) && intval($weighting) != 0) {
4814
-                                    $my_score = $score/$weighting;
4814
+                                    $my_score = $score / $weighting;
4815 4815
                                 }
4816 4816
                                 //@todo this function slows the page
4817 4817
                                 $position = ExerciseLib::get_exercise_result_ranking($my_score, $exe_id, $exercices['id'], $course_info['code'], $session_id, $user_list);
@@ -4822,14 +4822,14 @@  discard block
 block discarded – undo
4822 4822
                         }
4823 4823
                         $html .= Display::div(
4824 4824
                             $normal_graph,
4825
-                            array('id'=>'main_graph_'.$exercices['id'],'class'=>'dialog', 'style'=>'display:none')
4825
+                            array('id'=>'main_graph_'.$exercices['id'], 'class'=>'dialog', 'style'=>'display:none')
4826 4826
                         );
4827 4827
 
4828 4828
                         if (empty($graph)) {
4829 4829
                             $graph = '-';
4830 4830
                         } else {
4831 4831
                             $graph = Display::url(
4832
-                                '<img src="' . $graph . '" >',
4832
+                                '<img src="'.$graph.'" >',
4833 4833
                                 $normal_graph,
4834 4834
                                 array(
4835 4835
                                     'id' => $exercices['id'],
@@ -4862,7 +4862,7 @@  discard block
 block discarded – undo
4862 4862
 
4863 4863
 
4864 4864
             // LP table results
4865
-            $html .='<table class="data_table">';
4865
+            $html .= '<table class="data_table">';
4866 4866
             $html .= Display::tag('th', get_lang('Learnpaths'), array('class'=>'head', 'style'=>'color:#000'));
4867 4867
             $html .= Display::tag('th', get_lang('LatencyTimeSpent'), array('class'=>'head', 'style'=>'color:#000'));
4868 4868
             $html .= Display::tag('th', get_lang('Progress'), array('class'=>'head', 'style'=>'color:#000'));
@@ -4916,7 +4916,7 @@  discard block
 block discarded – undo
4916 4916
                     if (!empty($last_connection_in_lp)) {
4917 4917
                         $last_connection = api_convert_and_format_date($last_connection_in_lp, DATE_TIME_FORMAT_LONG);
4918 4918
                     }
4919
-                    $html .= Display::tag('td', $last_connection, array('align'=>'center','width'=>'180px'));
4919
+                    $html .= Display::tag('td', $last_connection, array('align'=>'center', 'width'=>'180px'));
4920 4920
                     $html .= "</tr>";
4921 4921
                 }
4922 4922
             } else {
@@ -4926,7 +4926,7 @@  discard block
 block discarded – undo
4926 4926
                         </td>
4927 4927
                       </tr>';
4928 4928
             }
4929
-            $html .='</table>';
4929
+            $html .= '</table>';
4930 4930
         }
4931 4931
 
4932 4932
         return $html;
@@ -4953,7 +4953,7 @@  discard block
 block discarded – undo
4953 4953
         $myData->setSerieDescription('Serie1', get_lang('MyResults'));
4954 4954
         $myData->setSerieDescription('Serie2', get_lang('AverageScore'));
4955 4955
         $myData->setAxisUnit(0, '%');
4956
-        $myData->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
4956
+        $myData->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
4957 4957
         // Cache definition
4958 4958
         $cachePath = api_get_path(SYS_ARCHIVE_PATH);
4959 4959
         $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
@@ -4961,9 +4961,9 @@  discard block
 block discarded – undo
4961 4961
 
4962 4962
         if ($myCache->isInCache($chartHash)) {
4963 4963
             //if we already created the img
4964
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
4964
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
4965 4965
             $myCache->saveFromCache($chartHash, $imgPath);
4966
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
4966
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
4967 4967
         } else {
4968 4968
             /* Define width, height and angle */
4969 4969
             $mainWidth = 860;
@@ -4992,7 +4992,7 @@  discard block
 block discarded – undo
4992 4992
             /* Set the default font */
4993 4993
             $myPicture->setFontProperties(
4994 4994
                 array(
4995
-                    'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
4995
+                    'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
4996 4996
                     'FontSize' => 10)
4997 4997
             );
4998 4998
             /* Write the chart title */
@@ -5009,7 +5009,7 @@  discard block
 block discarded – undo
5009 5009
             /* Set the default font */
5010 5010
             $myPicture->setFontProperties(
5011 5011
                 array(
5012
-                    'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
5012
+                    'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
5013 5013
                     'FontSize' => 6
5014 5014
                 )
5015 5015
             );
@@ -5051,7 +5051,7 @@  discard block
 block discarded – undo
5051 5051
             /* Draw the line chart */
5052 5052
             $myPicture->setFontProperties(
5053 5053
                 array(
5054
-                    'FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf',
5054
+                    'FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf',
5055 5055
                     'FontSize' => 10
5056 5056
                 )
5057 5057
             );
@@ -5084,12 +5084,12 @@  discard block
 block discarded – undo
5084 5084
             );
5085 5085
 
5086 5086
             $myCache->writeToCache($chartHash, $myPicture);
5087
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
5087
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
5088 5088
             $myCache->saveFromCache($chartHash, $imgPath);
5089
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
5089
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
5090 5090
         }
5091 5091
 
5092
-        $html = '<img src="' . $imgPath . '">';
5092
+        $html = '<img src="'.$imgPath.'">';
5093 5093
 
5094 5094
         return $html;
5095 5095
     }
@@ -5110,12 +5110,12 @@  discard block
 block discarded – undo
5110 5110
 
5111 5111
         foreach ($attempts as $attempt) {
5112 5112
             if (api_get_user_id() == $attempt['exe_user_id']) {
5113
-                if ($attempt['exe_weighting'] != 0 ) {
5114
-                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5113
+                if ($attempt['exe_weighting'] != 0) {
5114
+                    $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5115 5115
                 }
5116 5116
             } else {
5117
-                if ($attempt['exe_weighting'] != 0 ) {
5118
-                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5117
+                if ($attempt['exe_weighting'] != 0) {
5118
+                    $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5119 5119
                 }
5120 5120
             }
5121 5121
         }
@@ -5124,27 +5124,27 @@  discard block
 block discarded – undo
5124 5124
         rsort($my_exercise_result_array);
5125 5125
         $my_exercise_result = 0;
5126 5126
         if (isset($my_exercise_result_array[0])) {
5127
-            $my_exercise_result = $my_exercise_result_array[0] *100;
5127
+            $my_exercise_result = $my_exercise_result_array[0] * 100;
5128 5128
         }
5129 5129
 
5130 5130
         $max     = 100;
5131
-        $pieces  = 5 ;
5131
+        $pieces  = 5;
5132 5132
         $part    = round($max / $pieces);
5133 5133
         $x_axis = array();
5134 5134
         $final_array = array();
5135 5135
         $my_final_array = array();
5136 5136
 
5137
-        for ($i=1; $i <=$pieces; $i++) {
5137
+        for ($i = 1; $i <= $pieces; $i++) {
5138 5138
             $sum = 1;
5139 5139
             if ($i == 1) {
5140 5140
                 $sum = 0;
5141 5141
             }
5142
-            $min = ($i-1)*$part + $sum;
5143
-            $max = ($i)*$part;
5144
-            $x_axis[]= $min." - ".$max;
5142
+            $min = ($i - 1) * $part + $sum;
5143
+            $max = ($i) * $part;
5144
+            $x_axis[] = $min." - ".$max;
5145 5145
             $count = 0;
5146
-            foreach($exercise_result as $result) {
5147
-                $percentage = $result*100;
5146
+            foreach ($exercise_result as $result) {
5147
+                $percentage = $result * 100;
5148 5148
                 //echo $percentage.' - '.$min.' - '.$max."<br />";
5149 5149
                 if ($percentage >= $min && $percentage <= $max) {
5150 5150
                     //echo ' is > ';
@@ -5152,7 +5152,7 @@  discard block
 block discarded – undo
5152 5152
                 }
5153 5153
             }
5154 5154
             //echo '<br />';
5155
-            $final_array[]= $count;
5155
+            $final_array[] = $count;
5156 5156
 
5157 5157
             if ($my_exercise_result >= $min && $my_exercise_result <= $max) {
5158 5158
                 $my_final_array[] = 1;
@@ -5162,9 +5162,9 @@  discard block
 block discarded – undo
5162 5162
         }
5163 5163
 
5164 5164
         //Fix to remove the data of the user with my data
5165
-        for($i = 0; $i<=count($my_final_array); $i++) {
5165
+        for ($i = 0; $i <= count($my_final_array); $i++) {
5166 5166
             if (!empty($my_final_array[$i])) {
5167
-                $my_final_array[$i] =  $final_array[$i] + 1; //Add my result
5167
+                $my_final_array[$i] = $final_array[$i] + 1; //Add my result
5168 5168
                 $final_array[$i] = 0;
5169 5169
             }
5170 5170
         }
@@ -5174,16 +5174,16 @@  discard block
 block discarded – undo
5174 5174
         $dataSet->addPoints($final_array, 'Serie1');
5175 5175
         $dataSet->addPoints($my_final_array, 'Serie2');
5176 5176
         $dataSet->normalize(100, "%");
5177
-        $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
5177
+        $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
5178 5178
 
5179 5179
         // Cache definition
5180 5180
         $cachePath = api_get_path(SYS_ARCHIVE_PATH);
5181 5181
         $myCache = new pCache(array('CacheFolder' => substr($cachePath, 0, strlen($cachePath) - 1)));
5182 5182
         $chartHash = $myCache->getHash($dataSet);
5183 5183
         if ($myCache->isInCache($chartHash)) {
5184
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
5184
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
5185 5185
             $myCache->saveFromCache($chartHash, $imgPath);
5186
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
5186
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
5187 5187
         } else {
5188 5188
             /* Create the pChart object */
5189 5189
             $widthSize = 80;
@@ -5199,7 +5199,7 @@  discard block
 block discarded – undo
5199 5199
             $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0));
5200 5200
 
5201 5201
             /* Set the default font */
5202
-            $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => $fontSize));
5202
+            $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => $fontSize));
5203 5203
 
5204 5204
             /* Do not write the chart title */
5205 5205
 
@@ -5263,9 +5263,9 @@  discard block
 block discarded – undo
5263 5263
 
5264 5264
             /* Save and write in cache */
5265 5265
             $myCache->writeToCache($chartHash, $myPicture);
5266
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
5266
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
5267 5267
             $myCache->saveFromCache($chartHash, $imgPath);
5268
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
5268
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
5269 5269
         }
5270 5270
 
5271 5271
         return $imgPath;
@@ -5285,12 +5285,12 @@  discard block
 block discarded – undo
5285 5285
         }
5286 5286
         foreach ($attempts as $attempt) {
5287 5287
             if (api_get_user_id() == $attempt['exe_user_id']) {
5288
-                if ($attempt['exe_weighting'] != 0 ) {
5289
-                    $my_exercise_result_array[]= $attempt['exe_result']/$attempt['exe_weighting'];
5288
+                if ($attempt['exe_weighting'] != 0) {
5289
+                    $my_exercise_result_array[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5290 5290
                 }
5291 5291
             } else {
5292
-                if ($attempt['exe_weighting'] != 0 ) {
5293
-                    $exercise_result[]=  $attempt['exe_result']/$attempt['exe_weighting'];
5292
+                if ($attempt['exe_weighting'] != 0) {
5293
+                    $exercise_result[] = $attempt['exe_result'] / $attempt['exe_weighting'];
5294 5294
                 }
5295 5295
             }
5296 5296
         }
@@ -5299,32 +5299,32 @@  discard block
 block discarded – undo
5299 5299
         rsort($my_exercise_result_array);
5300 5300
         $my_exercise_result = 0;
5301 5301
         if (isset($my_exercise_result_array[0])) {
5302
-            $my_exercise_result = $my_exercise_result_array[0] *100;
5302
+            $my_exercise_result = $my_exercise_result_array[0] * 100;
5303 5303
         }
5304 5304
 
5305 5305
         $max = 100;
5306
-        $pieces = 5 ;
5306
+        $pieces = 5;
5307 5307
         $part = round($max / $pieces);
5308 5308
         $x_axis = array();
5309 5309
         $final_array = array();
5310 5310
         $my_final_array = array();
5311 5311
 
5312
-        for ($i=1; $i <=$pieces; $i++) {
5312
+        for ($i = 1; $i <= $pieces; $i++) {
5313 5313
             $sum = 1;
5314 5314
             if ($i == 1) {
5315 5315
                 $sum = 0;
5316 5316
             }
5317
-            $min = ($i-1)*$part + $sum;
5318
-            $max = ($i)*$part;
5319
-            $x_axis[]= $min." - ".$max;
5317
+            $min = ($i - 1) * $part + $sum;
5318
+            $max = ($i) * $part;
5319
+            $x_axis[] = $min." - ".$max;
5320 5320
             $count = 0;
5321
-            foreach($exercise_result as $result) {
5322
-                $percentage = $result*100;
5321
+            foreach ($exercise_result as $result) {
5322
+                $percentage = $result * 100;
5323 5323
                 if ($percentage >= $min && $percentage <= $max) {
5324 5324
                     $count++;
5325 5325
                 }
5326 5326
             }
5327
-            $final_array[]= $count;
5327
+            $final_array[] = $count;
5328 5328
 
5329 5329
             if ($my_exercise_result >= $min && $my_exercise_result <= $max) {
5330 5330
                 $my_final_array[] = 1;
@@ -5335,9 +5335,9 @@  discard block
 block discarded – undo
5335 5335
 
5336 5336
         //Fix to remove the data of the user with my data
5337 5337
 
5338
-        for($i = 0; $i<=count($my_final_array); $i++) {
5338
+        for ($i = 0; $i <= count($my_final_array); $i++) {
5339 5339
             if (!empty($my_final_array[$i])) {
5340
-                $my_final_array[$i] =  $final_array[$i] + 1; //Add my result
5340
+                $my_final_array[$i] = $final_array[$i] + 1; //Add my result
5341 5341
                 $final_array[$i] = 0;
5342 5342
             }
5343 5343
         }
@@ -5355,7 +5355,7 @@  discard block
 block discarded – undo
5355 5355
         $dataSet->setXAxisName(get_lang('Score'));
5356 5356
         $dataSet->normalize(100, "%");
5357 5357
 
5358
-        $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
5358
+        $dataSet->loadPalette(api_get_path(SYS_CODE_PATH).'palettes/pchart/default.color', true);
5359 5359
 
5360 5360
         // Cache definition
5361 5361
         $cachePath = api_get_path(SYS_ARCHIVE_PATH);
@@ -5363,9 +5363,9 @@  discard block
 block discarded – undo
5363 5363
         $chartHash = $myCache->getHash($dataSet);
5364 5364
 
5365 5365
         if ($myCache->isInCache($chartHash)) {
5366
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
5366
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
5367 5367
             $myCache->saveFromCache($chartHash, $imgPath);
5368
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
5368
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
5369 5369
         } else {
5370 5370
             /* Create the pChart object */
5371 5371
             $widthSize = 480;
@@ -5381,7 +5381,7 @@  discard block
 block discarded – undo
5381 5381
             $myPicture->drawRectangle(0, 0, $widthSize - 1, $heightSize - 1, array('R' => 0, 'G' => 0, 'B' => 0));
5382 5382
 
5383 5383
             /* Set the default font */
5384
-            $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH) . 'opensans/OpenSans-Regular.ttf', 'FontSize' => 10));
5384
+            $myPicture->setFontProperties(array('FontName' => api_get_path(SYS_FONTS_PATH).'opensans/OpenSans-Regular.ttf', 'FontSize' => 10));
5385 5385
 
5386 5386
             /* Write the chart title */
5387 5387
             $myPicture->drawText(
@@ -5440,9 +5440,9 @@  discard block
 block discarded – undo
5440 5440
 
5441 5441
             /* Write and save into cache */
5442 5442
             $myCache->writeToCache($chartHash, $myPicture);
5443
-            $imgPath = api_get_path(SYS_ARCHIVE_PATH) . $chartHash;
5443
+            $imgPath = api_get_path(SYS_ARCHIVE_PATH).$chartHash;
5444 5444
             $myCache->saveFromCache($chartHash, $imgPath);
5445
-            $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
5445
+            $imgPath = api_get_path(WEB_ARCHIVE_PATH).$chartHash;
5446 5446
         }
5447 5447
 
5448 5448
         return $imgPath;
@@ -5568,7 +5568,7 @@  discard block
 block discarded – undo
5568 5568
                         $whereSessionParams .= $sessionIdx.',';
5569 5569
                     }
5570 5570
                 }
5571
-                $whereSessionParams = substr($whereSessionParams,0,-1);
5571
+                $whereSessionParams = substr($whereSessionParams, 0, -1);
5572 5572
             }
5573 5573
 
5574 5574
             if (!empty($exerciseId)) {
@@ -5629,7 +5629,7 @@  discard block
 block discarded – undo
5629 5629
                     qq.position = rq.question_order AND
5630 5630
                     ta.question_id = rq.question_id
5631 5631
                 WHERE
5632
-                    te.c_id = $courseIdx ".(empty($whereSessionParams)?'':"AND te.session_id IN ($whereSessionParams)")."
5632
+                    te.c_id = $courseIdx ".(empty($whereSessionParams) ? '' : "AND te.session_id IN ($whereSessionParams)")."
5633 5633
                     AND q.c_id = $courseIdx
5634 5634
                     $where $order $limit";
5635 5635
             $sql_query = vsprintf($sql, $whereParams);
@@ -5677,7 +5677,7 @@  discard block
 block discarded – undo
5677 5677
             // Now fill users data
5678 5678
             $sqlUsers = "SELECT user_id, username, lastname, firstname
5679 5679
                          FROM $tuser
5680
-                         WHERE user_id IN (".implode(',',$userIds).")";
5680
+                         WHERE user_id IN (".implode(',', $userIds).")";
5681 5681
             $resUsers = Database::query($sqlUsers);
5682 5682
             while ($rowUser = Database::fetch_assoc($resUsers)) {
5683 5683
                 $users[$rowUser['user_id']] = $rowUser;
@@ -5738,7 +5738,7 @@  discard block
 block discarded – undo
5738 5738
     	        WHERE
5739 5739
                     track_resource.c_id = $course_id AND
5740 5740
                     track_resource.insert_user_id = user.user_id AND
5741
-                    session_id " .(empty($session_id) ? ' IS NULL ' : " = $session_id ");
5741
+                    session_id ".(empty($session_id) ? ' IS NULL ' : " = $session_id ");
5742 5742
 
5743 5743
     	if (isset($_GET['keyword'])) {
5744 5744
     		$keyword = Database::escape_string(trim($_GET['keyword']));
@@ -5796,7 +5796,7 @@  discard block
 block discarded – undo
5796 5796
                 WHERE
5797 5797
                   track_resource.c_id = $course_id AND
5798 5798
                   track_resource.insert_user_id = user.user_id AND
5799
-                  session_id " .(empty($session_id) ? ' IS NULL ' : " = $session_id ");
5799
+                  session_id ".(empty($session_id) ? ' IS NULL ' : " = $session_id ");
5800 5800
 
5801 5801
     	if (isset($_GET['keyword'])) {
5802 5802
     		$keyword = Database::escape_string(trim($_GET['keyword']));
@@ -6090,7 +6090,7 @@  discard block
 block discarded – undo
6090 6090
     public static function display_additional_profile_fields()
6091 6091
     {
6092 6092
     	// getting all the extra profile fields that are defined by the platform administrator
6093
-    	$extra_fields = UserManager :: get_extra_fields(0,50,5,'ASC');
6093
+    	$extra_fields = UserManager :: get_extra_fields(0, 50, 5, 'ASC');
6094 6094
 
6095 6095
     	// creating the form
6096 6096
     	$return = '<form action="courseLog.php" method="get" name="additional_profile_field_form" id="additional_profile_field_form">';
@@ -6102,8 +6102,8 @@  discard block
 block discarded – undo
6102 6102
     	$extra_fields_to_show = 0;
6103 6103
     	foreach ($extra_fields as $key=>$field) {
6104 6104
     		// show only extra fields that are visible + and can be filtered, added by J.Montoya
6105
-    		if ($field[6]==1 && $field[8] == 1) {
6106
-    			if (isset($_GET['additional_profile_field']) && $field[0] == $_GET['additional_profile_field'] ) {
6105
+    		if ($field[6] == 1 && $field[8] == 1) {
6106
+    			if (isset($_GET['additional_profile_field']) && $field[0] == $_GET['additional_profile_field']) {
6107 6107
     				$selected = 'selected="selected"';
6108 6108
     			} else {
6109 6109
     				$selected = '';
@@ -6115,8 +6115,8 @@  discard block
 block discarded – undo
6115 6115
     	$return .= '</select>';
6116 6116
 
6117 6117
     	// the form elements for the $_GET parameters (because the form is passed through GET
6118
-    	foreach ($_GET as $key=>$value){
6119
-    		if ($key <> 'additional_profile_field')    {
6118
+    	foreach ($_GET as $key=>$value) {
6119
+    		if ($key <> 'additional_profile_field') {
6120 6120
     			$return .= '<input type="hidden" name="'.Security::remove_XSS($key).'" value="'.Security::remove_XSS($value).'" />';
6121 6121
     		}
6122 6122
     	}
@@ -6153,21 +6153,21 @@  discard block
 block discarded – undo
6153 6153
     	$result_extra_field = UserManager::get_extra_field_information($field_id);
6154 6154
 
6155 6155
     	if (!empty($users)) {
6156
-    		if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG ) {
6157
-    			foreach($users as $user_id) {
6156
+    		if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG) {
6157
+    			foreach ($users as $user_id) {
6158 6158
     				$user_result = UserManager::get_user_tags($user_id, $field_id);
6159 6159
     				$tag_list = array();
6160
-    				foreach($user_result as $item) {
6160
+    				foreach ($user_result as $item) {
6161 6161
     					$tag_list[] = $item['tag'];
6162 6162
     				}
6163
-    				$return[$user_id][] = implode(', ',$tag_list);
6163
+    				$return[$user_id][] = implode(', ', $tag_list);
6164 6164
     			}
6165 6165
     		} else {
6166 6166
     			$new_user_array = array();
6167 6167
     			foreach ($users as $user_id) {
6168
-    				$new_user_array[]= "'".$user_id."'";
6168
+    				$new_user_array[] = "'".$user_id."'";
6169 6169
     			}
6170
-    			$users = implode(',',$new_user_array);
6170
+    			$users = implode(',', $new_user_array);
6171 6171
                 $extraFieldType = EntityExtraField::USER_FIELD_TYPE;
6172 6172
     			// Selecting only the necessary information NOT ALL the user list
6173 6173
     			$sql = "SELECT user.user_id, v.value
@@ -6182,7 +6182,7 @@  discard block
 block discarded – undo
6182 6182
                             user.user_id IN ($users)";
6183 6183
 
6184 6184
     			$result = Database::query($sql);
6185
-    			while($row = Database::fetch_array($result)) {
6185
+    			while ($row = Database::fetch_array($result)) {
6186 6186
     				// get option value for field type double select by id
6187 6187
     				if (!empty($row['value'])) {
6188 6188
     					if ($result_extra_field['field_type'] ==
@@ -6221,7 +6221,7 @@  discard block
 block discarded – undo
6221 6221
 
6222 6222
     public function sort_users_desc($a, $b)
6223 6223
     {
6224
-    	return strcmp( trim(api_strtolower($b[$_SESSION['tracking_column']])), trim(api_strtolower($a[$_SESSION['tracking_column']])));
6224
+    	return strcmp(trim(api_strtolower($b[$_SESSION['tracking_column']])), trim(api_strtolower($a[$_SESSION['tracking_column']])));
6225 6225
     }
6226 6226
 
6227 6227
     /**
@@ -6256,7 +6256,7 @@  discard block
 block discarded – undo
6256 6256
     	// get all users data from a course for sortable with limit
6257 6257
     	if (is_array($user_ids)) {
6258 6258
     		$user_ids = array_map('intval', $user_ids);
6259
-    		$condition_user = " WHERE user.user_id IN (".implode(',',$user_ids).") ";
6259
+    		$condition_user = " WHERE user.user_id IN (".implode(',', $user_ids).") ";
6260 6260
     	} else {
6261 6261
     		$user_ids = intval($user_ids);
6262 6262
     		$condition_user = " WHERE user.user_id = $user_ids ";
@@ -6264,7 +6264,7 @@  discard block
 block discarded – undo
6264 6264
 
6265 6265
     	if (!empty($_GET['user_keyword'])) {
6266 6266
     		$keyword = trim(Database::escape_string($_GET['user_keyword']));
6267
-    		$condition_user .=  " AND (
6267
+    		$condition_user .= " AND (
6268 6268
                 user.firstname LIKE '%".$keyword."%' OR
6269 6269
                 user.lastname LIKE '%".$keyword."%'  OR
6270 6270
                 user.username LIKE '%".$keyword."%'  OR
@@ -6282,7 +6282,7 @@  discard block
 block discarded – undo
6282 6282
         $invitedUsersCondition = '';
6283 6283
 
6284 6284
         if (!$includeInvitedUsers) {
6285
-            $invitedUsersCondition = " AND user.status != " . INVITEE;
6285
+            $invitedUsersCondition = " AND user.status != ".INVITEE;
6286 6286
         }
6287 6287
 
6288 6288
     	$sql = "SELECT  user.user_id as user_id,
@@ -6293,7 +6293,7 @@  discard block
 block discarded – undo
6293 6293
                 FROM $tbl_user as user $url_table
6294 6294
     	        $condition_user $url_condition $invitedUsersCondition";
6295 6295
 
6296
-    	if (!in_array($direction, array('ASC','DESC'))) {
6296
+    	if (!in_array($direction, array('ASC', 'DESC'))) {
6297 6297
     		$direction = 'ASC';
6298 6298
     	}
6299 6299
 
@@ -6430,7 +6430,7 @@  discard block
 block discarded – undo
6430 6430
     		}
6431 6431
 
6432 6432
             if (empty($session_id)) {
6433
-                $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0) .' / '.$total_surveys;
6433
+                $user['survey'] = (isset($survey_user_list[$user['user_id']]) ? $survey_user_list[$user['user_id']] : 0).' / '.$total_surveys;
6434 6434
             }
6435 6435
 
6436 6436
     		$user['link'] = '<center>
@@ -6442,34 +6442,34 @@  discard block
 block discarded – undo
6442 6442
     		// store columns in array $users
6443 6443
     		$is_western_name_order = api_is_western_name_order();
6444 6444
             $user_row = array();
6445
-            $user_row[]= $user['official_code']; //0
6445
+            $user_row[] = $user['official_code']; //0
6446 6446
             if ($is_western_name_order) {
6447
-                $user_row[]= $user['firstname'];
6448
-                $user_row[]= $user['lastname'];
6447
+                $user_row[] = $user['firstname'];
6448
+                $user_row[] = $user['lastname'];
6449 6449
             } else {
6450
-                $user_row[]= $user['lastname'];
6451
-                $user_row[]= $user['firstname'];
6450
+                $user_row[] = $user['lastname'];
6451
+                $user_row[] = $user['firstname'];
6452 6452
             }
6453
-            $user_row[]= $user['username'];
6454
-            $user_row[]= $user['time'];
6455
-            $user_row[]= $user['average_progress'];
6456
-            $user_row[]= $user['exercise_progress'];
6457
-            $user_row[]= $user['exercise_average_best_attempt'];
6458
-            $user_row[]= $user['student_score'];
6459
-            $user_row[]= $user['count_assignments'];
6460
-            $user_row[]= $user['count_messages'];
6453
+            $user_row[] = $user['username'];
6454
+            $user_row[] = $user['time'];
6455
+            $user_row[] = $user['average_progress'];
6456
+            $user_row[] = $user['exercise_progress'];
6457
+            $user_row[] = $user['exercise_average_best_attempt'];
6458
+            $user_row[] = $user['student_score'];
6459
+            $user_row[] = $user['count_assignments'];
6460
+            $user_row[] = $user['count_messages'];
6461 6461
 
6462 6462
             if (empty($session_id)) {
6463
-                $user_row[]= $user['survey'];
6463
+                $user_row[] = $user['survey'];
6464 6464
             }
6465 6465
 
6466
-            $user_row[]= $user['first_connection'];
6467
-            $user_row[]= $user['last_connection'];
6466
+            $user_row[] = $user['first_connection'];
6467
+            $user_row[] = $user['last_connection'];
6468 6468
             if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_profile_field'])) {
6469
-                $user_row[]= $user['additional'];
6469
+                $user_row[] = $user['additional'];
6470 6470
             }
6471 6471
 
6472
-            $user_row[]= $user['link'];
6472
+            $user_row[] = $user['link'];
6473 6473
 
6474 6474
             $users[] = $user_row;
6475 6475
 
@@ -6514,8 +6514,8 @@  discard block
 block discarded – undo
6514 6514
 
6515 6515
     	$track_access_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
6516 6516
     	$tempView = $view;
6517
-    	if(substr($view,0,1) == '1') {
6518
-    		$new_view = substr_replace($view,'0',0,1);
6517
+    	if (substr($view, 0, 1) == '1') {
6518
+    		$new_view = substr_replace($view, '0', 0, 1);
6519 6519
     		echo "
6520 6520
                 <tr>
6521 6521
                     <td valign='top'>
@@ -6548,9 +6548,9 @@  discard block
 block discarded – undo
6548 6548
                 </tr>";
6549 6549
     		$total = 0;
6550 6550
     		if (is_array($results)) {
6551
-    			for($j = 0 ; $j < count($results) ; $j++) {
6551
+    			for ($j = 0; $j < count($results); $j++) {
6552 6552
     				echo "<tr>";
6553
-    				echo "<td class='content'><a href='logins_details.php?uInfo=".$user_id."&reqdate=".$results[$j][0]."&view=".Security::remove_XSS($view)."'>".$MonthsLong[date('n', $results[$j][0])-1].' '.date('Y', $results[$j][0])."</a></td>";
6553
+    				echo "<td class='content'><a href='logins_details.php?uInfo=".$user_id."&reqdate=".$results[$j][0]."&view=".Security::remove_XSS($view)."'>".$MonthsLong[date('n', $results[$j][0]) - 1].' '.date('Y', $results[$j][0])."</a></td>";
6554 6554
     				echo "<td valign='top' align='right' class='content'>".$results[$j][1]."</td>";
6555 6555
     				echo"</tr>";
6556 6556
     				$total = $total + $results[$j][1];
@@ -6567,7 +6567,7 @@  discard block
 block discarded – undo
6567 6567
     		echo "</table>";
6568 6568
     		echo "</td></tr>";
6569 6569
     	} else {
6570
-    		$new_view = substr_replace($view,'1',0,1);
6570
+    		$new_view = substr_replace($view, '1', 0, 1);
6571 6571
     		echo "
6572 6572
                 <tr>
6573 6573
                     <td valign='top'>
@@ -6590,8 +6590,8 @@  discard block
 block discarded – undo
6590 6590
     {
6591 6591
     	global $TBL_TRACK_HOTPOTATOES, $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $dateTimeFormatLong;
6592 6592
         $courseId = api_get_course_int_id($courseCode);
6593
-    	if(substr($view,1,1) == '1') {
6594
-    		$new_view = substr_replace($view,'0',1,1);
6593
+    	if (substr($view, 1, 1) == '1') {
6594
+    		$new_view = substr_replace($view, '0', 1, 1);
6595 6595
     		echo "<tr>
6596 6596
                     <td valign='top'>
6597 6597
                         <font color='#0000FF'>-&nbsp;&nbsp;&nbsp;</font><b>".get_lang('ExercicesResults')."</b>&nbsp;&nbsp;&nbsp;[<a href='".api_get_self()."?uInfo=".Security::remove_XSS($user_id)."&view=".Security::remove_XSS($new_view)."'>".get_lang('Close')."</a>]&nbsp;&nbsp;&nbsp;[<a href='userLogCSV.php?".api_get_cidreq()."&uInfo=".Security::remove_XSS($_GET['uInfo'])."&view=01000'>".get_lang('ExportAsCSV')."</a>]
@@ -6633,7 +6633,7 @@  discard block
 block discarded – undo
6633 6633
                 </tr>";
6634 6634
 
6635 6635
     		if (is_array($results)) {
6636
-    			for($i = 0; $i < sizeof($results); $i++) {
6636
+    			for ($i = 0; $i < sizeof($results); $i++) {
6637 6637
     				$display_date = api_convert_and_format_date($results[$i][3], null, date_default_timezone_get());
6638 6638
     				echo "<tr>\n";
6639 6639
     				echo "<td class='content'>".$results[$i][0]."</td>\n";
@@ -6648,8 +6648,8 @@  discard block
 block discarded – undo
6648 6648
 
6649 6649
     		// The Result of Tests
6650 6650
     		if (is_array($hpresults)) {
6651
-    			for($i = 0; $i < sizeof($hpresults); $i++) {
6652
-    				$title = GetQuizName($hpresults[$i][0],'');
6651
+    			for ($i = 0; $i < sizeof($hpresults); $i++) {
6652
+    				$title = GetQuizName($hpresults[$i][0], '');
6653 6653
     				if ($title == '')
6654 6654
     				$title = basename($hpresults[$i][0]);
6655 6655
     				$display_date = api_convert_and_format_date($hpresults[$i][3], null, date_default_timezone_get());
@@ -6675,7 +6675,7 @@  discard block
 block discarded – undo
6675 6675
     		echo "</table>";
6676 6676
     		echo "</td>\n</tr>\n";
6677 6677
     	} else {
6678
-    		$new_view = substr_replace($view,'1',1,1);
6678
+    		$new_view = substr_replace($view, '1', 1, 1);
6679 6679
     		echo "
6680 6680
                 <tr>
6681 6681
                     <td valign='top'>
@@ -6694,8 +6694,8 @@  discard block
 block discarded – undo
6694 6694
     	global $TABLETRACK_UPLOADS, $TABLECOURSE_WORK;
6695 6695
         $_course = api_get_course_info_by_id($course_id);
6696 6696
 
6697
-    	if (substr($view,2,1) == '1') {
6698
-    		$new_view = substr_replace($view,'0',2,1);
6697
+    	if (substr($view, 2, 1) == '1') {
6698
+    		$new_view = substr_replace($view, '0', 2, 1);
6699 6699
     		echo "<tr>
6700 6700
                     <td valign='top'>
6701 6701
                     <font color='#0000FF'>-&nbsp;&nbsp;&nbsp;</font><b>".get_lang('WorkUploads')."</b>&nbsp;&nbsp;&nbsp;[<a href='".api_get_self()."?uInfo=".Security::remove_XSS($user_id)."&view=".Security::remove_XSS($new_view)."'>".get_lang('Close')."</a>]&nbsp;&nbsp;&nbsp;[<a href='userLogCSV.php?".api_get_cidreq()."&uInfo=".Security::remove_XSS($_GET['uInfo'])."&view=00100'>".get_lang('ExportAsCSV')."</a>]
@@ -6709,7 +6709,7 @@  discard block
 block discarded – undo
6709 6709
                         AND u.c_id = '".intval($course_id)."'
6710 6710
                     ORDER BY u.upload_date DESC";
6711 6711
     		echo "<tr><td style='padding-left : 40px;padding-right : 40px;'>";
6712
-    		$results = StatsUtils::getManyResultsXCol($sql,4);
6712
+    		$results = StatsUtils::getManyResultsXCol($sql, 4);
6713 6713
     		echo "<table cellpadding='2' cellspacing='1' border='0' align=center>";
6714 6714
     		echo "<tr>
6715 6715
                     <td class='secLine' width='40%'>
@@ -6723,7 +6723,7 @@  discard block
 block discarded – undo
6723 6723
                     </td>
6724 6724
                 </tr>";
6725 6725
     		if (is_array($results)) {
6726
-    			for($j = 0 ; $j < count($results) ; $j++) {
6726
+    			for ($j = 0; $j < count($results); $j++) {
6727 6727
     				$pathToFile = api_get_path(WEB_COURSE_PATH).$_course['path']."/".$results[$j][3];
6728 6728
     				$beautifulDate = api_convert_and_format_date($results[$j][0], null, date_default_timezone_get());
6729 6729
     				echo "<tr>";
@@ -6742,7 +6742,7 @@  discard block
 block discarded – undo
6742 6742
     		echo "</table>";
6743 6743
     		echo "</td></tr>";
6744 6744
     	} else {
6745
-    		$new_view = substr_replace($view,'1',2,1);
6745
+    		$new_view = substr_replace($view, '1', 2, 1);
6746 6746
     		echo "
6747 6747
                 <tr>
6748 6748
                     <td valign='top'>
@@ -6761,8 +6761,8 @@  discard block
 block discarded – undo
6761 6761
     {
6762 6762
     	global $TABLETRACK_LINKS, $TABLECOURSE_LINKS;
6763 6763
         $courseId = api_get_course_int_id($courseCode);
6764
-    	if (substr($view,3,1) == '1') {
6765
-    		$new_view = substr_replace($view,'0',3,1);
6764
+    	if (substr($view, 3, 1) == '1') {
6765
+    		$new_view = substr_replace($view, '0', 3, 1);
6766 6766
     		echo "
6767 6767
                 <tr>
6768 6768
                         <td valign='top'>
@@ -6786,7 +6786,7 @@  discard block
 block discarded – undo
6786 6786
                     </td>
6787 6787
                 </tr>";
6788 6788
     		if (is_array($results)) {
6789
-    			for($j = 0 ; $j < count($results) ; $j++) {
6789
+    			for ($j = 0; $j < count($results); $j++) {
6790 6790
     				echo "<tr>";
6791 6791
     				echo "<td class='content'><a href='".$results[$j][1]."'>".$results[$j][0]."</a></td>";
6792 6792
     				echo"</tr>";
@@ -6799,7 +6799,7 @@  discard block
 block discarded – undo
6799 6799
     		echo "</table>";
6800 6800
     		echo "</td></tr>";
6801 6801
     	} else {
6802
-    		$new_view = substr_replace($view,'1',3,1);
6802
+    		$new_view = substr_replace($view, '1', 3, 1);
6803 6803
     		echo "
6804 6804
                 <tr>
6805 6805
                     <td valign='top'>
@@ -6826,8 +6826,8 @@  discard block
 block discarded – undo
6826 6826
     	$session_id = intval($session_id);
6827 6827
 
6828 6828
     	$downloads_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
6829
-    	if(substr($view,4,1) == '1') {
6830
-    		$new_view = substr_replace($view,'0',4,1);
6829
+    	if (substr($view, 4, 1) == '1') {
6830
+    		$new_view = substr_replace($view, '0', 4, 1);
6831 6831
     		echo "
6832 6832
                 <tr>
6833 6833
                     <td valign='top'>
@@ -6853,7 +6853,7 @@  discard block
 block discarded – undo
6853 6853
                     </td>
6854 6854
                 </tr>";
6855 6855
     		if (is_array($results)) {
6856
-    			for($j = 0 ; $j < count($results) ; $j++) {
6856
+    			for ($j = 0; $j < count($results); $j++) {
6857 6857
     				echo "<tr>";
6858 6858
     				echo "<td class='content'>".$results[$j]."</td>";
6859 6859
     				echo"</tr>";
@@ -6866,7 +6866,7 @@  discard block
 block discarded – undo
6866 6866
     		echo "</table>";
6867 6867
     		echo "</td></tr>";
6868 6868
     	} else {
6869
-    		$new_view = substr_replace($view,'1',4,1);
6869
+    		$new_view = substr_replace($view, '1', 4, 1);
6870 6870
     		echo "
6871 6871
                 <tr>
6872 6872
                     <td valign='top'>
@@ -6900,11 +6900,11 @@  discard block
 block discarded – undo
6900 6900
                    ORDER BY login_date DESC LIMIT 1";
6901 6901
         $ip = '';
6902 6902
         $res_ip = Database::query($sql_ip);
6903
-        if ($res_ip !== false && Database::num_rows($res_ip)>0) {
6903
+        if ($res_ip !== false && Database::num_rows($res_ip) > 0) {
6904 6904
             $row_ip = Database::fetch_row($res_ip);
6905 6905
             if ($return_as_link) {
6906 6906
                 $ip = Display::url(
6907
-                    (empty($body_replace)?$row_ip[1]:$body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1],
6907
+                    (empty($body_replace) ? $row_ip[1] : $body_replace), 'http://www.whatsmyip.org/ip-geo-location/?ip='.$row_ip[1],
6908 6908
                     array('title'=>get_lang('TraceIP'), 'target'=>'_blank')
6909 6909
                 );
6910 6910
             } else {
@@ -6940,9 +6940,9 @@  discard block
 block discarded – undo
6940 6940
     	$course_id  = intval($course_id);
6941 6941
 
6942 6942
     	$tempView = $view;
6943
-    	if (substr($view,0,1) == '1') {
6944
-    		$new_view = substr_replace($view,'0',0,1);
6945
-    		$title[1]= get_lang('LoginsAndAccessTools').get_lang('LoginsDetails');
6943
+    	if (substr($view, 0, 1) == '1') {
6944
+    		$new_view = substr_replace($view, '0', 0, 1);
6945
+    		$title[1] = get_lang('LoginsAndAccessTools').get_lang('LoginsDetails');
6946 6946
     		$sql = "SELECT UNIX_TIMESTAMP(access_date), count(access_date)
6947 6947
                     FROM $track_access_table
6948 6948
                     WHERE access_user_id = $user_id
@@ -6952,20 +6952,20 @@  discard block
 block discarded – undo
6952 6952
                     ORDER BY YEAR(access_date),MONTH(access_date) ASC";
6953 6953
     		//$results = getManyResults2Col($sql);
6954 6954
     		$results = getManyResults3Col($sql);
6955
-    		$title_line= get_lang('LoginsTitleMonthColumn').';'.get_lang('LoginsTitleCountColumn')."\n";
6956
-    		$line='';
6955
+    		$title_line = get_lang('LoginsTitleMonthColumn').';'.get_lang('LoginsTitleCountColumn')."\n";
6956
+    		$line = '';
6957 6957
     		$total = 0;
6958 6958
     		if (is_array($results)) {
6959
-    			for($j = 0 ; $j < count($results) ; $j++) {
6959
+    			for ($j = 0; $j < count($results); $j++) {
6960 6960
     				$line .= $results[$j][0].';'.$results[$j][1]."\n";
6961 6961
     				$total = $total + $results[$j][1];
6962 6962
     			}
6963 6963
     			$line .= get_lang('Total').";".$total."\n";
6964 6964
     		} else {
6965
-    			$line= get_lang('NoResult')."</center></td>";
6965
+    			$line = get_lang('NoResult')."</center></td>";
6966 6966
     		}
6967 6967
     	} else {
6968
-    		$new_view = substr_replace($view,'1',0,1);
6968
+    		$new_view = substr_replace($view, '1', 0, 1);
6969 6969
     	}
6970 6970
     	return array($title_line, $line);
6971 6971
     }
@@ -6983,8 +6983,8 @@  discard block
 block discarded – undo
6983 6983
     	global $TABLECOURSE_EXERCICES, $TABLETRACK_EXERCICES, $TABLETRACK_HOTPOTATOES, $dateTimeFormatLong;
6984 6984
         $courseId = api_get_course_int_id($courseCode);
6985 6985
         $userId = intval($userId);
6986
-    	if (substr($view,1,1) == '1') {
6987
-    		$new_view = substr_replace($view,'0',1,1);
6986
+    	if (substr($view, 1, 1) == '1') {
6987
+    		$new_view = substr_replace($view, '0', 1, 1);
6988 6988
     		$title[1] = get_lang('ExercicesDetails');
6989 6989
     		$line = '';
6990 6990
     		$sql = "SELECT ce.title, te.exe_result , te.exe_weighting, UNIX_TIMESTAMP(te.exe_date)
@@ -7008,7 +7008,7 @@  discard block
 block discarded – undo
7008 7008
     		$title_line = get_lang('ExercicesTitleExerciceColumn').";".get_lang('Date').';'.get_lang('ExercicesTitleScoreColumn')."\n";
7009 7009
 
7010 7010
     		if (is_array($results)) {
7011
-    			for($i = 0; $i < sizeof($results); $i++)
7011
+    			for ($i = 0; $i < sizeof($results); $i++)
7012 7012
     			{
7013 7013
     				$display_date = api_convert_and_format_date($results[$i][3], null, date_default_timezone_get());
7014 7014
     				$line .= $results[$i][0].";".$display_date.";".$results[$i][1]." / ".$results[$i][2]."\n";
@@ -7020,8 +7020,8 @@  discard block
 block discarded – undo
7020 7020
 
7021 7021
     		// The Result of Tests
7022 7022
     		if (is_array($hpresults)) {
7023
-    			for($i = 0; $i < sizeof($hpresults); $i++) {
7024
-    				$title = GetQuizName($hpresults[$i][0],'');
7023
+    			for ($i = 0; $i < sizeof($hpresults); $i++) {
7024
+    				$title = GetQuizName($hpresults[$i][0], '');
7025 7025
 
7026 7026
     				if ($title == '')
7027 7027
     				$title = basename($hpresults[$i][0]);
@@ -7035,10 +7035,10 @@  discard block
 block discarded – undo
7035 7035
     		}
7036 7036
 
7037 7037
     		if ($NoTestRes == 1 && $NoHPTestRes == 1) {
7038
-    			$line=get_lang('NoResult');
7038
+    			$line = get_lang('NoResult');
7039 7039
     		}
7040 7040
     	} else {
7041
-    		$new_view = substr_replace($view,'1',1,1);
7041
+    		$new_view = substr_replace($view, '1', 1, 1);
7042 7042
     	}
7043 7043
     	return array($title_line, $line);
7044 7044
     }
@@ -7054,7 +7054,7 @@  discard block
 block discarded – undo
7054 7054
         $user_id = intval($user_id);
7055 7055
         $course_id = intval($course_id);
7056 7056
 
7057
-    	if (substr($view,2,1) == '1') {
7057
+    	if (substr($view, 2, 1) == '1') {
7058 7058
     		$sql = "SELECT u.upload_date, w.title, w.author, w.url
7059 7059
                     FROM $TABLETRACK_UPLOADS u , $TABLECOURSE_WORK w
7060 7060
                     WHERE
@@ -7062,21 +7062,21 @@  discard block
 block discarded – undo
7062 7062
                         u.upload_user_id = '$user_id' AND
7063 7063
                         u.c_id = '$course_id'
7064 7064
                     ORDER BY u.upload_date DESC";
7065
-    		$results = StatsUtils::getManyResultsXCol($sql,4);
7065
+    		$results = StatsUtils::getManyResultsXCol($sql, 4);
7066 7066
 
7067
-    		$title[1]=get_lang('WorksDetails');
7068
-    		$line='';
7069
-    		$title_line=get_lang('WorkTitle').";".get_lang('WorkAuthors').";".get_lang('Date')."\n";
7067
+    		$title[1] = get_lang('WorksDetails');
7068
+    		$line = '';
7069
+    		$title_line = get_lang('WorkTitle').";".get_lang('WorkAuthors').";".get_lang('Date')."\n";
7070 7070
 
7071 7071
     		if (is_array($results)) {
7072
-    			for($j = 0 ; $j < count($results) ; $j++) {
7072
+    			for ($j = 0; $j < count($results); $j++) {
7073 7073
     				$pathToFile = api_get_path(WEB_COURSE_PATH).$_course['path']."/".$results[$j][3];
7074 7074
     				$beautifulDate = api_convert_and_format_date($results[$j][0], null, date_default_timezone_get());
7075 7075
     				$line .= $results[$j][1].";".$results[$j][2].";".$beautifulDate."\n";
7076 7076
     			}
7077 7077
 
7078 7078
     		} else {
7079
-    			$line= get_lang('NoResult');
7079
+    			$line = get_lang('NoResult');
7080 7080
     		}
7081 7081
     	}
7082 7082
     	return array($title_line, $line);
@@ -7092,9 +7092,9 @@  discard block
 block discarded – undo
7092 7092
         $courseId = api_get_course_int_id($courseCode);
7093 7093
         $userId = intval($userId);
7094 7094
         $line = null;
7095
-    	if (substr($view,3,1) == '1') {
7096
-    		$new_view = substr_replace($view,'0',3,1);
7097
-    		$title[1]=get_lang('LinksDetails');
7095
+    	if (substr($view, 3, 1) == '1') {
7096
+    		$new_view = substr_replace($view, '0', 3, 1);
7097
+    		$title[1] = get_lang('LinksDetails');
7098 7098
     		$sql = "SELECT cl.title, cl.url
7099 7099
                         FROM $TABLETRACK_LINKS AS sl, $TABLECOURSE_LINKS AS cl
7100 7100
                         WHERE sl.links_link_id = cl.id
@@ -7102,16 +7102,16 @@  discard block
 block discarded – undo
7102 7102
                             AND sl.links_user_id = $userId
7103 7103
                         GROUP BY cl.title, cl.url";
7104 7104
     		$results = StatsUtils::getManyResults2Col($sql);
7105
-    		$title_line= get_lang('LinksTitleLinkColumn')."\n";
7105
+    		$title_line = get_lang('LinksTitleLinkColumn')."\n";
7106 7106
     		if (is_array($results)) {
7107
-    			for ($j = 0 ; $j < count($results) ; $j++) {
7107
+    			for ($j = 0; $j < count($results); $j++) {
7108 7108
     				$line .= $results[$j][0]."\n";
7109 7109
     			}
7110 7110
     		} else {
7111
-    			$line=get_lang('NoResult');
7111
+    			$line = get_lang('NoResult');
7112 7112
     		}
7113 7113
     	} else {
7114
-    		$new_view = substr_replace($view,'1',3,1);
7114
+    		$new_view = substr_replace($view, '1', 3, 1);
7115 7115
     	}
7116 7116
     	return array($title_line, $line);
7117 7117
     }
@@ -7133,9 +7133,9 @@  discard block
 block discarded – undo
7133 7133
 
7134 7134
     	$downloads_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DOWNLOADS);
7135 7135
 
7136
-    	if (substr($view,4,1) == '1') {
7137
-    		$new_view = substr_replace($view,'0',4,1);
7138
-    		$title[1]= get_lang('DocumentsDetails');
7136
+    	if (substr($view, 4, 1) == '1') {
7137
+    		$new_view = substr_replace($view, '0', 4, 1);
7138
+    		$title[1] = get_lang('DocumentsDetails');
7139 7139
 
7140 7140
     		$sql = "SELECT down_doc_path
7141 7141
                         FROM $downloads_table
@@ -7148,14 +7148,14 @@  discard block
 block discarded – undo
7148 7148
     		$title_line = get_lang('DocumentsTitleDocumentColumn')."\n";
7149 7149
             $line = null;
7150 7150
     		if (is_array($results)) {
7151
-    			for ($j = 0 ; $j < count($results) ; $j++) {
7151
+    			for ($j = 0; $j < count($results); $j++) {
7152 7152
     				$line .= $results[$j]."\n";
7153 7153
     			}
7154 7154
     		} else {
7155 7155
     			$line = get_lang('NoResult');
7156 7156
     		}
7157 7157
     	} else {
7158
-    		$new_view = substr_replace($view,'1',4,1);
7158
+    		$new_view = substr_replace($view, '1', 4, 1);
7159 7159
     	}
7160 7160
     	return array($title_line, $line);
7161 7161
     }
Please login to merge, or discard this patch.
main/course_description/index.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 */
10 10
 
11 11
 require_once '../inc/global.inc.php';
12
-$current_course_tool  = TOOL_COURSE_DESCRIPTION;
12
+$current_course_tool = TOOL_COURSE_DESCRIPTION;
13 13
 
14 14
 // defining constants
15 15
 define('ADD_BLOCK', 8);
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 // get actions
24 24
 $actions = array('listing', 'add', 'edit', 'delete', 'history');
25 25
 $action = 'listing';
26
-if (isset($_GET['action']) && in_array($_GET['action'],$actions)) {
26
+if (isset($_GET['action']) && in_array($_GET['action'], $actions)) {
27 27
 	$action = $_GET['action'];
28 28
 }
29 29
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 }
43 43
 
44 44
 // interbreadcrumb
45
-$interbreadcrumb[] = array ("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
45
+$interbreadcrumb[] = array("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
46 46
 if ($description_type == 1) {
47 47
     $interbreadcrumb[] = array("url" => "#", "name" => get_lang('GeneralDescription'));
48 48
 }
Please login to merge, or discard this patch.
main/course_description/add.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,26 +11,26 @@
 block discarded – undo
11 11
 api_protect_course_script(true);
12 12
 
13 13
 // display categories
14
-$categories = array ();
14
+$categories = array();
15 15
 foreach ($default_description_titles as $id => $title) {
16 16
 	$categories[$id] = $title;
17 17
 }
18 18
 $categories[ADD_BLOCK] = get_lang('NewBloc');
19 19
 
20
-$i=1;
20
+$i = 1;
21 21
 echo '<div class="actions" style="margin-bottom:30px">';
22 22
 echo '<a href="index.php?'.api_get_cidreq().'">'.
23
-	Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('ToolCourseDescription'),'',ICON_SIZE_MEDIUM).
23
+	Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('ToolCourseDescription'), '', ICON_SIZE_MEDIUM).
24 24
 	'</a>';
25 25
 ksort($categories);
26 26
 foreach ($categories as $id => $title) {
27 27
 	if ($i == ADD_BLOCK) {
28 28
 		echo '<a href="index.php?'.api_get_cidreq().'&action=add">'.
29
-			Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'</a>';
29
+			Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
30 30
 		break;
31 31
 	} else {
32 32
 		echo '<a href="index.php?action=edit&'.api_get_cidreq().'&description_type='.$id.'">'.
33
-			Display::return_icon($default_description_icon[$id], $title,'',ICON_SIZE_MEDIUM).'</a>';
33
+			Display::return_icon($default_description_icon[$id], $title, '', ICON_SIZE_MEDIUM).'</a>';
34 34
 		$i++;
35 35
 	}
36 36
 }
Please login to merge, or discard this patch.
main/inc/lib/banner.lib.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $navigation['mycourses']['key'] = 'my-course';
40 40
 
41 41
     // My Profile
42
-    $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
42
+    $navigation['myprofile']['url'] = api_get_path(WEB_CODE_PATH).'auth/profile.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '');
43 43
     $navigation['myprofile']['title'] = get_lang('ModifyProfile');
44 44
     $navigation['myprofile']['key'] = 'profile';
45 45
 	// Link to my agenda
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
 	// Gradebook
51 51
 	if (api_get_setting('gradebook_enable') == 'true') {
52
-        $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '' );
52
+        $navigation['mygradebook']['url'] = api_get_path(WEB_CODE_PATH).'gradebook/gradebook.php'.(!empty($_course['path']) ? '?coursePath='.$_course['path'].'&amp;courseCode='.$_course['official_code'] : '');
53 53
         $navigation['mygradebook']['title'] = get_lang('MyGradebook');
54 54
         $navigation['mygradebook']['key'] = 'gradebook';
55 55
 	}
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
 	// Reporting
58 58
 	if (api_is_allowed_to_create_course() || api_is_drh() || api_is_session_admin()) {
59 59
         // Link to my space
60
-        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh()?'session.php':'');
60
+        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/'.(api_is_drh() ? 'session.php' : '');
61 61
         $navigation['session_my_space']['title'] = get_lang('MySpace');
62 62
         $navigation['session_my_space']['key'] = 'my-space';
63 63
     } else if (api_is_student_boss()) {
64
-        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH) . 'mySpace/student.php';
64
+        $navigation['session_my_space']['url'] = api_get_path(WEB_CODE_PATH).'mySpace/student.php';
65 65
         $navigation['session_my_space']['title'] = get_lang('MySpace');
66 66
         $navigation['session_my_space']['key'] = 'my-space';
67 67
     } else {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     }
81 81
 
82 82
 	// Social
83
-	if (api_get_setting('allow_social_tool')=='true') {
83
+	if (api_get_setting('allow_social_tool') == 'true') {
84 84
         $navigation['social']['url'] = api_get_path(WEB_CODE_PATH).'social/home.php';
85 85
         $navigation['social']['title'] = get_lang('SocialNetwork');
86 86
         $navigation['social']['key'] = 'social-network';
@@ -161,14 +161,14 @@  discard block
 block discarded – undo
161 161
         'id' => 'header-logo'
162 162
     );
163 163
     $testServer = api_get_setting('server_type');
164
-    if ($testServer == 'test' && is_file($logoBase . 'svg')) {
165
-        $logo = $logoBase . 'svg';
164
+    if ($testServer == 'test' && is_file($logoBase.'svg')) {
165
+        $logo = $logoBase.'svg';
166 166
         $attributes['width'] = '245';
167 167
         $attributes['height'] = '68';
168 168
         $imageUrl = api_get_path(WEB_CSS_PATH).'themes/'.$theme.'/images/header-logo.svg';
169 169
     } else {
170
-        $logo = $logoBase . 'png';
171
-        $customLogo = $customLogoBase . 'png';
170
+        $logo = $logoBase.'png';
171
+        $customLogo = $customLogoBase.'png';
172 172
         $imageUrl = api_get_path(WEB_CSS_PATH).'themes/'.$theme.'/images/header-logo.png';
173 173
         $customImageUrl = api_get_path(WEB_CSS_PATH).'themes/'.$theme.'/images/header-logo-custom.png';
174 174
     }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
     $_course = api_get_course_info();
219 219
     $course_id = 0;
220 220
     if (!empty($_course)) {
221
-        $course_id  = $_course['code'];
221
+        $course_id = $_course['code'];
222 222
     }
223 223
 
224 224
     $user_id = api_get_user_id();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
         if (api_get_setting('gradebook_enable') == 'true') {
316 316
             if (api_get_setting('show_tabs', 'my_gradebook') == 'true') {
317 317
                 $navigation['mygradebook'] = $possible_tabs['mygradebook'];
318
-            } else{
318
+            } else {
319 319
                 $menu_navigation['mygradebook'] = $possible_tabs['mygradebook'];
320 320
             }
321 321
         }
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
             if (api_get_setting('allow_social_tool') == 'true') {
341 341
                 $navigation['social'] = isset($possible_tabs['social']) ? $possible_tabs['social'] : null;
342 342
             }
343
-        } else{
343
+        } else {
344 344
             $menu_navigation['social'] = isset($possible_tabs['social']) ? $possible_tabs['social'] : null;
345 345
         }
346 346
 
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             if (api_is_platform_admin() || api_is_drh() || api_is_session_admin()) {
350 350
                 $navigation['dashboard'] = isset($possible_tabs['dashboard']) ? $possible_tabs['dashboard'] : null;
351 351
             }
352
-        } else{
352
+        } else {
353 353
             $menu_navigation['dashboard'] = isset($possible_tabs['dashboard']) ? $possible_tabs['dashboard'] : null;
354 354
         }
355 355
 
@@ -440,32 +440,32 @@  discard block
 block discarded – undo
440 440
     $home_top = '';
441 441
 
442 442
     if (is_file($homep.$menutabs.'_'.$lang.$ext) && is_readable($homep.$menutabs.'_'.$lang.$ext)) {
443
-        $home_top = @(string)file_get_contents($homep.$menutabs.'_'.$lang.$ext);
443
+        $home_top = @(string) file_get_contents($homep.$menutabs.'_'.$lang.$ext);
444 444
     } elseif (is_file($homep.$menutabs.$lang.$ext) && is_readable($homep.$menutabs.$lang.$ext)) {
445
-        $home_top = @(string)file_get_contents($homep.$menutabs.$lang.$ext);
445
+        $home_top = @(string) file_get_contents($homep.$menutabs.$lang.$ext);
446 446
     } else {
447 447
         //$errorMsg = get_lang('HomePageFilesNotReadable');
448 448
     }
449 449
 
450 450
     $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top)));
451 451
 
452
-    $open = str_replace('{rel_path}',api_get_path(REL_PATH), $home_top);
452
+    $open = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top);
453 453
     $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
454 454
 
455 455
     $open_mtloggedin = '';
456 456
     if (api_get_user_id() && !api_is_anonymous()) {
457 457
         if (is_file($homep.$mtloggedin.'_'.$lang.$ext) && is_readable($homep.$mtloggedin.'_'.$lang.$ext)) {
458
-            $home_top = @(string)file_get_contents($homep.$mtloggedin.'_'.$lang.$ext);
458
+            $home_top = @(string) file_get_contents($homep.$mtloggedin.'_'.$lang.$ext);
459 459
             $home_top = str_replace('::private', '', $home_top);
460 460
         } elseif (is_file($homep.$mtloggedin.$lang.$ext) && is_readable($homep.$mtloggedin.$lang.$ext)) {
461
-            $home_top = @(string)file_get_contents($homep.$mtloggedin.$lang.$ext);
461
+            $home_top = @(string) file_get_contents($homep.$mtloggedin.$lang.$ext);
462 462
             $home_top = str_replace('::private', '', $home_top);
463 463
         } else {
464 464
             //$errorMsg = get_lang('HomePageFilesNotReadable');
465 465
         }
466 466
 
467 467
         $home_top = api_to_system_encoding($home_top, api_detect_encoding(strip_tags($home_top)));
468
-        $open_mtloggedin = str_replace('{rel_path}',api_get_path(REL_PATH), $home_top);
468
+        $open_mtloggedin = str_replace('{rel_path}', api_get_path(REL_PATH), $home_top);
469 469
         $open_mtloggedin = api_to_system_encoding($open_mtloggedin, api_detect_encoding(strip_tags($open_mtloggedin)));
470 470
     }
471 471
 
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
     if (!empty($open) OR !empty($open_mtloggedin)) {
475 475
         if (strpos($open.$open_mtloggedin, 'show_menu') === false) {
476 476
             if (api_is_anonymous()) {
477
-                $navigation[SECTION_CAMPUS]  = null;
477
+                $navigation[SECTION_CAMPUS] = null;
478 478
             }
479 479
         } else {
480 480
             if (api_get_user_id() && !api_is_anonymous()) {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
     if (count($navigation) > 0 || !empty($lis)) {
489 489
         $pre_lis = '';
490 490
         foreach ($navigation as $section => $navigation_info) {
491
-            $key = (!empty($navigation_info['key'])?'tab-'.$navigation_info['key']:'');
491
+            $key = (!empty($navigation_info['key']) ? 'tab-'.$navigation_info['key'] : '');
492 492
             if (isset($GLOBALS['this_section'])) {
493 493
                 $current = $section == $GLOBALS['this_section'] ? ' id="current" class="active '.$key.'" ' : ' class="'.$key.'"';
494 494
             } else {
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
 
533 533
     if (!empty($_course) && !isset($_GET['hide_course_breadcrumb'])) {
534 534
 
535
-        $navigation_item['url'] = $web_course_path . $_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : '');
535
+        $navigation_item['url'] = $web_course_path.$_course['path'].'/index.php'.(!empty($session_id) ? '?id_session='.$session_id : '');
536 536
         $_course['name'] = api_htmlentities($_course['name']);
537 537
         $course_title = cut($_course['name'], MAX_LENGTH_BREADCRUMB);
538 538
 
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
                 $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name;
548 548
                 break;
549 549
             default:
550
-                if (api_get_session_id() != -1 ) {
550
+                if (api_get_session_id() != -1) {
551 551
                     $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name'].$my_session_name).' '.$course_title.$my_session_name;
552 552
                 } else {
553 553
                     $navigation_item['title'] = Display::img(api_get_path(WEB_IMG_PATH).'home.png', $_course['name']).' '.$course_title;
@@ -581,22 +581,22 @@  discard block
 block discarded – undo
581 581
             // titles for shared folders
582 582
             if ($breadcrumb_step['name'] == 'shared_folder') {
583 583
                 $navigation_item['title'] = get_lang('UserFolders');
584
-            } elseif(strstr($breadcrumb_step['name'], 'shared_folder_session_')) {
584
+            } elseif (strstr($breadcrumb_step['name'], 'shared_folder_session_')) {
585 585
                 $navigation_item['title'] = get_lang('UserFolders');
586
-            } elseif(strstr($breadcrumb_step['name'], 'sf_user_')) {
586
+            } elseif (strstr($breadcrumb_step['name'], 'sf_user_')) {
587 587
                 $userinfo = api_get_user_info(substr($breadcrumb_step['name'], 8));
588 588
                 $navigation_item['title'] = $userinfo['complete_name'];
589
-            } elseif($breadcrumb_step['name'] == 'chat_files') {
589
+            } elseif ($breadcrumb_step['name'] == 'chat_files') {
590 590
                 $navigation_item['title'] = get_lang('ChatFiles');
591
-            } elseif($breadcrumb_step['name'] == 'images') {
591
+            } elseif ($breadcrumb_step['name'] == 'images') {
592 592
                 $navigation_item['title'] = get_lang('Images');
593
-            } elseif($breadcrumb_step['name'] == 'video') {
593
+            } elseif ($breadcrumb_step['name'] == 'video') {
594 594
                 $navigation_item['title'] = get_lang('Video');
595
-            } elseif($breadcrumb_step['name'] == 'audio') {
595
+            } elseif ($breadcrumb_step['name'] == 'audio') {
596 596
                 $navigation_item['title'] = get_lang('Audio');
597
-            } elseif($breadcrumb_step['name'] == 'flash') {
597
+            } elseif ($breadcrumb_step['name'] == 'flash') {
598 598
                 $navigation_item['title'] = get_lang('Flash');
599
-            } elseif($breadcrumb_step['name'] == 'gallery') {
599
+            } elseif ($breadcrumb_step['name'] == 'gallery') {
600 600
                 $navigation_item['title'] = get_lang('Gallery');
601 601
             }
602 602
             // Fixes breadcrumb title now we applied the Security::remove_XSS and
@@ -663,35 +663,35 @@  discard block
 block discarded – undo
663 663
         if (!empty($final_navigation)) {
664 664
             // $home_link.= '<span class="divider">/</span>';
665 665
             if (!empty($home_link)) {
666
-                $lis.= Display::tag('li', $home_link);
666
+                $lis .= Display::tag('li', $home_link);
667 667
             }
668 668
 
669 669
             foreach ($final_navigation as $bread) {
670 670
                 $bread_check = trim(strip_tags($bread));
671 671
                 if (!empty($bread_check)) {
672
-                    if ($final_navigation_count-1 > $i) {
672
+                    if ($final_navigation_count - 1 > $i) {
673 673
                         $bread .= '';
674 674
                     }
675
-                    $lis.= Display::tag('li', $bread,array('class'=>'active'));
675
+                    $lis .= Display::tag('li', $bread, array('class'=>'active'));
676 676
                     $i++;
677 677
                 }
678 678
             }
679 679
         } else {
680 680
             if (!empty($home_link)) {
681
-                $lis.= Display::tag('li', $home_link);
681
+                $lis .= Display::tag('li', $home_link);
682 682
             }
683 683
         }
684 684
 
685 685
         // View as student/teacher link
686 686
         $view = null;
687 687
         if (!empty($view_as_student_link)) {
688
-            $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link','class' => 'pull-right'));
688
+            $view .= Display::tag('div', $view_as_student_link, array('id' => 'view_as_link', 'class' => 'pull-right'));
689 689
         }
690 690
 
691 691
         if (!empty($navigation_right)) {
692
-            foreach($navigation_right as $item){
692
+            foreach ($navigation_right as $item) {
693 693
                 $extra_class = isset($item['class']) ? $item['class'] : null;
694
-                $lis.= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right'));
694
+                $lis .= Display::tag('li', $item['title'], array('class' => $extra_class.' pull-right'));
695 695
             }
696 696
         }
697 697
 
Please login to merge, or discard this patch.
main/admin/languages.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 SubLanguageManager::make_unavailable_language($_POST['id']);
36 36
                 echo 'set_hidden';
37 37
             } else {
38
-                echo 'confirm:' . intval($_POST['id']);
38
+                echo 'confirm:'.intval($_POST['id']);
39 39
             }
40 40
         }
41 41
     }
@@ -57,21 +57,21 @@  discard block
 block discarded – undo
57 57
     var disabledLang = "'.$disabledLang.'"
58 58
 
59 59
     if (msgLang == 1) {
60
-        $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually') . ' <br /> " + disabledLang + "</div");
60
+        $("#id_content_message").html("<div class=\"warning-message alert alert-warning\">' . get_lang('ThereAreUsersUsingThisLanguagesDisableItManually').' <br /> " + disabledLang + "</div");
61 61
     }
62 62
 
63 63
     $("#disable_all_except_default").click(function () {
64
-        if(confirm("'. get_lang('ConfirmYourChoice') .'")) {
64
+        if(confirm("'. get_lang('ConfirmYourChoice').'")) {
65 65
             $.ajax({
66 66
                 contentType: "application/x-www-form-urlencoded",
67 67
                 beforeSend: function(objeto) {
68
-                    $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading') . '</div>");
68
+                    $("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading').'</div>");
69 69
                 },
70 70
                 type: "GET",
71 71
                 url: "../admin/languages.php",
72 72
                 data: "action=disable_all_except_default",
73 73
                 success: function(datos) {
74
-                    window.location.href = "' . api_get_self() . '";
74
+                    window.location.href = "' . api_get_self().'";
75 75
                 }
76 76
             });
77 77
         }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$.ajax({
108 108
 			contentType: "application/x-www-form-urlencoded",
109 109
 			beforeSend: function(objeto) {
110
-				$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading') . '</div>");
110
+				$("#id_content_message").html("<div class=\"warning-message alert alert-warning\"><em class=\"fa fa-refresh fa-spin\"></em>  ' . get_lang('Loading').'</div>");
111 111
 			},
112 112
 			type: "POST",
113 113
 			url: "../admin/languages.php",
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
                     $("#"+id_img_link_tool).attr("src",path_name_of_imglinktool);
119 119
 
120 120
                     if (my_image_tool=="visible.png") {
121
-                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '') . '");
122
-                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '') . '");
121
+                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeAvailable', '').'");
122
+                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeAvailable', '').'");
123 123
                     } else {
124
-                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '') . '");
125
-                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '') . '");
124
+                        $("#"+id_img_link_tool).attr("alt","' . get_lang('MakeUnavailable', '').'");
125
+                        $("#"+id_img_link_tool).attr("title","' . get_lang('MakeUnavailable', '').'");
126 126
                     }
127 127
 
128 128
                     if (datos=="set_visible") {
129
-                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '') . '</div>");
129
+                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowVisible', '').'</div>");
130 130
                     }
131 131
 
132 132
                     if (datos=="set_hidden") {
133
-                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '') . '</div>");
133
+                        $("#id_content_message").html("<div class=\"confirmation-message alert alert-success\">' . get_lang('LanguageIsNowHidden', '').'</div>");
134 134
                     }
135 135
                 }
136 136
 
137 137
                 var action = datos.split(":")[0];
138 138
                 if (action && action == "confirm") {
139 139
                     var id = datos.split(":")[1];
140
-                    var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> ' . get_lang('MakeUnavailable') . '</a></div>";
140
+                    var sure = "<div class=\"warning-message alert alert-warning\">'.get_lang('ThereAreUsersUsingThisLanguageYouWantToDisableThisLanguageAndSetUsersWithTheDefaultPortalLanguage').'<br /><br /><a href=\"languages.php?action=make_unavailable_confirmed&id="+id+"\" class=\"btn btn-default\"><em class=\"fa fa-eye\"></em> '.get_lang('MakeUnavailable').'</a></div>";
141 141
                     $("#id_content_message").html(sure);
142 142
                     $("html, body").animate({ scrollTop: 0 }, 200);
143 143
 				}
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
             SubLanguageManager::make_unavailable_language($language['id']);
183 183
         } else {
184 184
             if (intval(SubLanguageManager::get_platform_language_id()) !== intval($language['id'])) {
185
-                $failedDisabledLanguages .= ' - ' .$language['english_name'] . '<br />';
185
+                $failedDisabledLanguages .= ' - '.$language['english_name'].'<br />';
186 186
                 $checkFailed = true;
187 187
             }
188 188
         }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
                 foreach ($_POST['id'] as $index => $id) {
214 214
                     $ids[] = intval($id);
215 215
                 }
216
-                $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('" . implode("','", $ids) . "')";
216
+                $sql = "UPDATE $tbl_admin_languages SET available='1' WHERE id IN ('".implode("','", $ids)."')";
217 217
                 Database::query($sql);
218 218
             }
219 219
             break;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
                 foreach ($_POST['id'] as $index => $id) {
224 224
                     $ids[] = intval($id);
225 225
                 }
226
-                $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('" . implode("','", $ids) . "')";
226
+                $sql = "UPDATE $tbl_admin_languages SET available='0' WHERE id IN ('".implode("','", $ids)."')";
227 227
                 Database::query($sql);
228 228
             }
229 229
             break;
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 // displaying the explanation for this tool
253 253
 Display::display_normal_message(get_lang('PlatformLanguagesExplanation'));
254 254
 
255
-echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> ' . get_lang('LanguagesDisableAllExceptDefault') . '</a><br /><br />';
255
+echo '<a id="disable_all_except_default" href="javascript:void(0)" class="btn btn-primary"><em class="fa fa-eye"></em> '.get_lang('LanguagesDisableAllExceptDefault').'</a><br /><br />';
256 256
 
257 257
 // selecting all the languages
258 258
 $sql_select = "SELECT * FROM $tbl_admin_languages";
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
             $checked = ' checked="checked" ';
274 274
         }
275 275
 
276
-        $row_td[] = '<input type="hidden" name="edit_id" value="' . Security::remove_XSS($_GET['id']) . '" /><input type="text" name="txt_name" value="' . $row['original_name'] . '" /> '
277
-                . '<input type="checkbox" ' . $checked . 'name="platformlanguage" id="platformlanguage" value="' . $row['english_name'] . '" /><label for="platformlanguage">' . $row['original_name'] . ' ' . get_lang('AsPlatformLanguage') . '</label> <input type="submit" name="Submit" value="' . get_lang('Ok') . '" /><a name="value" />';
276
+        $row_td[] = '<input type="hidden" name="edit_id" value="'.Security::remove_XSS($_GET['id']).'" /><input type="text" name="txt_name" value="'.$row['original_name'].'" /> '
277
+                . '<input type="checkbox" '.$checked.'name="platformlanguage" id="platformlanguage" value="'.$row['english_name'].'" /><label for="platformlanguage">'.$row['original_name'].' '.get_lang('AsPlatformLanguage').'</label> <input type="submit" name="Submit" value="'.get_lang('Ok').'" /><a name="value" />';
278 278
     } else {
279 279
         $row_td[] = $row['original_name'];
280 280
     }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
     if ($row['english_name'] == $row_lang['selected_value']) {
289 289
         $setplatformlanguage = Display::return_icon('languages.png', get_lang('CurrentLanguagesPortal'), '', ICON_SIZE_SMALL);
290 290
     } else {
291
-        $setplatformlanguage = "<a href=\"javascript:if (confirm('" . addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault')) . "')) { location.href='" . api_get_self() . "?action=setplatformlanguage&id=" . $row['id'] . "'; }\">" . Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL) . "</a>";
291
+        $setplatformlanguage = "<a href=\"javascript:if (confirm('".addslashes(get_lang('AreYouSureYouWantToSetThisLanguageAsThePortalDefault'))."')) { location.href='".api_get_self()."?action=setplatformlanguage&id=".$row['id']."'; }\">".Display::return_icon('languages_na.png', get_lang('SetLanguageAsDefault'), '', ICON_SIZE_SMALL)."</a>";
292 292
     }
293 293
 
294 294
     $allow_delete_sub_language = null;
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 
301 301
         if ($verified_if_is_sub_language === false) {
302 302
             $verified_if_is_father = SubLanguageManager::check_if_language_is_father($row['id']);
303
-            $allow_use_sub_language = "&nbsp;<a href='sub_language_add.php?action=definenewsublanguage&id=" . $row['id'] . "'>" . Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL) . "</a>";
303
+            $allow_use_sub_language = "&nbsp;<a href='sub_language_add.php?action=definenewsublanguage&id=".$row['id']."'>".Display::return_icon('new_language.png', get_lang('CreateSubLanguage'), array(), ICON_SIZE_SMALL)."</a>";
304 304
             if ($verified_if_is_father === true) {
305 305
                 //$allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=".$row['id']."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'),array('width'=>ICON_SIZE_SMALL,'height'=>ICON_SIZE_SMALL))."</a>";
306 306
                 $allow_add_term_sub_language = '';
@@ -310,8 +310,8 @@  discard block
 block discarded – undo
310 310
         } else {
311 311
             $allow_use_sub_language = '';
312 312
             $all_information_of_sub_language = SubLanguageManager::get_all_information_of_language($row['id']);
313
-            $allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
314
-            $allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
313
+            $allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('2rightarrow.png', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>";
314
+            $allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=".Security::remove_XSS($all_information_of_sub_language['parent_id'])."&sub_language_id=".Security::remove_XSS($row['id'])."'>".Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL))."</a>";
315 315
         }
316 316
     } else {
317 317
         $allow_use_sub_language = '';
@@ -319,13 +319,13 @@  discard block
 block discarded – undo
319 319
     }
320 320
 
321 321
     if ($row['english_name'] == $row_lang['selected_value']) {
322
-        $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>
323
-                     &nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
322
+        $row_td[] = Display::return_icon('visible.png', get_lang('Visible'))."<a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>
323
+                     &nbsp;" . $setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
324 324
     } else {
325 325
         if ($row['available'] == 1) {
326
-            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeunavailable&id=" . $row['id'] . "'>" . Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
326
+            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeunavailable&id=".$row['id']."'>".Display::return_icon('visible.png', get_lang('MakeUnavailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
327 327
         } else {
328
-            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_" . $row['id'] . "\" href='" . api_get_self() . "?action=makeavailable&id=" . $row['id'] . "'>" . Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_' . $row['id']), ICON_SIZE_SMALL) . "</a> <a href='" . api_get_self() . "?action=edit&id=" . $row['id'] . "#value'>" . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . "</a>&nbsp;" . $setplatformlanguage . $allow_use_sub_language . $allow_add_term_sub_language . $allow_delete_sub_language;
328
+            $row_td[] = "<a class=\"make_visible_and_invisible\" id=\"linktool_".$row['id']."\" href='".api_get_self()."?action=makeavailable&id=".$row['id']."'>".Display::return_icon('invisible.png', get_lang('MakeAvailable'), array('id' => 'imglinktool_'.$row['id']), ICON_SIZE_SMALL)."</a> <a href='".api_get_self()."?action=edit&id=".$row['id']."#value'>".Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL)."</a>&nbsp;".$setplatformlanguage.$allow_use_sub_language.$allow_add_term_sub_language.$allow_delete_sub_language;
329 329
         }
330 330
     }
331 331
     $language_data[] = $row_td;
Please login to merge, or discard this patch.