Completed
Push — 1.10.x ( 51aeba...107530 )
by Yannick
123:47 queued 78:53
created
main/inc/ajax/admin.ajax.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
             $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url']));
51 51
             $cleanUrl = str_replace('/', '-', $url);
52 52
 
53
-            $newUrlDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/";
53
+            $newUrlDir = api_get_path(SYS_APP_PATH)."home/$cleanUrl/admin/";
54 54
         } else {
55
-            $newUrlDir = api_get_path(SYS_APP_PATH) . "home/admin/";
55
+            $newUrlDir = api_get_path(SYS_APP_PATH)."home/admin/";
56 56
         }
57 57
 
58 58
         if (!file_exists($newUrlDir)) {
@@ -166,15 +166,15 @@  discard block
 block discarded – undo
166 166
             }
167 167
 
168 168
             if ($system_version != $version_info) {
169
-                $output = '<br /><span style="color:red">' . get_lang('YourVersionNotUpToDate') . '. '.get_lang('LatestVersionIs').' <b>Chamilo '.$version_info.'</b>. '.get_lang('YourVersionIs').' <b>Chamilo '.$system_version. '</b>. '.str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')).'</span>';
169
+                $output = '<br /><span style="color:red">'.get_lang('YourVersionNotUpToDate').'. '.get_lang('LatestVersionIs').' <b>Chamilo '.$version_info.'</b>. '.get_lang('YourVersionIs').' <b>Chamilo '.$system_version.'</b>. '.str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')).'</span>';
170 170
             } else {
171 171
                 $output = '<br /><span style="color:green">'.get_lang('VersionUpToDate').': Chamilo '.$version_info.'</span>';
172 172
             }
173 173
         } else {
174
-            $output = '<span style="color:red">' . get_lang('ImpossibleToContactVersionServerPleaseTryAgain') . '</span>';
174
+            $output = '<span style="color:red">'.get_lang('ImpossibleToContactVersionServerPleaseTryAgain').'</span>';
175 175
         }
176 176
     } else {
177
-        $output = '<span style="color:red">' . get_lang('AllowurlfopenIsSetToOff') . '</span>';
177
+        $output = '<span style="color:red">'.get_lang('AllowurlfopenIsSetToOff').'</span>';
178 178
     }
179 179
     return $output;
180 180
 }
@@ -197,17 +197,17 @@  discard block
 block discarded – undo
197 197
     $getdata_str = count($getdata) ? '?' : '';
198 198
 
199 199
     foreach ($getdata as $k => $v) {
200
-                $getdata_str .= urlencode($k) .'='. urlencode($v) . '&';
200
+                $getdata_str .= urlencode($k).'='.urlencode($v).'&';
201 201
     }
202 202
 
203 203
     $crlf = "\r\n";
204
-    $req = $verb .' '. $uri . $getdata_str .' HTTP/1.1' . $crlf;
205
-    $req .= 'Host: '. $ip . $crlf;
206
-    $req .= 'User-Agent: Mozilla/5.0 Firefox/3.6.12' . $crlf;
207
-    $req .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' . $crlf;
208
-    $req .= 'Accept-Language: en-us,en;q=0.5' . $crlf;
209
-    $req .= 'Accept-Encoding: deflate' . $crlf;
210
-    $req .= 'Accept-Charset: utf-8;q=0.7,*;q=0.7' . $crlf;
204
+    $req = $verb.' '.$uri.$getdata_str.' HTTP/1.1'.$crlf;
205
+    $req .= 'Host: '.$ip.$crlf;
206
+    $req .= 'User-Agent: Mozilla/5.0 Firefox/3.6.12'.$crlf;
207
+    $req .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'.$crlf;
208
+    $req .= 'Accept-Language: en-us,en;q=0.5'.$crlf;
209
+    $req .= 'Accept-Encoding: deflate'.$crlf;
210
+    $req .= 'Accept-Charset: utf-8;q=0.7,*;q=0.7'.$crlf;
211 211
 
212 212
     $req .= $crlf;
213 213
 
Please login to merge, or discard this patch.
main/inc/ajax/sequence.ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,11 +83,11 @@
 block discarded – undo
83 83
                         );
84 84
                     }
85 85
 
86
-                    $link = '<div class="parent" data-id="' . $id . '">';
86
+                    $link = '<div class="parent" data-id="'.$id.'">';
87 87
                     $link .= '<div class="big-icon">';
88 88
                     $link .= $image;
89
-                    $link .= '<div class="sequence-course">' . $sessionInfo['name'] . '</div>';
90
-                    $link .= '<a href="#" class="sequence-id">' . $id . '</a>';
89
+                    $link .= '<div class="sequence-course">'.$sessionInfo['name'].'</div>';
90
+                    $link .= '<a href="#" class="sequence-id">'.$id.'</a>';
91 91
                     $link .= $linkDelete;
92 92
                     $link .= $linkUndo;
93 93
                     $link .= '</div></div>';
Please login to merge, or discard this patch.
main/inc/ajax/lp.ajax.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,9 +64,9 @@  discard block
 block discarded – undo
64 64
     case 'update_lp_item_order':
65 65
         if (api_is_allowed_to_edit(null, true)) {
66 66
 
67
-            $new_order   = $_POST['new_order'];
67
+            $new_order = $_POST['new_order'];
68 68
 
69
-            $sections	= explode('^', $new_order);
69
+            $sections = explode('^', $new_order);
70 70
             $new_array = array();
71 71
 
72 72
             // We have to update parent_item_id, previous_item_id, next_item_id, display_order in the database
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             foreach ($tab_parents_id as $parent_id) {
85 85
                 $Same_parent_LP_item_list = $LP_item_list->get_item_with_same_parent($parent_id);
86 86
                 $previous_item_id = 0;
87
-                for ($i=0; $i < count($Same_parent_LP_item_list->list);$i++) {
87
+                for ($i = 0; $i < count($Same_parent_LP_item_list->list); $i++) {
88 88
                     $item_id = $Same_parent_LP_item_list->list[$i]->id;
89 89
                     // display_order
90 90
                     $display_order = $i + 1;
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                     // next_item_id
96 96
                     $next_item_id = 0;
97 97
                     if ($i < count($Same_parent_LP_item_list->list) - 1) {
98
-                        $next_item_id = $Same_parent_LP_item_list->list[$i+1]->id;
98
+                        $next_item_id = $Same_parent_LP_item_list->list[$i + 1]->id;
99 99
                     }
100 100
                     $LP_item_list->set_parameters_for_id($item_id, $next_item_id, "next_item_id");
101 101
                 }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                 $params['display_order']    = $LP_item->display_order;
107 107
                 $params['previous_item_id']	= $LP_item->previous_item_id;
108 108
                 $params['next_item_id']     = $LP_item->next_item_id;
109
-                $params['parent_item_id']	= $LP_item->parent_item_id;
109
+                $params['parent_item_id'] = $LP_item->parent_item_id;
110 110
 
111 111
                 Database::update(
112 112
                     $tbl_lp_item,
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 
308 308
     public function get_item_with_same_parent($in_parent_id) {
309 309
         $out_res = new LP_item_order_list();
310
-        for ($i=0; $i < count($this->list); $i++) {
310
+        for ($i = 0; $i < count($this->list); $i++) {
311 311
             if ($this->list[$i]->parent_item_id == $in_parent_id) {
312 312
                 $out_res->add($this->list[$i]);
313 313
             }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
     }
327 327
 
328 328
     public function set_parameters_for_id($in_id, $in_value, $in_parameters) {
329
-        for ($i=0; $i < count($this->list); $i++) {
329
+        for ($i = 0; $i < count($this->list); $i++) {
330 330
             if ($this->list[$i]->id == $in_id) {
331 331
                 $this->list[$i]->$in_parameters = $in_value;
332 332
                 break;
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
     public $next_item_id = 0;
344 344
     public $display_order = 0;
345 345
 
346
-    public function __construct($in_id=0, $in_parent_id=0) {
346
+    public function __construct($in_id = 0, $in_parent_id = 0) {
347 347
         $this->id = $in_id;
348 348
         $this->parent_item_id = $in_parent_id;
349 349
     }
Please login to merge, or discard this patch.
main/inc/ajax/course.ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                     0, //howMany
74 74
                     1, //$orderby = 1
75 75
                     'ASC',
76
-                    -1,  //visibility
76
+                    -1, //visibility
77 77
                     $_GET['q'],
78 78
                     null, //$urlId
79 79
                     true //AlsoSearchCode
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
                 if (!empty($course['category_code'])) {
94 94
                     $parents = getParentsToString($course['category_code']);
95
-                    $title = $parents . $course['title'];
95
+                    $title = $parents.$course['title'];
96 96
                 }
97 97
 
98 98
                 $results['items'][] = array(
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
                     INNER JOIN $session_course_user r ON u.user_id = r.user_id
173 173
                     WHERE session_id = %d AND c_id =  '%s'
174 174
                     AND (u.firstname LIKE '%s' OR u.username LIKE '%s' OR u.lastname LIKE '%s')";
175
-            $needle = '%' . $_GET['q'] . '%';
175
+            $needle = '%'.$_GET['q'].'%';
176 176
             $sql_query = sprintf($sql, $_GET['session_id'], $course['real_id'], $needle, $needle, $needle);
177 177
 
178 178
             $result = Database::query($sql_query);
@@ -191,11 +191,11 @@  discard block
 block discarded – undo
191 191
     case 'search_exercise_by_course':
192 192
         if (api_is_platform_admin()) {
193 193
             $course = api_get_course_info_by_id($_GET['course_id']);
194
-            $session_id = (!empty($_GET['session_id'])) ?  intval($_GET['session_id']) : 0 ;
194
+            $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0;
195 195
             $exercises = ExerciseLib::get_all_exercises($course, $session_id, false, $_GET['q'], true, 3);
196 196
 
197 197
             foreach ($exercises as $exercise) {
198
-                $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title']) );
198
+                $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title']));
199 199
             }
200 200
             if (!empty($data)) {
201 201
                 $data[] = array('id' => 'T', 'text' => 'TODOS');
@@ -220,11 +220,11 @@  discard block
 block discarded – undo
220 220
                 $sql,
221 221
                 intval($_GET['course_id']),
222 222
                 intval($_GET['session_id']),
223
-                '%' . Database::escape_string($_GET['q']).'%'
223
+                '%'.Database::escape_string($_GET['q']).'%'
224 224
             );
225 225
             $result = Database::query($sql_query);
226 226
             while ($survey = Database::fetch_assoc($result)) {
227
-                $survey['title'] .= ($survey['anonymous'] == 1) ? ' (' . get_lang('Anonymous') . ')' : '';
227
+                $survey['title'] .= ($survey['anonymous'] == 1) ? ' ('.get_lang('Anonymous').')' : '';
228 228
                 $data[] = array(
229 229
                     'id' => $survey['id'],
230 230
                     'text' => strip_tags(html_entity_decode($survey['title']))
Please login to merge, or discard this patch.
main/inc/ajax/course_home.ajax.php 1 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 ) ? 'visible' : 'invisible';
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) ? 'visible' : 'invisible';
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']);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         if (!api_is_platform_admin()) {
121 121
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
122 122
             $my_session_list  = array();
123
-            foreach($new_session_list as $item) {
123
+            foreach ($new_session_list as $item) {
124 124
                 if (!empty($item['id_session']))
125 125
                     $my_session_list[] = $item['id_session'];
126 126
             }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             }
130 130
         }
131 131
 
132
-        $start = $limit*$page - $limit;
132
+        $start = $limit * $page - $limit;
133 133
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
134 134
         $count = 0;
135 135
         $temp = array();
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
             $item['title']      = Display::url($item['title'], $course_url, array('target' => SESSION_LINK_TARGET));
142 142
 
143 143
             foreach ($flat_list as $lp_id => $lp_item) {
144
-                $temp[$count]['id']= $lp_id;
144
+                $temp[$count]['id'] = $lp_id;
145 145
 
146 146
                 $lp = new learnpath($item['code'], $lp_id, api_get_user_id());
147 147
                 if ($lp->progress_db == 100) {
@@ -205,27 +205,27 @@  discard block
 block discarded – undo
205 205
 
206 206
         $temp = msort($temp, $sidx, $sord);
207 207
 
208
-        $i =0;
208
+        $i = 0;
209 209
         $response = new stdClass();
210
-        foreach($temp as $key=>$row) {
210
+        foreach ($temp as $key=>$row) {
211 211
             $row = $row['cell'];
212 212
             if (!empty($row)) {
213
-                if ($key >= $start  && $key < ($start + $limit)) {
214
-                    $response->rows[$i]['id']= $key;
215
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]);
213
+                if ($key >= $start && $key < ($start + $limit)) {
214
+                    $response->rows[$i]['id'] = $key;
215
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]);
216 216
                     $i++;
217 217
                 }
218 218
             }
219 219
         }
220 220
 
221
-        if($count > 0 && $limit > 0) {
222
-            $total_pages = ceil($count/$limit);
221
+        if ($count > 0 && $limit > 0) {
222
+            $total_pages = ceil($count / $limit);
223 223
         } else {
224 224
             $total_pages = 0;
225 225
         }
226
-        $response->total    = $total_pages;
226
+        $response->total = $total_pages;
227 227
         if ($page > $total_pages) {
228
-            $response->page= $total_pages;
228
+            $response->page = $total_pages;
229 229
         } else {
230 230
             $response->page = $page;
231 231
         }
@@ -236,13 +236,13 @@  discard block
 block discarded – undo
236 236
         require_once '../global.inc.php';
237 237
         $now = time();
238 238
 
239
-        $page  = intval($_REQUEST['page']);     //page
240
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
239
+        $page  = intval($_REQUEST['page']); //page
240
+        $limit = intval($_REQUEST['rows']); // quantity of rows
241 241
         $sidx  = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'course';
242 242
         $sidx = str_replace(array('week desc,', ' '), '', $sidx);
243 243
 
244
-        $sord  = $_REQUEST['sord'];    //asc or desc
245
-        if (!in_array($sord, array('asc','desc'))) {
244
+        $sord  = $_REQUEST['sord']; //asc or desc
245
+        if (!in_array($sord, array('asc', 'desc'))) {
246 246
             $sord = 'desc';
247 247
         }
248 248
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         if (!api_is_platform_admin()) {
254 254
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
255 255
             $my_session_list  = array();
256
-            foreach($new_session_list as $item) {
256
+            foreach ($new_session_list as $item) {
257 257
                 if (!empty($item['id_session']))
258 258
                     $my_session_list[] = $item['id_session'];
259 259
             }
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
             }
263 263
         }
264 264
 
265
-        $start = $limit*$page - $limit;
265
+        $start = $limit * $page - $limit;
266 266
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
267 267
 
268 268
         $count = 0;
@@ -274,13 +274,13 @@  discard block
 block discarded – undo
274 274
                 }
275 275
             }
276 276
 
277
-            $list = new LearnpathList(api_get_user_id(),$item['code'], $session_id, 'publicated_on DESC');
277
+            $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id, 'publicated_on DESC');
278 278
             $flat_list = $list->get_flat_list();
279 279
             $lps[$item['code']] = $flat_list;
280
-            $item['title'] = Display::url($item['title'],api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id,array('target'=>SESSION_LINK_TARGET));
280
+            $item['title'] = Display::url($item['title'], api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET));
281 281
 
282 282
             foreach ($flat_list as $lp_id => $lp_item) {
283
-                $temp[$count]['id']= $lp_id;
283
+                $temp[$count]['id'] = $lp_id;
284 284
                 $lp_url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
285 285
 
286 286
                 $last_date = Tracking::get_last_connection_date_on_the_course(
@@ -338,20 +338,20 @@  discard block
 block discarded – undo
338 338
         }
339 339
 
340 340
         $response = new stdClass();
341
-        $i =0;
342
-        foreach($temp as $key=>$row) {
341
+        $i = 0;
342
+        foreach ($temp as $key=>$row) {
343 343
             $row = $row['cell'];
344 344
             if (!empty($row)) {
345
-                if ($key >= $start  && $key < ($start + $limit)) {
346
-                    $response->rows[$i]['id']= $key;
347
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2],$row[3]);
345
+                if ($key >= $start && $key < ($start + $limit)) {
346
+                    $response->rows[$i]['id'] = $key;
347
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2], $row[3]);
348 348
                     $i++;
349 349
                 }
350 350
             }
351 351
         }
352 352
 
353 353
         if ($count > 0 && $limit > 0) {
354
-            $total_pages = ceil($count/$limit);
354
+            $total_pages = ceil($count / $limit);
355 355
         } else {
356 356
             $total_pages = 0;
357 357
         }
@@ -367,13 +367,13 @@  discard block
 block discarded – undo
367 367
     case 'session_courses_lp_by_course':
368 368
         require_once '../global.inc.php';
369 369
         $now = time();
370
-        $page  = intval($_REQUEST['page']);     //page
371
-        $limit = intval($_REQUEST['rows']);     // quantity of rows
370
+        $page  = intval($_REQUEST['page']); //page
371
+        $limit = intval($_REQUEST['rows']); // quantity of rows
372 372
         $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id';
373 373
         $sidx = str_replace(array('course asc,', ' '), '', $sidx);
374 374
 
375
-        $sord  = $_REQUEST['sord'];    //asc or desc
376
-        if (!in_array($sord, array('asc','desc'))) {
375
+        $sord = $_REQUEST['sord']; //asc or desc
376
+        if (!in_array($sord, array('asc', 'desc'))) {
377 377
             $sord = 'desc';
378 378
         }
379 379
         $session_id  = intval($_REQUEST['session_id']);
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         if (!api_is_platform_admin()) {
384 384
             $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id());
385 385
             $my_session_list  = array();
386
-            foreach($new_session_list as $item) {
386
+            foreach ($new_session_list as $item) {
387 387
                 if (!empty($item['id_session']))
388 388
                     $my_session_list[] = $item['id_session'];
389 389
             }
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
             }
393 393
         }
394 394
 
395
-        $start = $limit*$page - $limit;
395
+        $start = $limit * $page - $limit;
396 396
         $course_list = SessionManager::get_course_list_by_session_id($session_id);
397 397
         $count = 0;
398 398
 
@@ -403,15 +403,15 @@  discard block
 block discarded – undo
403 403
                 }
404 404
             }
405 405
 
406
-            $list = new LearnpathList(api_get_user_id(),$item['code'],$session_id);
406
+            $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id);
407 407
             $flat_list = $list->get_flat_list();
408 408
             $lps[$item['code']] = $flat_list;
409 409
             $item['title'] = Display::url(
410 410
                 $item['title'],
411 411
                 api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET)
412 412
             );
413
-            foreach($flat_list as $lp_id => $lp_item) {
414
-                $temp[$count]['id']= $lp_id;
413
+            foreach ($flat_list as $lp_id => $lp_item) {
414
+                $temp[$count]['id'] = $lp_id;
415 415
                 $lp_url = api_get_path(WEB_CODE_PATH).'newscorm/lp_controller.php?cidReq='.$item['code'].'&id_session='.$session_id.'&lp_id='.$lp_id.'&action=view';
416 416
                 $last_date = Tracking::get_last_connection_date_on_the_course(
417 417
                     api_get_user_id(),
@@ -465,13 +465,13 @@  discard block
 block discarded – undo
465 465
         $temp = msort($temp, $sidx, $sord);
466 466
 
467 467
         $response = new stdClass();
468
-        $i =0;
468
+        $i = 0;
469 469
         foreach ($temp as $key=>$row) {
470 470
             $row = $row['cell'];
471 471
             if (!empty($row)) {
472
-                if ($key >= $start  && $key < ($start + $limit)) {
473
-                    $response->rows[$i]['id']= $key;
474
-                    $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]);
472
+                if ($key >= $start && $key < ($start + $limit)) {
473
+                    $response->rows[$i]['id'] = $key;
474
+                    $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]);
475 475
                     $i++;
476 476
                 }
477 477
             }
Please login to merge, or discard this patch.
main/inc/ajax/chat.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * Responses to AJAX calls
6 6
  */
7 7
 
8
-$_dont_save_user_course_access  = true;
8
+$_dont_save_user_course_access = true;
9 9
 
10 10
 require_once '../global.inc.php';
11 11
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 $to_user_id = isset($_REQUEST['to']) ? $_REQUEST['to'] : null;
37
-$message	= isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
37
+$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
38 38
 
39 39
 if (!isset($_SESSION['chatHistory'])) {
40 40
     $_SESSION['chatHistory'] = array();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 $chat = new Chat();
48
-if (chat::disableChat()){
48
+if (chat::disableChat()) {
49 49
     exit;
50 50
 }
51 51
 if ($chat->is_chat_blocked_by_exercises()) {
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
             $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id);
86 86
         }
87 87
 
88
-        $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$room['id']}";
88
+        $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH)."chat/video.php?room={$room['id']}";
89 89
         $videoChatLink = Display::url(
90
-            Display::returnFontAwesomeIcon('video-camera') . get_lang('StartVideoChat'),
90
+            Display::returnFontAwesomeIcon('video-camera').get_lang('StartVideoChat'),
91 91
             $videoChatUrl
92 92
         );
93 93
 
Please login to merge, or discard this patch.
main/inc/ajax/myspace.ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 block discarded – undo
58 58
             $db['is_empty'] = false;
59 59
             $db['result'] = convert_to_string($sql_result);
60 60
             $rst = get_stats($user_id, $course_code, $start_date, $end_date);
61
-            $foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
62
-            $foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
63
-            $foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
61
+            $foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />';
62
+            $foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />';
63
+            $foo_stats .= '<strong>'.get_lang('Quantity').' : </strong>'.$rst['times'].'<br />';
64 64
             $db['stats'] = $foo_stats;
65 65
             $db['graph_result'] = grapher($sql_result, $start_date, $end_date, $type);
66 66
         } else {
Please login to merge, or discard this patch.
main/inc/ajax/user_manager.ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 <div class="row">
59 59
                     <div class="col-sm-10 col-sm-offset-2">
60 60
                         <a class="btn btn-primary" id="send_message_link">
61
-                            <em class="fa fa-envelope"></em> ' . get_lang('Send') . '
61
+                            <em class="fa fa-envelope"></em> ' . get_lang('Send').'
62 62
                         </a>
63 63
                     </div>
64 64
                 </div>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
             if (!empty($user_id)) {
114 114
                 $user_table = Database :: get_main_table(TABLE_MAIN_USER);
115
-                $sql="UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
115
+                $sql = "UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
116 116
                 $result = Database::query($sql);
117 117
 
118 118
                 //Send and email if account is active
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                     $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
123 123
                     $email_admin = api_get_setting('emailAdministrator');
124 124
                     $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
125
-                    $emailbody=get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
125
+                    $emailbody = get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
126 126
 
127
-                    $emailbody.=sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
-                    $emailbody.=sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
-                    $emailbody.=get_lang('HaveFun')."\n\n";
127
+                    $emailbody .= sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
+                    $emailbody .= sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
+                    $emailbody .= get_lang('HaveFun')."\n\n";
130 130
                     //$emailbody.=get_lang('Problem'). "\n\n". get_lang('SignatureFormula');
131
-                    $emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
131
+                    $emailbody .= api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n".get_lang('Manager')." ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n".get_lang('Email')." : ".api_get_setting('emailAdministrator');
132 132
 
133 133
                     $additionalParameters = array(
134 134
                         'smsType' => SmsPlugin::ACCOUNT_APPROVED_CONNECT,
Please login to merge, or discard this patch.
main/inc/ajax/thematic.ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 			}
99 99
 			$new_thematic_list = array();
100 100
 
101
-			foreach($thematic_list_temp as $item) {
102
-				if (!empty($item['attendance_id']) ) {
101
+			foreach ($thematic_list_temp as $item) {
102
+				if (!empty($item['attendance_id'])) {
103 103
 					$new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']);
104 104
 				}
105 105
 			}
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 					//checking if was already taken
116 116
 					foreach ($new_thematic_list as $key => $thematic_item) {
117 117
 						//if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) {
118
-						if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
118
+						if ($calendar['db_date_time'] == $thematic_item['start_date']) {
119 119
 							$insert = false;
120 120
 							if ($thematic_advance_id == $key) {
121 121
 								$insert = true;
Please login to merge, or discard this patch.