@@ -121,8 +121,9 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | echo json_encode($response_data); |
64 | 64 | } |
65 | 65 | break; |
66 | - case 'show_course_information' : |
|
67 | - require_once '../global.inc.php'; |
|
66 | + case 'show_course_information' : |
|
67 | + require_once '../global.inc.php'; |
|
68 | 68 | |
69 | - // Get the name of the database course. |
|
70 | - $tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION); |
|
71 | - $course_info = api_get_course_info($_GET['code']); |
|
69 | + // Get the name of the database course. |
|
70 | + $tbl_course_description = Database::get_course_table(TABLE_COURSE_DESCRIPTION); |
|
71 | + $course_info = api_get_course_info($_GET['code']); |
|
72 | 72 | |
73 | 73 | if ( |
74 | 74 | api_get_setting('course_catalog_hide_private') === 'true' && |
@@ -78,24 +78,24 @@ discard block |
||
78 | 78 | break; |
79 | 79 | } |
80 | 80 | |
81 | - $sql = "SELECT * FROM $tbl_course_description |
|
81 | + $sql = "SELECT * FROM $tbl_course_description |
|
82 | 82 | WHERE c_id = ".$course_info['real_id']." AND session_id = 0 |
83 | 83 | ORDER BY id"; |
84 | - $result = Database::query($sql); |
|
85 | - if (Database::num_rows($result) > 0 ) { |
|
86 | - while ($description = Database::fetch_object($result)) { |
|
87 | - $descriptions[$description->id] = $description; |
|
88 | - } |
|
84 | + $result = Database::query($sql); |
|
85 | + if (Database::num_rows($result) > 0 ) { |
|
86 | + while ($description = Database::fetch_object($result)) { |
|
87 | + $descriptions[$description->id] = $description; |
|
88 | + } |
|
89 | 89 | // Function that displays the details of the course description in html. |
90 | - echo CourseManager::get_details_course_description_html( |
|
90 | + echo CourseManager::get_details_course_description_html( |
|
91 | 91 | $descriptions, |
92 | 92 | api_get_system_encoding(), |
93 | 93 | false |
94 | 94 | ); |
95 | - } else { |
|
96 | - echo get_lang('NoDescription'); |
|
97 | - } |
|
98 | - break; |
|
95 | + } else { |
|
96 | + echo get_lang('NoDescription'); |
|
97 | + } |
|
98 | + break; |
|
99 | 99 | case 'session_courses_lp_default': |
100 | 100 | /** |
101 | 101 | * @todo this functions need to belong to a class or a special |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id'; |
111 | 111 | $sord = $_REQUEST['sord']; //asc or desc |
112 | 112 | if (!in_array($sord, array('asc','desc'))) { |
113 | - $sord = 'desc'; |
|
113 | + $sord = 'desc'; |
|
114 | 114 | } |
115 | 115 | $session_id = intval($_REQUEST['session_id']); |
116 | 116 | $course_id = intval($_REQUEST['course_id']); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $my_session_list[] = $item['id_session']; |
125 | 125 | } |
126 | 126 | if (!in_array($session_id, $my_session_list)) { |
127 | - break; |
|
127 | + break; |
|
128 | 128 | } |
129 | 129 | } |
130 | 130 | |
@@ -445,7 +445,7 @@ discard block |
||
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; |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | |
500 | 500 | echo json_encode($response); |
501 | 501 | break; |
502 | - default: |
|
503 | - echo ''; |
|
502 | + default: |
|
503 | + echo ''; |
|
504 | 504 | } |
505 | 505 | exit; |
@@ -30,7 +30,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | } |
273 | 273 | } |
274 | 274 | |
275 | - $list = new LearnpathList(api_get_user_id(),$item['code'], $session_id, 'publicated_on DESC'); |
|
275 | + $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id, 'publicated_on DESC'); |
|
276 | 276 | $flat_list = $list->get_flat_list(); |
277 | 277 | $lps[$item['code']] = $flat_list; |
278 | 278 | $item['title'] = Display::url( |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | ); |
283 | 283 | |
284 | 284 | foreach ($flat_list as $lp_id => $lp_item) { |
285 | - $temp[$count]['id']= $lp_id; |
|
286 | - $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'; |
|
285 | + $temp[$count]['id'] = $lp_id; |
|
286 | + $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'; |
|
287 | 287 | |
288 | 288 | $last_date = Tracking::get_last_connection_date_on_the_course( |
289 | 289 | api_get_user_id(), |
@@ -345,20 +345,20 @@ discard block |
||
345 | 345 | } |
346 | 346 | |
347 | 347 | $response = new stdClass(); |
348 | - $i =0; |
|
349 | - foreach($temp as $key=>$row) { |
|
348 | + $i = 0; |
|
349 | + foreach ($temp as $key=>$row) { |
|
350 | 350 | $row = $row['cell']; |
351 | 351 | if (!empty($row)) { |
352 | - if ($key >= $start && $key < ($start + $limit)) { |
|
353 | - $response->rows[$i]['id']= $key; |
|
354 | - $response->rows[$i]['cell']=array($row[0], $row[1], $row[2],$row[3]); |
|
352 | + if ($key >= $start && $key < ($start + $limit)) { |
|
353 | + $response->rows[$i]['id'] = $key; |
|
354 | + $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2], $row[3]); |
|
355 | 355 | $i++; |
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
359 | 359 | |
360 | 360 | if ($count > 0 && $limit > 0) { |
361 | - $total_pages = ceil($count/$limit); |
|
361 | + $total_pages = ceil($count / $limit); |
|
362 | 362 | } else { |
363 | 363 | $total_pages = 0; |
364 | 364 | } |
@@ -374,12 +374,12 @@ discard block |
||
374 | 374 | case 'session_courses_lp_by_course': |
375 | 375 | require_once '../global.inc.php'; |
376 | 376 | $now = time(); |
377 | - $page = intval($_REQUEST['page']); //page |
|
378 | - $limit = intval($_REQUEST['rows']); // quantity of rows |
|
377 | + $page = intval($_REQUEST['page']); //page |
|
378 | + $limit = intval($_REQUEST['rows']); // quantity of rows |
|
379 | 379 | $sidx = isset($_REQUEST['sidx']) && !empty($_REQUEST['sidx']) ? $_REQUEST['sidx'] : 'id'; |
380 | 380 | $sidx = str_replace(array('course asc,', ' '), '', $sidx); |
381 | 381 | |
382 | - $sord = $_REQUEST['sord']; //asc or desc |
|
382 | + $sord = $_REQUEST['sord']; //asc or desc |
|
383 | 383 | if (!in_array($sord, array('asc', 'desc'))) { |
384 | 384 | $sord = 'desc'; |
385 | 385 | } |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | if (!api_is_platform_admin()) { |
391 | 391 | $new_session_list = UserManager::get_personal_session_course_list(api_get_user_id()); |
392 | 392 | $my_session_list = array(); |
393 | - foreach($new_session_list as $item) { |
|
393 | + foreach ($new_session_list as $item) { |
|
394 | 394 | if (!empty($item['id_session'])) |
395 | 395 | $my_session_list[] = $item['id_session']; |
396 | 396 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
402 | - $start = $limit*$page - $limit; |
|
402 | + $start = $limit * $page - $limit; |
|
403 | 403 | $course_list = SessionManager::get_course_list_by_session_id($session_id); |
404 | 404 | $count = 0; |
405 | 405 | |
@@ -410,16 +410,16 @@ discard block |
||
410 | 410 | } |
411 | 411 | } |
412 | 412 | |
413 | - $list = new LearnpathList(api_get_user_id(),$item['code'],$session_id); |
|
413 | + $list = new LearnpathList(api_get_user_id(), $item['code'], $session_id); |
|
414 | 414 | $flat_list = $list->get_flat_list(); |
415 | 415 | $lps[$item['code']] = $flat_list; |
416 | 416 | $item['title'] = Display::url( |
417 | 417 | $item['title'], |
418 | 418 | api_get_path(WEB_COURSE_PATH).$item['directory'].'/?id_session='.$session_id, array('target'=>SESSION_LINK_TARGET) |
419 | 419 | ); |
420 | - foreach($flat_list as $lp_id => $lp_item) { |
|
421 | - $temp[$count]['id']= $lp_id; |
|
422 | - $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'; |
|
420 | + foreach ($flat_list as $lp_id => $lp_item) { |
|
421 | + $temp[$count]['id'] = $lp_id; |
|
422 | + $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'; |
|
423 | 423 | $last_date = Tracking::get_last_connection_date_on_the_course( |
424 | 424 | api_get_user_id(), |
425 | 425 | $item, |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | $temp = msort($temp, $sidx, $sord); |
473 | 473 | |
474 | 474 | $response = new stdClass(); |
475 | - $i =0; |
|
475 | + $i = 0; |
|
476 | 476 | foreach ($temp as $key=>$row) { |
477 | 477 | $row = $row['cell']; |
478 | 478 | if (!empty($row)) { |
479 | - if ($key >= $start && $key < ($start + $limit)) { |
|
480 | - $response->rows[$i]['id']= $key; |
|
481 | - $response->rows[$i]['cell']=array($row[0], $row[1], $row[2]); |
|
479 | + if ($key >= $start && $key < ($start + $limit)) { |
|
480 | + $response->rows[$i]['id'] = $key; |
|
481 | + $response->rows[$i]['cell'] = array($row[0], $row[1], $row[2]); |
|
482 | 482 | $i++; |
483 | 483 | } |
484 | 484 | } |
@@ -55,56 +55,56 @@ |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | switch ($action) { |
58 | - case 'chatheartbeat': |
|
59 | - $chat->heartbeat(); |
|
60 | - break; |
|
61 | - case 'closechat': |
|
62 | - $chat->close(); |
|
63 | - break; |
|
64 | - case 'sendchat': |
|
65 | - $chat->send(api_get_user_id(), $to_user_id, $message); |
|
66 | - break; |
|
67 | - case 'startchatsession': |
|
68 | - $chat->startSession(); |
|
69 | - break; |
|
70 | - case 'set_status': |
|
71 | - $status = isset($_REQUEST['status']) ? intval($_REQUEST['status']) : 0; |
|
72 | - $chat->setUserStatus($status); |
|
73 | - break; |
|
74 | - case 'create_room': |
|
75 | - $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id); |
|
76 | - |
|
77 | - if ($room === false) { |
|
78 | - $createdRoom = VideoChat::createRoom(api_get_user_id(), $to_user_id); |
|
79 | - |
|
80 | - if ($createdRoom === false) { |
|
81 | - echo Display::return_message(get_lang('ChatRoomNotCreated'), 'error'); |
|
82 | - break; |
|
58 | + case 'chatheartbeat': |
|
59 | + $chat->heartbeat(); |
|
60 | + break; |
|
61 | + case 'closechat': |
|
62 | + $chat->close(); |
|
63 | + break; |
|
64 | + case 'sendchat': |
|
65 | + $chat->send(api_get_user_id(), $to_user_id, $message); |
|
66 | + break; |
|
67 | + case 'startchatsession': |
|
68 | + $chat->startSession(); |
|
69 | + break; |
|
70 | + case 'set_status': |
|
71 | + $status = isset($_REQUEST['status']) ? intval($_REQUEST['status']) : 0; |
|
72 | + $chat->setUserStatus($status); |
|
73 | + break; |
|
74 | + case 'create_room': |
|
75 | + $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id); |
|
76 | + |
|
77 | + if ($room === false) { |
|
78 | + $createdRoom = VideoChat::createRoom(api_get_user_id(), $to_user_id); |
|
79 | + |
|
80 | + if ($createdRoom === false) { |
|
81 | + echo Display::return_message(get_lang('ChatRoomNotCreated'), 'error'); |
|
82 | + break; |
|
83 | + } |
|
84 | + |
|
85 | + $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id); |
|
83 | 86 | } |
84 | 87 | |
85 | - $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id); |
|
86 | - } |
|
87 | - |
|
88 | - $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$room['id']}"; |
|
89 | - $videoChatLink = Display::url( |
|
90 | - Display::returnFontAwesomeIcon('video-camera') . get_lang('StartVideoChat'), |
|
91 | - $videoChatUrl |
|
92 | - ); |
|
93 | - |
|
94 | - $chat->send( |
|
95 | - api_get_user_id(), |
|
96 | - $to_user_id, |
|
97 | - $videoChatLink, |
|
98 | - false, |
|
99 | - false |
|
100 | - ); |
|
101 | - |
|
102 | - echo Display::tag('p', $videoChatLink, ['class' => 'lead']); |
|
103 | - break; |
|
104 | - case 'notify_not_support': |
|
105 | - $chat->send(api_get_user_id(), $to_user_id, get_lang('TheXUserBrowserDoesNotSupportWebRTC')); |
|
106 | - break; |
|
107 | - default: |
|
108 | - echo ''; |
|
88 | + $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$room['id']}"; |
|
89 | + $videoChatLink = Display::url( |
|
90 | + Display::returnFontAwesomeIcon('video-camera') . get_lang('StartVideoChat'), |
|
91 | + $videoChatUrl |
|
92 | + ); |
|
93 | + |
|
94 | + $chat->send( |
|
95 | + api_get_user_id(), |
|
96 | + $to_user_id, |
|
97 | + $videoChatLink, |
|
98 | + false, |
|
99 | + false |
|
100 | + ); |
|
101 | + |
|
102 | + echo Display::tag('p', $videoChatLink, ['class' => 'lead']); |
|
103 | + break; |
|
104 | + case 'notify_not_support': |
|
105 | + $chat->send(api_get_user_id(), $to_user_id, get_lang('TheXUserBrowserDoesNotSupportWebRTC')); |
|
106 | + break; |
|
107 | + default: |
|
108 | + echo ''; |
|
109 | 109 | } |
110 | 110 | exit; |
@@ -5,7 +5,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -58,9 +58,9 @@ |
||
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 { |
@@ -58,7 +58,7 @@ discard block |
||
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 |
||
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 |
||
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, |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | $thematic = new Thematic(); |
12 | 12 | |
13 | 13 | switch ($action) { |
14 | - case 'save_thematic_plan': |
|
15 | - /*$title_list = $_REQUEST['title']; |
|
14 | + case 'save_thematic_plan': |
|
15 | + /*$title_list = $_REQUEST['title']; |
|
16 | 16 | $description_list = $_REQUEST['desc']; |
17 | 17 | //$description_list = $_REQUEST['description']; |
18 | 18 | $description_type = $_REQUEST['description_type']; |
@@ -25,13 +25,13 @@ discard block |
||
25 | 25 | $thematic_plan_data = $thematic->get_thematic_plan_data(); |
26 | 26 | $return = $thematic->get_thematic_plan_div($thematic_plan_data); |
27 | 27 | echo $return[$_REQUEST['thematic_id']];*/ |
28 | - break; |
|
29 | - case 'save_thematic_advance': |
|
30 | - if (!api_is_allowed_to_edit(null, true)) { |
|
31 | - echo ''; |
|
32 | - exit; |
|
33 | - } |
|
34 | - /* |
|
28 | + break; |
|
29 | + case 'save_thematic_advance': |
|
30 | + if (!api_is_allowed_to_edit(null, true)) { |
|
31 | + echo ''; |
|
32 | + exit; |
|
33 | + } |
|
34 | + /* |
|
35 | 35 | if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) { |
36 | 36 | if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) { |
37 | 37 | $start_date_error = true; |
@@ -79,80 +79,80 @@ discard block |
||
79 | 79 | $thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true); |
80 | 80 | $return = $thematic->get_thematic_advance_div($thematic_advance_data); |
81 | 81 | echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/ |
82 | - break; |
|
83 | - case 'get_datetime_by_attendance': |
|
84 | - $attendance_id = intval($_REQUEST['attendance_id']); |
|
85 | - $thematic_advance_id = intval($_REQUEST['thematic_advance_id']); |
|
82 | + break; |
|
83 | + case 'get_datetime_by_attendance': |
|
84 | + $attendance_id = intval($_REQUEST['attendance_id']); |
|
85 | + $thematic_advance_id = intval($_REQUEST['thematic_advance_id']); |
|
86 | 86 | |
87 | - $label = ''; |
|
88 | - $input_select = ''; |
|
89 | - if (!empty($attendance_id)) { |
|
90 | - $attendance = new Attendance(); |
|
91 | - $thematic = new Thematic(); |
|
92 | - $thematic_list = $thematic->get_thematic_list(); |
|
87 | + $label = ''; |
|
88 | + $input_select = ''; |
|
89 | + if (!empty($attendance_id)) { |
|
90 | + $attendance = new Attendance(); |
|
91 | + $thematic = new Thematic(); |
|
92 | + $thematic_list = $thematic->get_thematic_list(); |
|
93 | 93 | |
94 | - $my_list = $thematic_list_temp = array(); |
|
95 | - foreach ($thematic_list as $item) { |
|
96 | - $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']); |
|
97 | - $thematic_list_temp = array_merge($my_list, $thematic_list_temp); |
|
98 | - } |
|
99 | - $new_thematic_list = array(); |
|
94 | + $my_list = $thematic_list_temp = array(); |
|
95 | + foreach ($thematic_list as $item) { |
|
96 | + $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']); |
|
97 | + $thematic_list_temp = array_merge($my_list, $thematic_list_temp); |
|
98 | + } |
|
99 | + $new_thematic_list = array(); |
|
100 | 100 | |
101 | - foreach($thematic_list_temp as $item) { |
|
102 | - if (!empty($item['attendance_id']) ) { |
|
103 | - $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
|
104 | - } |
|
105 | - } |
|
101 | + foreach($thematic_list_temp as $item) { |
|
102 | + if (!empty($item['attendance_id']) ) { |
|
103 | + $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
|
104 | + } |
|
105 | + } |
|
106 | 106 | |
107 | - $attendance_calendar = $attendance->get_attendance_calendar($attendance_id); |
|
107 | + $attendance_calendar = $attendance->get_attendance_calendar($attendance_id); |
|
108 | 108 | |
109 | - $label = get_lang('StartDate'); |
|
110 | - if (!empty($attendance_calendar)) { |
|
111 | - $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">'; |
|
112 | - foreach ($attendance_calendar as $calendar) { |
|
113 | - $selected = null; |
|
114 | - $insert = true; |
|
115 | - //checking if was already taken |
|
116 | - foreach ($new_thematic_list as $key => $thematic_item) { |
|
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'] ) { |
|
119 | - $insert = false; |
|
120 | - if ($thematic_advance_id == $key) { |
|
121 | - $insert = true; |
|
122 | - $selected = 'selected'; |
|
123 | - } |
|
124 | - break; |
|
125 | - } |
|
126 | - } |
|
127 | - if ($insert == true) { |
|
128 | - $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>'; |
|
129 | - } |
|
130 | - } |
|
131 | - $input_select .= '</select>'; |
|
132 | - } else { |
|
133 | - $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>'; |
|
134 | - } |
|
135 | - } |
|
136 | - ?> |
|
109 | + $label = get_lang('StartDate'); |
|
110 | + if (!empty($attendance_calendar)) { |
|
111 | + $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">'; |
|
112 | + foreach ($attendance_calendar as $calendar) { |
|
113 | + $selected = null; |
|
114 | + $insert = true; |
|
115 | + //checking if was already taken |
|
116 | + foreach ($new_thematic_list as $key => $thematic_item) { |
|
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'] ) { |
|
119 | + $insert = false; |
|
120 | + if ($thematic_advance_id == $key) { |
|
121 | + $insert = true; |
|
122 | + $selected = 'selected'; |
|
123 | + } |
|
124 | + break; |
|
125 | + } |
|
126 | + } |
|
127 | + if ($insert == true) { |
|
128 | + $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>'; |
|
129 | + } |
|
130 | + } |
|
131 | + $input_select .= '</select>'; |
|
132 | + } else { |
|
133 | + $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>'; |
|
134 | + } |
|
135 | + } |
|
136 | + ?> |
|
137 | 137 | <div class="form-group"> |
138 | 138 | <label class="col-sm-2 control-label"><?php echo $label ?></label> |
139 | 139 | <div class="col-sm-10"><?php echo $input_select ?></div> |
140 | 140 | </div> |
141 | 141 | <?php |
142 | - break; |
|
143 | - case 'update_done_thematic_advance': |
|
144 | - $thematic_advance_id = intval($_GET['thematic_advance_id']); |
|
145 | - $total_average = 0; |
|
146 | - if (!empty($thematic_advance_id)) { |
|
147 | - $thematic = new Thematic(); |
|
148 | - $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id); |
|
149 | - //if ($affected_rows) { |
|
150 | - $total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id()); |
|
151 | - //} |
|
152 | - } |
|
153 | - echo $total_average; |
|
154 | - break; |
|
155 | - default: |
|
156 | - echo ''; |
|
142 | + break; |
|
143 | + case 'update_done_thematic_advance': |
|
144 | + $thematic_advance_id = intval($_GET['thematic_advance_id']); |
|
145 | + $total_average = 0; |
|
146 | + if (!empty($thematic_advance_id)) { |
|
147 | + $thematic = new Thematic(); |
|
148 | + $affected_rows = $thematic->update_done_thematic_advances($thematic_advance_id); |
|
149 | + //if ($affected_rows) { |
|
150 | + $total_average = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id()); |
|
151 | + //} |
|
152 | + } |
|
153 | + echo $total_average; |
|
154 | + break; |
|
155 | + default: |
|
156 | + echo ''; |
|
157 | 157 | } |
158 | 158 | exit; |
@@ -98,8 +98,8 @@ discard block |
||
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 |
||
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; |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | } |
732 | 732 | |
733 | 733 | break; |
734 | - case 'get_user_skill_ranking': |
|
734 | + case 'get_user_skill_ranking': |
|
735 | 735 | $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank'); |
736 | 736 | $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition); |
737 | 737 | $result = msort($result, 'skills_acquired', 'asc'); |
@@ -1281,7 +1281,7 @@ discard block |
||
1281 | 1281 | |
1282 | 1282 | if (!empty($item['certif_min_score']) && !empty($item['document_id'])) { |
1283 | 1283 | $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL); |
1284 | - $item['has_certificates'] = '1'; |
|
1284 | + $item['has_certificates'] = '1'; |
|
1285 | 1285 | } else { |
1286 | 1286 | $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL); |
1287 | 1287 | $item['has_certificates'] = '0'; |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | $action = $_GET['a']; |
12 | 12 | $page = intval($_REQUEST['page']); //page |
13 | 13 | $limit = intval($_REQUEST['rows']); //quantity of rows |
14 | -$sidx = $_REQUEST['sidx']; //index (field) to filter |
|
15 | -$sord = $_REQUEST['sord']; //asc or desc |
|
14 | +$sidx = $_REQUEST['sidx']; //index (field) to filter |
|
15 | +$sord = $_REQUEST['sord']; //asc or desc |
|
16 | 16 | |
17 | 17 | if (strpos(strtolower($sidx), 'asc') !== false) { |
18 | 18 | $sidx = str_replace(array('asc', ','), '', $sidx); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $sord = 'desc'; |
25 | 25 | } |
26 | 26 | |
27 | -if (!in_array($sord, array('asc','desc'))) { |
|
27 | +if (!in_array($sord, array('asc', 'desc'))) { |
|
28 | 28 | $sord = 'desc'; |
29 | 29 | } |
30 | 30 | |
@@ -64,19 +64,19 @@ discard block |
||
64 | 64 | function getWhereClause($col, $oper, $val) |
65 | 65 | { |
66 | 66 | $ops = array( |
67 | - 'eq' => '=', //equal |
|
68 | - 'ne' => '<>', //not equal |
|
69 | - 'lt' => '<', //less than |
|
70 | - 'le' => '<=', //less than or equal |
|
71 | - 'gt' => '>', //greater than |
|
72 | - 'ge' => '>=', //greater than or equal |
|
73 | - 'bw' => 'LIKE', //begins with |
|
67 | + 'eq' => '=', //equal |
|
68 | + 'ne' => '<>', //not equal |
|
69 | + 'lt' => '<', //less than |
|
70 | + 'le' => '<=', //less than or equal |
|
71 | + 'gt' => '>', //greater than |
|
72 | + 'ge' => '>=', //greater than or equal |
|
73 | + 'bw' => 'LIKE', //begins with |
|
74 | 74 | 'bn' => 'NOT LIKE', //doesn't begin with |
75 | - 'in' => 'LIKE', //is in |
|
75 | + 'in' => 'LIKE', //is in |
|
76 | 76 | 'ni' => 'NOT LIKE', //is not in |
77 | - 'ew' => 'LIKE', //ends with |
|
77 | + 'ew' => 'LIKE', //ends with |
|
78 | 78 | 'en' => 'NOT LIKE', //doesn't end with |
79 | - 'cn' => 'LIKE', //contains |
|
79 | + 'cn' => 'LIKE', //contains |
|
80 | 80 | 'nc' => 'NOT LIKE' //doesn't contain |
81 | 81 | ); |
82 | 82 | |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | |
101 | 101 | // If there is no search request sent by jqgrid, $where should be empty |
102 | 102 | $whereCondition = null; |
103 | -$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false; |
|
104 | -$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv'; |
|
105 | -$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false; |
|
106 | -$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false; |
|
103 | +$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false; |
|
104 | +$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv'; |
|
105 | +$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false; |
|
106 | +$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false; |
|
107 | 107 | $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false; |
108 | 108 | $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false; |
109 | 109 | $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false; |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | foreach ($filters->rules as $key => $rule) { |
168 | 168 | $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data); |
169 | 169 | |
170 | - if ($counter < count($filters->rules) -1) { |
|
170 | + if ($counter < count($filters->rules) - 1) { |
|
171 | 171 | $whereCondition .= $filters->groupOp; |
172 | 172 | } |
173 | 173 | $counter++; |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $userId = api_get_user_id(); |
198 | 198 | $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0; |
199 | 199 | $courseCodeList = array(); |
200 | - $userIdList = array(); |
|
200 | + $userIdList = array(); |
|
201 | 201 | $sessionIdList = []; |
202 | 202 | $searchByGroups = false; |
203 | 203 | if (api_is_drh()) { |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | $total_pages = 0; |
578 | 578 | if ($count > 0) { |
579 | 579 | if (!empty($limit)) { |
580 | - $total_pages = ceil((float)$count/(float)$limit); |
|
580 | + $total_pages = ceil((float) $count / (float) $limit); |
|
581 | 581 | } |
582 | 582 | } |
583 | 583 | if ($page > $total_pages) { |
@@ -858,10 +858,10 @@ discard block |
||
858 | 858 | case 'get_work_user_list_others': |
859 | 859 | if (isset($_GET['type']) && $_GET['type'] === 'simple') { |
860 | 860 | $columns = array( |
861 | - 'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions' |
|
861 | + 'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions' |
|
862 | 862 | ); |
863 | 863 | } else { |
864 | - $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions'); |
|
864 | + $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions'); |
|
865 | 865 | } |
866 | 866 | $whereCondition .= " AND u.user_id <> ".api_get_user_id(); |
867 | 867 | $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition); |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | case 'get_exercise_results': |
896 | 896 | $course = api_get_course_info(); |
897 | 897 | // Used inside ExerciseLib::get_exam_results_data() |
898 | - $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; |
|
898 | + $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document"; |
|
899 | 899 | if ($is_allowedToEdit || api_is_student_boss()) { |
900 | 900 | $columns = array( |
901 | 901 | 'firstname', |
@@ -920,11 +920,11 @@ discard block |
||
920 | 920 | break; |
921 | 921 | case 'get_hotpotatoes_exercise_results': |
922 | 922 | $course = api_get_course_info(); |
923 | - $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; |
|
923 | + $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document"; |
|
924 | 924 | if (api_is_allowed_to_edit()) { |
925 | - $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
925 | + $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
926 | 926 | } else { |
927 | - $columns = array('exe_date', 'score', 'actions'); |
|
927 | + $columns = array('exe_date', 'score', 'actions'); |
|
928 | 928 | } |
929 | 929 | $result = ExerciseLib::get_exam_results_hotpotatoes_data( |
930 | 930 | $start, |
@@ -957,12 +957,12 @@ discard block |
||
957 | 957 | break; |
958 | 958 | case 'get_hotpotatoes_exercise_results': |
959 | 959 | $course = api_get_course_info(); |
960 | - $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document"; |
|
960 | + $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document"; |
|
961 | 961 | |
962 | 962 | if (api_is_allowed_to_edit(null, true) || api_is_drh()) { |
963 | - $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
963 | + $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions'); |
|
964 | 964 | } else { |
965 | - $columns = array('exe_date', 'score', 'actions'); |
|
965 | + $columns = array('exe_date', 'score', 'actions'); |
|
966 | 966 | } |
967 | 967 | $result = ExerciseLib::get_exam_results_hotpotatoes_data( |
968 | 968 | $start, |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | ); |
999 | 999 | } |
1000 | 1000 | |
1001 | - $columns = array( |
|
1001 | + $columns = array( |
|
1002 | 1002 | 'name', |
1003 | 1003 | 'date', |
1004 | 1004 | 'course_per_session', |
@@ -1034,11 +1034,11 @@ discard block |
||
1034 | 1034 | $detailButtons = []; |
1035 | 1035 | $detailButtons[] = Display::url( |
1036 | 1036 | Display::return_icon('works.png', get_lang('WorksReport')), |
1037 | - api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php?session=' . $session['id'] |
|
1037 | + api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php?session='.$session['id'] |
|
1038 | 1038 | ); |
1039 | 1039 | $detailButtons[] = Display::url( |
1040 | 1040 | Display::return_icon('2rightarrow.png'), |
1041 | - api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id'] |
|
1041 | + api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id'] |
|
1042 | 1042 | ); |
1043 | 1043 | |
1044 | 1044 | $result[] = array( |
@@ -1354,7 +1354,7 @@ discard block |
||
1354 | 1354 | $result = $new_result; |
1355 | 1355 | break; |
1356 | 1356 | case 'get_gradebooks': |
1357 | - $columns = array('name', 'certificates','skills', 'actions', 'has_certificates'); |
|
1357 | + $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates'); |
|
1358 | 1358 | if (!in_array($sidx, $columns)) { |
1359 | 1359 | $sidx = 'name'; |
1360 | 1360 | } |
@@ -1527,7 +1527,7 @@ discard block |
||
1527 | 1527 | if (!empty($exercises[$cnt - 4]['title'])) { |
1528 | 1528 | $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title']))); |
1529 | 1529 | } |
1530 | - $columns[] = 'exer' . $i; |
|
1530 | + $columns[] = 'exer'.$i; |
|
1531 | 1531 | $column_names[] = $title; |
1532 | 1532 | $i++; |
1533 | 1533 | break; |
@@ -1560,7 +1560,7 @@ discard block |
||
1560 | 1560 | $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']); |
1561 | 1561 | $result[$i]['session'] = $sessionInfo['name']; |
1562 | 1562 | $result[$i]['username'] = $user['username']; |
1563 | - $result[$i]['name'] = $user['lastname'] . " " . $user['firstname']; |
|
1563 | + $result[$i]['name'] = $user['lastname']." ".$user['firstname']; |
|
1564 | 1564 | $j = 1; |
1565 | 1565 | $finalScore = 0; |
1566 | 1566 | foreach ($quizIds as $quizID) { |
@@ -1568,7 +1568,7 @@ discard block |
||
1568 | 1568 | if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) { |
1569 | 1569 | $finalScore += $grade = $arrGrade [$user['user_id']][$quizID]; |
1570 | 1570 | } |
1571 | - $result[$i]['exer' . $j] = $grade; |
|
1571 | + $result[$i]['exer'.$j] = $grade; |
|
1572 | 1572 | $j++; |
1573 | 1573 | } |
1574 | 1574 | |
@@ -1736,9 +1736,9 @@ discard block |
||
1736 | 1736 | foreach ($result as $row) { |
1737 | 1737 | // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235 |
1738 | 1738 | if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') { |
1739 | - $response->rows[$i]['id']= $i; |
|
1739 | + $response->rows[$i]['id'] = $i; |
|
1740 | 1740 | } else { |
1741 | - $response->rows[$i]['id']= $row['id']; |
|
1741 | + $response->rows[$i]['id'] = $row['id']; |
|
1742 | 1742 | } |
1743 | 1743 | $array = array(); |
1744 | 1744 | foreach ($columns as $col) { |
@@ -1748,7 +1748,7 @@ discard block |
||
1748 | 1748 | $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : ''; |
1749 | 1749 | } |
1750 | 1750 | } |
1751 | - $response->rows[$i]['cell']=$array; |
|
1751 | + $response->rows[$i]['cell'] = $array; |
|
1752 | 1752 | $i++; |
1753 | 1753 | } |
1754 | 1754 | } |
@@ -758,7 +758,7 @@ |
||
758 | 758 | // $gidReset = true; |
759 | 759 | } // end else |
760 | 760 | |
761 | - // Now check for anonymous user mode |
|
761 | + // Now check for anonymous user mode |
|
762 | 762 | if (isset($use_anonymous) && $use_anonymous) { |
763 | 763 | //if anonymous mode is set, then try to set the current user as anonymous |
764 | 764 | //if he doesn't have a login yet |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | // is necessary verify check |
218 | 218 | if ($legal_type == 1) { |
219 | - if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) { |
|
219 | + if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) { |
|
220 | 220 | $legal_option = true; |
221 | 221 | } else { |
222 | 222 | $legal_option = false; |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | * Process external authentication |
519 | 519 | * on the basis of the given login name |
520 | 520 | */ |
521 | - $loginFailed = true; // Default initialisation. It could |
|
521 | + $loginFailed = true; // Default initialisation. It could |
|
522 | 522 | // change after the external authentication |
523 | 523 | $key = $uData['auth_source']; //'ldap','shibboleth'... |
524 | 524 | /* >>>>>>>> External authentication modules <<<<<<<<< */ |
@@ -537,7 +537,7 @@ discard block |
||
537 | 537 | } |
538 | 538 | } else { |
539 | 539 | // login failed, Database::num_rows($result) <= 0 |
540 | - $loginFailed = true; // Default initialisation. It could |
|
540 | + $loginFailed = true; // Default initialisation. It could |
|
541 | 541 | // change after the external authentication |
542 | 542 | |
543 | 543 | /* |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | include_once($thisAuthSource['newUser']); |
564 | 564 | } else { |
565 | 565 | error_log( |
566 | - 'Chamilo Authentication external file' . |
|
566 | + 'Chamilo Authentication external file'. |
|
567 | 567 | ' could not be found - this might prevent your system from using'. |
568 | 568 | ' the authentication process in the user creation process', |
569 | 569 | 0 |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | online_logout(null, false); |
673 | 673 | $osso->logout(); //redirects and exits |
674 | 674 | } |
675 | - } elseif (api_get_setting('openid_authentication')=='true') { |
|
675 | + } elseif (api_get_setting('openid_authentication') == 'true') { |
|
676 | 676 | if (!empty($_POST['openid_url'])) { |
677 | 677 | include api_get_path(SYS_CODE_PATH).'auth/openid/login.php'; |
678 | 678 | openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php'); |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | if ($res['status'] == 'success') { |
686 | 686 | $id1 = Database::escape_string($res['openid.identity']); |
687 | 687 | //have another id with or without the final '/' |
688 | - $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/'); |
|
688 | + $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/'); |
|
689 | 689 | //lookup the user in the main database |
690 | 690 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
691 | 691 | $sql = "SELECT user_id, username, password, auth_source, active, expiration_date |
@@ -694,14 +694,14 @@ discard block |
||
694 | 694 | OR openid = '$id2' "; |
695 | 695 | $result = Database::query($sql); |
696 | 696 | if ($result !== false) { |
697 | - if (Database::num_rows($result)>0) { |
|
697 | + if (Database::num_rows($result) > 0) { |
|
698 | 698 | $uData = Database::fetch_array($result); |
699 | 699 | |
700 | 700 | if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) { |
701 | 701 | //the authentification of this user is managed by Chamilo itself |
702 | 702 | |
703 | 703 | // check if the account is active (not locked) |
704 | - if ($uData['active']=='1') { |
|
704 | + if ($uData['active'] == '1') { |
|
705 | 705 | // check if the expiration date has not been reached |
706 | 706 | if ($uData['expiration_date'] > date('Y-m-d H:i:s') |
707 | 707 | || empty($uData['expiration_date']) |
@@ -780,7 +780,7 @@ discard block |
||
780 | 780 | (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid'])) |
781 | 781 | ) { |
782 | 782 | $cidReset = true; |
783 | - $gidReset = true; // As groups depend from courses, group id is reset |
|
783 | + $gidReset = true; // As groups depend from courses, group id is reset |
|
784 | 784 | } |
785 | 785 | |
786 | 786 | /* USER INIT */ |
@@ -930,8 +930,8 @@ discard block |
||
930 | 930 | $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
931 | 931 | |
932 | 932 | if (!empty($_GET['id_session'])) { |
933 | - $sql = 'SELECT name FROM '.$tbl_session . ' |
|
934 | - WHERE id="'.intval($_GET['id_session']) . '"'; |
|
933 | + $sql = 'SELECT name FROM '.$tbl_session.' |
|
934 | + WHERE id="'.intval($_GET['id_session']).'"'; |
|
935 | 935 | $rs = Database::query($sql); |
936 | 936 | if (Database::num_rows($rs)) { |
937 | 937 | list($_SESSION['session_name']) = Database::fetch_array($rs); |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | // Moreover, if we want to track a course with another session it can be usefull |
1020 | 1020 | if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) { |
1021 | 1021 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
1022 | - $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"'; |
|
1022 | + $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"'; |
|
1023 | 1023 | $rs = Database::query($sql); |
1024 | 1024 | if (Database::num_rows($rs)) { |
1025 | 1025 | list($_SESSION['session_name']) = Database::fetch_array($rs); |
@@ -1144,7 +1144,7 @@ discard block |
||
1144 | 1144 | } |
1145 | 1145 | } |
1146 | 1146 | $url = api_get_path(WEB_CODE_PATH).'auth/inscription.php'; |
1147 | - header("Location:". $url); |
|
1147 | + header("Location:".$url); |
|
1148 | 1148 | exit; |
1149 | 1149 | } |
1150 | 1150 | } |
@@ -1165,8 +1165,8 @@ discard block |
||
1165 | 1165 | if (Database::num_rows($result) > 0) { // this user have a recorded state for this course |
1166 | 1166 | $cuData = Database::fetch_array($result, 'ASSOC'); |
1167 | 1167 | |
1168 | - $is_courseAdmin = (bool)($cuData['status'] == 1); |
|
1169 | - $is_courseTutor = (bool)($cuData['is_tutor'] == 1); |
|
1168 | + $is_courseAdmin = (bool) ($cuData['status'] == 1); |
|
1169 | + $is_courseTutor = (bool) ($cuData['is_tutor'] == 1); |
|
1170 | 1170 | $is_courseMember = true; |
1171 | 1171 | } |
1172 | 1172 | |
@@ -1177,7 +1177,7 @@ discard block |
||
1177 | 1177 | // This user has no status related to this course |
1178 | 1178 | // The user is subscribed in a session? The user is a Session coach a Session admin ? |
1179 | 1179 | |
1180 | - $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
1180 | + $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
1181 | 1181 | $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); |
1182 | 1182 | $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
1183 | 1183 | |
@@ -1290,7 +1290,7 @@ discard block |
||
1290 | 1290 | |
1291 | 1291 | //If I'm the admin platform i'm a teacher of the course |
1292 | 1292 | if ($is_platformAdmin) { |
1293 | - $is_courseAdmin = true; |
|
1293 | + $is_courseAdmin = true; |
|
1294 | 1294 | } |
1295 | 1295 | } |
1296 | 1296 | } else { // keys missing => not anymore in the course - user relation |
@@ -1448,12 +1448,12 @@ discard block |
||
1448 | 1448 | ($logging_in && exist_firstpage_parameter()) |
1449 | 1449 | ) { |
1450 | 1450 | $redirectCourseDir = api_get_firstpage_parameter(); |
1451 | - api_delete_firstpage_parameter(); // delete the cookie |
|
1451 | + api_delete_firstpage_parameter(); // delete the cookie |
|
1452 | 1452 | |
1453 | 1453 | if (!isset($_SESSION['request_uri'])) { |
1454 | 1454 | if (CourseManager::get_course_id_from_path($redirectCourseDir)) { |
1455 | 1455 | $_SESSION['noredirection'] = false; |
1456 | - $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/'; |
|
1456 | + $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/'; |
|
1457 | 1457 | } |
1458 | 1458 | } |
1459 | 1459 | } elseif (api_user_is_login() && exist_firstpage_parameter()) { |
@@ -1461,7 +1461,7 @@ discard block |
||
1461 | 1461 | api_delete_firstpage_parameter(); // delete the cookie |
1462 | 1462 | if (CourseManager::get_course_id_from_path($redirectCourseDir)) { |
1463 | 1463 | $_SESSION['noredirection'] = false; |
1464 | - $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/'; |
|
1464 | + $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/'; |
|
1465 | 1465 | } |
1466 | 1466 | } |
1467 | 1467 |
@@ -196,7 +196,7 @@ |
||
196 | 196 | * |
197 | 197 | * @return array |
198 | 198 | */ |
199 | - public function sender($key = '', $userId = '') |
|
199 | + public function sender($key = '', $userId = '') |
|
200 | 200 | { |
201 | 201 | $_user = api_get_user_info($userId); |
202 | 202 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public static function path($name = '') |
37 | 37 | { |
38 | - return api_get_path(SYS_PATH) . 'custompages/' . $name; |
|
38 | + return api_get_path(SYS_PATH).'custompages/'.$name; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
53 | - $file = self::path($page_name . '.php'); |
|
53 | + $file = self::path($page_name.'.php'); |
|
54 | 54 | if (file_exists($file)) { |
55 | 55 | include($file); |
56 | 56 | exit; |
57 | 57 | } else { |
58 | - error_log('CustomPages::displayPage : could not read file ' . $file); |
|
58 | + error_log('CustomPages::displayPage : could not read file '.$file); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | public static function getURLImages($url_id = null) |
70 | 70 | { |
71 | 71 | if (is_null($url_id)) { |
72 | - $url = 'http://' . $_SERVER['HTTP_HOST'] . '/'; |
|
72 | + $url = 'http://'.$_SERVER['HTTP_HOST'].'/'; |
|
73 | 73 | $url_id = UrlManager::get_url_id($url); |
74 | 74 | } |
75 | - $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/'; |
|
75 | + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; |
|
76 | 76 | $images = array(); |
77 | 77 | for ($img_id = 1; $img_id <= 3; $img_id++) { |
78 | - if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) { |
|
79 | - $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png'; |
|
78 | + if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) { |
|
79 | + $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png'; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |