Completed
Push — 1.11.x ( a9bf33...0cc0b0 )
by José
55:09 queued 28:08
created
main/attendance/calendar_logins.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 // See AttendanceController::calendarLogins function
5 5
 echo '<div class="actions">';
6 6
 echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list">'.
7
-    Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
7
+    Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
8 8
 echo '</div>';
9 9
 
10 10
 echo $form;
Please login to merge, or discard this patch.
main/attendance/attendance_calendar.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@  discard block
 block discarded – undo
14 14
     echo '<div class="actions">';
15 15
     if ($action == 'calendar_add') {
16 16
         echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'.
17
-            Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
17
+            Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
18 18
     } else {
19 19
         echo '<a href="index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendance_id.'">'.
20
-            Display::return_icon('back.png',get_lang('AttendanceSheet'),'',ICON_SIZE_MEDIUM).'</a>';
20
+            Display::return_icon('back.png', get_lang('AttendanceSheet'), '', ICON_SIZE_MEDIUM).'</a>';
21 21
         if (api_is_allowed_to_edit()) {
22 22
             echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_add&attendance_id='.$attendance_id.'">'.
23
-                Display::return_icon('add.png',get_lang('AddDateAndTime'),'',ICON_SIZE_MEDIUM).'</a>';
23
+                Display::return_icon('add.png', get_lang('AddDateAndTime'), '', ICON_SIZE_MEDIUM).'</a>';
24 24
             echo '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDeleteAllDates').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=calendar_all_delete&attendance_id='.$attendance_id.'">'.
25
-                Display::return_icon('clean.png',get_lang('CleanCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
25
+                Display::return_icon('clean.png', get_lang('CleanCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
26 26
         }
27 27
     }
28 28
     echo '</div>';
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     $form = new FormValidator(
59 59
         'attendance_calendar_add',
60 60
         'POST',
61
-        'index.php?action=calendar_add&attendance_id='.$attendance_id.'&' . api_get_cidreq(),
61
+        'index.php?action=calendar_add&attendance_id='.$attendance_id.'&'.api_get_cidreq(),
62 62
         ''
63 63
     );
64 64
     $form->addElement('header', get_lang('AddADateTime'));
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         'weekly' => get_lang('RepeatWeekly'),
96 96
         'monthlyByDate' => get_lang('RepeatMonthlyByDate')
97 97
     );
98
-    $form->addElement('select', 'repeat_type', get_lang('RepeatType') , $a_repeat_type);
98
+    $form->addElement('select', 'repeat_type', get_lang('RepeatType'), $a_repeat_type);
99 99
 
100 100
     $form->addElement('date_picker', 'end_date_time', get_lang('RepeatEnd'), array('form_name'=>'attendance_calendar_add'));
101 101
     $defaults['end_date_time'] = date('Y-m-d');
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                 $form = new FormValidator(
132 132
                     'attendance_calendar_edit',
133 133
                     'POST',
134
-                    'index.php?action=calendar_edit&attendance_id=' . $attendance_id . '&calendar_id=' . $calendar_id . '&' . api_get_cidreq(),
134
+                    'index.php?action=calendar_edit&attendance_id='.$attendance_id.'&calendar_id='.$calendar_id.'&'.api_get_cidreq(),
135 135
                     ''
136 136
                 );
137 137
                 $form->addDateTimePicker('date_time', array(get_lang('Date')), array('form_name'=>'attendance_calendar_edit'), 5);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     get_lang('DateTime'),
148 148
                         null,
149 149
                         ICON_SIZE_MEDIUM
150
-                ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
150
+                ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time']) - 3).'&nbsp;';
151 151
 
152 152
                 if (isset($calendar['groups']) && !empty($calendar['groups'])) {
153 153
                     foreach ($calendar['groups'] as $group) {
Please login to merge, or discard this patch.
main/course_home/vertical_activity.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
         $content .= '<div class="courseadminview-activity-3col"><span class="viewcaption">'.get_lang('SessionData').'</span>
92 92
             <table width="100%">';
93 93
                 $content .= CourseHome::show_session_data($session_id);
94
-             $content .=  '</table></div>';
94
+                $content .=  '</table></div>';
95 95
     }
96 96
 
97 97
     $content .=  '<div class="Authoringview">';
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     // Show message to confirm that a tool it to be hidden from available tools
38 38
     // visibility 0,1->2
39 39
     if (!empty($_GET['askDelete'])) {
40
-        $content .='<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
40
+        $content .= '<div id="toolhide">'.get_lang('DelLk').'<br />&nbsp;&nbsp;&nbsp;
41 41
             <a href="'.api_get_self().'">'.get_lang('No').'</a>&nbsp;|&nbsp;
42 42
             <a href="'.api_get_self().'?delete=yes&id='.$id.'">'.get_lang('Yes').'</a>
43 43
         </div>';
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
 
56 56
 // Start of tools for CourseAdmins (teachers/tutors)
57 57
 if (api_is_allowed_to_edit(null, true) && !api_is_coach()) {
58
-    $content .=  '<div class="courseadminview" style="border:0px; margin-top: 0px;padding:5px;">
58
+    $content .= '<div class="courseadminview" style="border:0px; margin-top: 0px;padding:5px;">
59 59
     <div class="normal-message" id="id_normal_message" style="display:none">';
60
-        $content .=  '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
61
-        $content .=  get_lang('PleaseStandBy');
60
+        $content .= '<img src="'.api_get_path(WEB_PATH).'main/inc/lib/javascript/indicator.gif"/>&nbsp;&nbsp;';
61
+        $content .= get_lang('PleaseStandBy');
62 62
 
63
-    $content .=  '</div>
63
+    $content .= '</div>
64 64
         <div class="confirmation-message" id="id_confirmation_message" style="display:none"></div></div>';
65
-    $content .=  '<div id="activity-3col">';
65
+    $content .= '<div id="activity-3col">';
66 66
 
67 67
     if (api_get_setting('show_session_data') == 'true' && $session_id > 0) {
68 68
         $content .= '<div class="courseadminview-activity-3col"><span class="viewcaption">'.get_lang('SessionData').'</span>
@@ -90,10 +90,10 @@  discard block
 block discarded – undo
90 90
         $content .= '<div class="courseadminview-activity-3col"><span class="viewcaption">'.get_lang('SessionData').'</span>
91 91
             <table width="100%">';
92 92
                 $content .= CourseHome::show_session_data($session_id);
93
-             $content .=  '</table></div>';
93
+             $content .= '</table></div>';
94 94
     }
95 95
 
96
-    $content .=  '<div class="Authoringview">';
96
+    $content .= '<div class="Authoringview">';
97 97
                 $my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);
98 98
                 $content .= CourseHome::show_tools_category($my_list);
99 99
     $content .= '</div>';
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         $order_tool_list = array();
107 107
         foreach ($my_list as $key => $new_tool) {
108 108
             $tool_name = CourseHome::translate_tool_name($new_tool);
109
-            $order_tool_list [$key]= $tool_name;
109
+            $order_tool_list [$key] = $tool_name;
110 110
         }
111 111
         natsort($order_tool_list);
112 112
         $my_temp_tool_array = array();
Please login to merge, or discard this patch.
main/inc/ajax/skill.ajax.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $return_skills = array();
40 40
         foreach ($skills as $skill) {
41 41
             $skill['caption'] = $skill['name'];
42
-            $skill['value'] =  $skill['id'];
42
+            $skill['value'] = $skill['id'];
43 43
             $return_skills[] = $skill;
44 44
         }
45 45
         echo json_encode($return_skills);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         if (!empty($gradebooks)) {
52 52
             foreach ($gradebooks as $gradebook) {
53 53
                 if ($gradebook['parent_id'] == 0 && !empty($gradebook['certif_min_score']) && !empty($gradebook['document_id'])) {
54
-                    $gradebook_list[]  = $gradebook;
54
+                    $gradebook_list[] = $gradebook;
55 55
                     //$gradebook['name'] = $gradebook['name'];
56 56
                     //$gradebook_list[]  = $gradebook;
57 57
                 } else {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $return = array();
68 68
         foreach ($gradebooks as $item) {
69 69
             $item['caption'] = $item['name'];
70
-            $item['value'] =  $item['id'];
70
+            $item['value'] = $item['id'];
71 71
             $return[] = $item;
72 72
         }
73 73
         echo json_encode($return);
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
         }
93 93
         break;
94 94
     case 'get_skills_by_profile':
95
-        $skill_rel_profile   = new SkillRelProfile();
95
+        $skill_rel_profile = new SkillRelProfile();
96 96
         $profile_id = isset($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : null;
97 97
         $skills = $skill_rel_profile->get_skills_by_profile($profile_id);
98 98
         echo json_encode($skills);
99 99
         break;
100 100
     case 'get_saved_profiles':
101
-        $skill_profile   = new SkillProfile();
101
+        $skill_profile = new SkillProfile();
102 102
         $profiles = $skill_profile->get_all();
103 103
         Display::display_no_header();
104 104
         Display::$global_template->assign('profiles', $profiles);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             $success = false;
188 188
         }
189 189
 
190
-        $result = array (
190
+        $result = array(
191 191
             'success' => $success,
192 192
             'data' => $return
193 193
         );
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $skills = $skill->get_direct_parents($id);
199 199
         $return = array();
200 200
         foreach ($skills as $skill) {
201
-            $return [$skill['data']['id']] = array (
201
+            $return [$skill['data']['id']] = array(
202 202
                 'id'        => $skill['data']['id'],
203 203
                 'parent_id' => $skill['data']['parent_id'],
204 204
                 'name'      => $skill['data']['name']
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
         echo json_encode($return);
208 208
         break;
209 209
     case 'profile_matches':
210
-        $skill_rel_user  = new SkillRelUser();
211
-        $skills = (!empty($_REQUEST['skill_id'])?$_REQUEST['skill_id']:array());
210
+        $skill_rel_user = new SkillRelUser();
211
+        $skills = (!empty($_REQUEST['skill_id']) ? $_REQUEST['skill_id'] : array());
212 212
 
213 213
         $total_skills_to_search = $skills;
214 214
         $users  = $skill_rel_user->get_user_by_skills($skills);
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                     //$gradebook['name'] = $gradebook['name'];
56 56
                     //$gradebook_list[]  = $gradebook;
57 57
                 } else {
58
-                  //  $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name'];
58
+                    //  $gradebook['name'] = $gradebook_list[$gradebook['parent_id']]['name'].' > '.$gradebook['name'];
59 59
                     //$gradebook_list[]  = $gradebook;
60 60
                 }
61 61
             }
Please login to merge, or discard this patch.
main/inc/ajax/forum.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 require_once '../global.inc.php';
11
-require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
11
+require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
12 12
 
13 13
 // First, protect this script
14 14
 api_protect_course_script(false);
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
                     break;
64 64
                 }
65 65
                 // If pass all previous control, user can edit post
66
-                $courseId = isset($_REQUEST['c_id'])? intval($_REQUEST['c_id']) : api_get_course_int_id();
66
+                $courseId = isset($_REQUEST['c_id']) ? intval($_REQUEST['c_id']) : api_get_course_int_id();
67 67
                 $json['courseId'] = $courseId;
68
-                $forumId = isset($_REQUEST['forum'])? intval($_REQUEST['forum']) : null;
68
+                $forumId = isset($_REQUEST['forum']) ? intval($_REQUEST['forum']) : null;
69 69
                 $json['forum'] = $forumId;
70
-                $threadId = isset($_REQUEST['thread'])? intval($_REQUEST['thread']) : null;
70
+                $threadId = isset($_REQUEST['thread']) ? intval($_REQUEST['thread']) : null;
71 71
                 $json['thread'] = $threadId;
72
-                $postId = isset($_REQUEST['postId'])? intval($_REQUEST['postId']) : null;
72
+                $postId = isset($_REQUEST['postId']) ? intval($_REQUEST['postId']) : null;
73 73
                 $json['postId'] = $postId;
74 74
 
75 75
                 if (!empty($courseId) &&
Please login to merge, or discard this patch.
main/inc/ajax/link.ajax.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             // set URL and other appropriate options
24 24
             $defaults = array(
25 25
                 CURLOPT_URL => $url,
26
-                CURLOPT_FOLLOWLOCATION => true,         // follow redirects accept youtube.com
26
+                CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com
27 27
                 CURLOPT_HEADER => 0,
28 28
                 CURLOPT_RETURNTRANSFER => true,
29 29
                 CURLOPT_TIMEOUT => 4
Please login to merge, or discard this patch.
main/inc/ajax/session.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
             $list_sessions = SessionManager::get_sessions_by_user($user_id, true);
16 16
             if (!empty($list_sessions)) {
17 17
                 foreach ($list_sessions as $session_item) {
18
-                    echo $session_item['session_name'] . '<br />';
18
+                    echo $session_item['session_name'].'<br />';
19 19
                 }
20 20
             } else {
21 21
                 echo get_lang('NoSessionsForThisUser');
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 [
30 30
                     's.name' => [
31 31
                         'operator' => 'LIKE',
32
-                        'value' => "%" . $_REQUEST['q'] . "%"
32
+                        'value' => "%".$_REQUEST['q']."%"
33 33
                     ]
34 34
                 ]
35 35
             );
Please login to merge, or discard this patch.
main/inc/ajax/exercise.ajax.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -488,7 +488,7 @@
 block discarded – undo
488 488
                     $remind_list
489 489
                 );
490 490
 
491
-                 // Destruction of the Question object
491
+                    // Destruction of the Question object
492 492
                 unset($objQuestionTmp);
493 493
                 if ($debug) {
494 494
                     error_log(" -- end question -- ");
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -32,10 +32,10 @@  discard block
 block discarded – undo
32 32
         $exercise_id = intval($_GET['exercise_id']);
33 33
         $page = intval($_REQUEST['page']); //page
34 34
         $limit = intval($_REQUEST['rows']); //quantity of rows
35
-        $sidx = $_REQUEST['sidx'];         //index to filter
36
-        $sord = $_REQUEST['sord'];         //asc or desc
35
+        $sidx = $_REQUEST['sidx']; //index to filter
36
+        $sord = $_REQUEST['sord']; //asc or desc
37 37
 
38
-        if (!in_array($sord, array('asc','desc'))) {
38
+        if (!in_array($sord, array('asc', 'desc'))) {
39 39
             $sord = 'desc';
40 40
         }
41 41
         // get index row - i.e. user click to sort $sord = $_GET['sord'];
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $total_pages = 0;
65 65
         if ($count > 0) {
66 66
             if (!empty($limit)) {
67
-                $total_pages = ceil($count/$limit);
67
+                $total_pages = ceil($count / $limit);
68 68
             }
69 69
         }
70 70
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
         $response->page = $page;
127 127
         $response->total = $total_pages;
128 128
         $response->records = $count;
129
-        $i=0;
129
+        $i = 0;
130 130
 
131 131
         if (!empty($results)) {
132 132
             foreach ($results as $row) {
@@ -140,22 +140,22 @@  discard block
 block discarded – undo
140 140
                             GROUP by question_id
141 141
                         ) as count_table";
142 142
                 $result_count = Database::query($sql);
143
-                $count_questions = Database::fetch_array($result_count,'ASSOC');
143
+                $count_questions = Database::fetch_array($result_count, 'ASSOC');
144 144
                 $count_questions = $count_questions['count_question_id'];
145 145
 
146 146
                 $row['count_questions'] = $count_questions;
147 147
 
148 148
                 $response->rows[$i]['id'] = $row['exe_id'];
149
-                $remaining = strtotime($row['start_date'])+($oExe->expired_time*60) - strtotime(api_get_utc_datetime(time()));
150
-                $h = floor($remaining/3600);
151
-                $m = floor(($remaining - ($h*3600))/60);
152
-                $s = ($remaining - ($h*3600) - ($m*60));
149
+                $remaining = strtotime($row['start_date']) + ($oExe->expired_time * 60) - strtotime(api_get_utc_datetime(time()));
150
+                $h = floor($remaining / 3600);
151
+                $m = floor(($remaining - ($h * 3600)) / 60);
152
+                $s = ($remaining - ($h * 3600) - ($m * 60));
153 153
                 $array = array(
154 154
                     $row['firstname'],
155 155
                     $row['lastname'],
156
-                    api_format_date($row['start_date'], DATE_TIME_FORMAT_LONG).' ['.($h>0?$h.':':'').sprintf("%02d",$m).':'.sprintf("%02d",$s).']',
156
+                    api_format_date($row['start_date'], DATE_TIME_FORMAT_LONG).' ['.($h > 0 ? $h.':' : '').sprintf("%02d", $m).':'.sprintf("%02d", $s).']',
157 157
                     $row['count_questions'],
158
-                    round($row['score']*100).'%'
158
+                    round($row['score'] * 100).'%'
159 159
                 );
160 160
                 $response->rows[$i]['cell'] = $array;
161 161
                 $i++;
@@ -361,8 +361,8 @@  discard block
 block discarded – undo
361 361
                 $objQuestionTmp = Question::read($my_question_id, $course_id);
362 362
 
363 363
                 // Getting free choice data.
364
-                if ($objQuestionTmp->type  == FREE_ANSWER && $type == 'all') {
365
-                    $my_choice = isset($_REQUEST['free_choice'][$my_question_id]) && !empty($_REQUEST['free_choice'][$my_question_id]) ? $_REQUEST['free_choice'][$my_question_id]: null;
364
+                if ($objQuestionTmp->type == FREE_ANSWER && $type == 'all') {
365
+                    $my_choice = isset($_REQUEST['free_choice'][$my_question_id]) && !empty($_REQUEST['free_choice'][$my_question_id]) ? $_REQUEST['free_choice'][$my_question_id] : null;
366 366
                 }
367 367
 
368 368
                 if ($type == 'all') {
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
         $objQuestion = Question::read($questionId);
519 519
         $objQuestion->get_question_type_name();
520 520
 
521
-        echo '<p class="lead">' . $objQuestion->get_question_type_name() . '</p>';
521
+        echo '<p class="lead">'.$objQuestion->get_question_type_name().'</p>';
522 522
         //echo get_lang('Level').': '.$objQuestionTmp->selectLevel();
523 523
         ExerciseLib::showQuestion(
524 524
             $questionId,
Please login to merge, or discard this patch.
main/inc/ajax/course_home.ajax.php 3 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -121,8 +121,9 @@  discard block
 block discarded – undo
121 121
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
122 122
             $my_session_list  = array();
123 123
             foreach($new_session_list as $item) {
124
-                if (!empty($item['id_session']))
125
-                    $my_session_list[] = $item['id_session'];
124
+                if (!empty($item['id_session'])) {
125
+                                    $my_session_list[] = $item['id_session'];
126
+                }
126 127
             }
127 128
             if (!in_array($session_id, $my_session_list)) {
128 129
             	break;
@@ -254,8 +255,9 @@  discard block
 block discarded – undo
254 255
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
255 256
             $my_session_list  = array();
256 257
             foreach($new_session_list as $item) {
257
-                if (!empty($item['id_session']))
258
-                    $my_session_list[] = $item['id_session'];
258
+                if (!empty($item['id_session'])) {
259
+                                    $my_session_list[] = $item['id_session'];
260
+                }
259 261
             }
260 262
             if (!in_array($session_id, $my_session_list)) {
261 263
                 break;
@@ -384,8 +386,9 @@  discard block
 block discarded – undo
384 386
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
385 387
             $my_session_list  = array();
386 388
             foreach($new_session_list as $item) {
387
-                if (!empty($item['id_session']))
388
-                    $my_session_list[] = $item['id_session'];
389
+                if (!empty($item['id_session'])) {
390
+                                    $my_session_list[] = $item['id_session'];
391
+                }
389 392
             }
390 393
             if (!in_array($session_id, $my_session_list)) {
391 394
                 break;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -445,7 +445,7 @@
 block discarded – undo
445 445
                     $date = '-';
446 446
                 }
447 447
 
448
-                 //Checking LP publicated and expired_on dates
448
+                    //Checking LP publicated and expired_on dates
449 449
                 if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') {
450 450
                     if ($now < api_strtotime($lp_item['publicated_on'], 'UTC')) {
451 451
                         continue;
Please login to merge, or discard this patch.
Spacing   +54 added lines, -54 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
                     null,
31 31
                     true
32 32
                 );
33
-                $na_image   = str_replace('.png', '_na.png', $tool_image);
33
+                $na_image = str_replace('.png', '_na.png', $tool_image);
34 34
             }
35 35
 
36 36
             if (isset($tool_info['custom_icon']) && !empty($tool_info['custom_icon'])) {
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
                 $na_image = CourseHome::getCustomWebIconPath().CourseHome::getDisableIcon($tool_info['custom_icon']);
39 39
             }
40 40
 
41
-            $requested_image = ($tool_visibility == 0 ) ? $tool_image : $na_image;
42
-            $requested_class = ($tool_visibility == 0 ) ? '' : 'text-muted';
43
-            $requested_message = ($tool_visibility == 0 ) ? 'is_active' : 'is_inactive';
44
-            $requested_view = ($tool_visibility == 0 ) ? 'visible.png' : 'invisible.png';
45
-            $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;
41
+            $requested_image = ($tool_visibility == 0) ? $tool_image : $na_image;
42
+            $requested_class = ($tool_visibility == 0) ? '' : 'text-muted';
43
+            $requested_message = ($tool_visibility == 0) ? 'is_active' : 'is_inactive';
44
+            $requested_view = ($tool_visibility == 0) ? 'visible.png' : 'invisible.png';
45
+            $requested_visible = ($tool_visibility == 0) ? 1 : 0;
46 46
 
47
-            $requested_view = ($tool_visibility == 0 ) ? 'visible.png' : 'invisible.png';
48
-            $requested_visible = ($tool_visibility == 0 ) ? 1 : 0;
47
+            $requested_view = ($tool_visibility == 0) ? 'visible.png' : 'invisible.png';
48
+            $requested_visible = ($tool_visibility == 0) ? 1 : 0;
49 49
 
50 50
             // HIDE AND REACTIVATE TOOL
51 51
             if ($_GET["id"] == strval(intval($_GET["id"]))) {
52 52
                 $sql = "UPDATE $tool_table SET
53 53
                         visibility = $requested_visible
54
-                        WHERE c_id = $course_id AND id='" . intval($_GET['id']) . "'";
54
+                        WHERE c_id = $course_id AND id='".intval($_GET['id'])."'";
55 55
                 Database::query($sql);
56 56
             }
57 57
             $response_data = array(
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 WHERE c_id = ".$course_info['real_id']." AND session_id = 0
83 83
                 ORDER BY id";
84 84
         $result = Database::query($sql);
85
-        if (Database::num_rows($result) > 0 ) {
85
+        if (Database::num_rows($result) > 0) {
86 86
             while ($description = Database::fetch_object($result)) {
87 87
                 $descriptions[$description->id] = $description;
88 88
             }
@@ -104,12 +104,12 @@  discard block
 block discarded – undo
104 104
 
105 105
         require_once '../global.inc.php';
106 106
         $now = time();
107
-        $page  = intval($_REQUEST['page']);     //page
108
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
107
+        $page  = intval($_REQUEST['page']); //page
108
+        $limit = intval($_REQUEST['rows']); // quantity of rows
109 109
         //index to filter
110 110
         $sidx  = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
111
-        $sord  = $_REQUEST['sord'];    //asc or desc
112
-        if (!in_array($sord, array('asc','desc'))) {
111
+        $sord  = $_REQUEST['sord']; //asc or desc
112
+        if (!in_array($sord, array('asc', 'desc'))) {
113 113
             $sord = 'desc';
114 114
         }
115 115
         $session_id  = intval($_REQUEST['session_id']);
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         if (!api_is_platform_admin()) {
120 120
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
121 121
             $my_session_list  = array();
122
-            foreach($new_session_list as $item) {
122
+            foreach ($new_session_list as $item) {
123 123
                 if (!empty($item['id_session']))
124 124
                     $my_session_list[] = $item['id_session'];
125 125
             }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             }
129 129
         }
130 130
 
131
-        $start = $limit*$page - $limit;
131
+        $start = $limit * $page - $limit;
132 132
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
133 133
         $count = 0;
134 134
         $temp = array();
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
             $item['title'] = Display::url($item['title'], $course_url, array('target' => SESSION_LINK_TARGET));
141 141
 
142 142
             foreach ($flat_list as $lp_id => $lp_item) {
143
-                $temp[$count]['id']= $lp_id;
143
+                $temp[$count]['id'] = $lp_id;
144 144
 
145 145
                 $lp = new learnpath($item['code'], $lp_id, api_get_user_id());
146 146
                 if ($lp->progress_db == 100) {
147 147
                     continue;
148 148
                 }
149 149
 
150
-                $lp_url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
150
+                $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
151 151
 
152 152
                 $last_date = Tracking::get_last_connection_date_on_the_course(
153 153
                     api_get_user_id(),
@@ -203,27 +203,27 @@  discard block
 block discarded – undo
203 203
         }
204 204
         $temp = msort($temp, $sidx, $sord);
205 205
 
206
-        $i =0;
206
+        $i = 0;
207 207
         $response = new stdClass();
208
-        foreach($temp as $key=>$row) {
208
+        foreach ($temp as $key=>$row) {
209 209
             $row = $row['cell'];
210 210
             if (!empty($row)) {
211
-                if ($key >= $start  && $key < ($start + $limit)) {
212
-                    $response->rows[$i]['id']= $key;
213
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]);
211
+                if ($key >= $start && $key < ($start + $limit)) {
212
+                    $response->rows[$i]['id'] = $key;
213
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]);
214 214
                     $i++;
215 215
                 }
216 216
             }
217 217
         }
218 218
 
219
-        if($count > 0 && $limit > 0) {
220
-            $total_pages = ceil($count/$limit);
219
+        if ($count > 0 && $limit > 0) {
220
+            $total_pages = ceil($count / $limit);
221 221
         } else {
222 222
             $total_pages = 0;
223 223
         }
224
-        $response->total    = $total_pages;
224
+        $response->total = $total_pages;
225 225
         if ($page > $total_pages) {
226
-            $response->page= $total_pages;
226
+            $response->page = $total_pages;
227 227
         } else {
228 228
             $response->page = $page;
229 229
         }
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
         require_once '../global.inc.php';
235 235
         $now = time();
236 236
 
237
-        $page  = intval($_REQUEST['page']);     //page
238
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
237
+        $page  = intval($_REQUEST['page']); //page
238
+        $limit = intval($_REQUEST['rows']); // quantity of rows
239 239
         $sidx  = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'course';
240 240
         $sidx = str_replace(array('week desc,', ' '), '', $sidx);
241 241
 
242
-        $sord  = $_REQUEST['sord'];    //asc or desc
243
-        if (!in_array($sord, array('asc','desc'))) {
242
+        $sord  = $_REQUEST['sord']; //asc or desc
243
+        if (!in_array($sord, array('asc', 'desc'))) {
244 244
             $sord = 'desc';
245 245
         }
246 246
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
         if (!api_is_platform_admin()) {
252 252
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
253 253
             $my_session_list  = array();
254
-            foreach($new_session_list as $item) {
254
+            foreach ($new_session_list as $item) {
255 255
                 if (!empty($item['id_session']))
256 256
                     $my_session_list[] = $item['id_session'];
257 257
             }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
             }
261 261
         }
262 262
 
263
-        $start = $limit*$page - $limit;
263
+        $start = $limit * $page - $limit;
264 264
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
265 265
 
266 266
         $count = 0;
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
             );
288 288
 
289 289
             foreach ($flat_list as $lp_id => $lp_item) {
290
-                $temp[$count]['id']= $lp_id;
291
-                $lp_url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
290
+                $temp[$count]['id'] = $lp_id;
291
+                $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
292 292
 
293 293
                 $last_date = Tracking::get_last_connection_date_on_the_course(
294 294
                     api_get_user_id(),
@@ -350,20 +350,20 @@  discard block
 block discarded – undo
350 350
         }
351 351
 
352 352
         $response = new stdClass();
353
-        $i =0;
354
-        foreach($temp as $key=>$row) {
353
+        $i = 0;
354
+        foreach ($temp as $key=>$row) {
355 355
             $row = $row['cell'];
356 356
             if (!empty($row)) {
357
-                if ($key >= $start  && $key < ($start + $limit)) {
358
-                    $response->rows[$i]['id']= $key;
359
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2],$row[3]);
357
+                if ($key >= $start && $key < ($start + $limit)) {
358
+                    $response->rows[$i]['id'] = $key;
359
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2], $row[3]);
360 360
                     $i++;
361 361
                 }
362 362
             }
363 363
         }
364 364
 
365 365
         if ($count > 0 && $limit > 0) {
366
-            $total_pages = ceil($count/$limit);
366
+            $total_pages = ceil($count / $limit);
367 367
         } else {
368 368
             $total_pages = 0;
369 369
         }
@@ -379,12 +379,12 @@  discard block
 block discarded – undo
379 379
     case 'session_courses_lp_by_course':
380 380
         require_once '../global.inc.php';
381 381
         $now = time();
382
-        $page  = intval($_REQUEST['page']);     //page
383
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
382
+        $page  = intval($_REQUEST['page']); //page
383
+        $limit = intval($_REQUEST['rows']); // quantity of rows
384 384
         $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
385 385
         $sidx = str_replace(array('course asc,', ' '), '', $sidx);
386 386
 
387
-        $sord = $_REQUEST['sord'];    //asc or desc
387
+        $sord = $_REQUEST['sord']; //asc or desc
388 388
         if (!in_array($sord, array('asc', 'desc'))) {
389 389
             $sord = 'desc';
390 390
         }
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
         if (!api_is_platform_admin()) {
396 396
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
397 397
             $my_session_list  = array();
398
-            foreach($new_session_list as $item) {
398
+            foreach ($new_session_list as $item) {
399 399
                 if (!empty($item['id_session']))
400 400
                     $my_session_list[] = $item['id_session'];
401 401
             }
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             }
405 405
         }
406 406
 
407
-        $start = $limit*$page - $limit;
407
+        $start = $limit * $page - $limit;
408 408
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
409 409
         $count = 0;
410 410
 
@@ -415,16 +415,16 @@  discard block
 block discarded – undo
415 415
                 }
416 416
             }
417 417
 
418
-            $list = new LearnpathList(api_get_user_id(),$item['code'],$session_id);
418
+            $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id);
419 419
             $flat_list = $list->get_flat_list();
420 420
             $lps[$item['code']] = $flat_list;
421 421
             $item['title'] = Display::url(
422 422
                 $item['title'],
423 423
                 api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET)
424 424
             );
425
-            foreach($flat_list as $lp_id => $lp_item) {
426
-                $temp[$count]['id']= $lp_id;
427
-                $lp_url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
425
+            foreach ($flat_list as $lp_id => $lp_item) {
426
+                $temp[$count]['id'] = $lp_id;
427
+                $lp_url = api_get_path(WEB_CODE_PATH).'lp/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
428 428
                 $last_date = Tracking::get_last_connection_date_on_the_course(
429 429
                     api_get_user_id(),
430 430
                     $item,
@@ -477,13 +477,13 @@  discard block
 block discarded – undo
477 477
         $temp = msort($temp, $sidx, $sord);
478 478
 
479 479
         $response = new stdClass();
480
-        $i =0;
480
+        $i = 0;
481 481
         foreach ($temp as $key => $row) {
482 482
             $row = $row['cell'];
483 483
             if (!empty($row)) {
484
-                if ($key >= $start  && $key < ($start + $limit)) {
485
-                    $response->rows[$i]['id']= $key;
486
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]);
484
+                if ($key >= $start && $key < ($start + $limit)) {
485
+                    $response->rows[$i]['id'] = $key;
486
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]);
487 487
                     $i++;
488 488
                 }
489 489
             }
Please login to merge, or discard this patch.