@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | * @assert () !== '' |
22 | 22 | * @assert ('abc','single') !== '' |
23 | 23 | */ |
24 | - function search_courses($needle,$type) |
|
24 | + function search_courses($needle, $type) |
|
25 | 25 | { |
26 | 26 | $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
27 | 27 | $xajax_response = new xajaxResponse(); |
28 | 28 | $return = ''; |
29 | - if(!empty($needle) && !empty($type)) { |
|
29 | + if (!empty($needle) && !empty($type)) { |
|
30 | 30 | // xajax send utf8 datas... datas in db can be non-utf8 datas |
31 | 31 | $charset = api_get_system_encoding(); |
32 | 32 | $needle = api_convert_encoding($needle, $charset, 'utf-8'); |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | $course_list = array(); |
39 | 39 | |
40 | 40 | $return .= '<select id="origin" name="NoSessionCategoryList[]" multiple="multiple" size="20" style="width:340px;">'; |
41 | - while($course = Database :: fetch_array($rs)) { |
|
41 | + while ($course = Database :: fetch_array($rs)) { |
|
42 | 42 | $course_list[] = $course['id']; |
43 | - $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['name'],ENT_QUOTES).'">'.$course['name'].'</option>'; |
|
43 | + $return .= '<option value="'.$course['id'].'" title="'.htmlspecialchars($course['name'], ENT_QUOTES).'">'.$course['name'].'</option>'; |
|
44 | 44 | } |
45 | 45 | $return .= '</select>'; |
46 | - $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return)); |
|
46 | + $xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return)); |
|
47 | 47 | } |
48 | 48 | $_SESSION['course_list'] = $course_list; |
49 | 49 | return $xajax_response; |
@@ -34,8 +34,8 @@ |
||
34 | 34 | $idUserLocal = api_get_user_id(); |
35 | 35 | $userLocal = api_get_user_info($idUserLocal, true); |
36 | 36 | $htmlHeadXtra[] = '<script type="text/javascript" src="' |
37 | - . api_get_path(WEB_PATH) . 'web/assets/SimpleWebRTC/latest.js' |
|
38 | - . '"></script>' . "\n"; |
|
37 | + . api_get_path(WEB_PATH).'web/assets/SimpleWebRTC/latest.js' |
|
38 | + . '"></script>'."\n"; |
|
39 | 39 | |
40 | 40 | $template = new Template(); |
41 | 41 | $template->assign('room_name', $chatVideo->getRoomName()); |
@@ -6,9 +6,9 @@ |
||
6 | 6 | */ |
7 | 7 | class Rights { |
8 | 8 | private static $rights_cache = array(); |
9 | - private static $rights = array ( |
|
9 | + private static $rights = array( |
|
10 | 10 | 'show_tabs:reports' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'type' => 'const', |
13 | 13 | 'const' => 'true' ) |
14 | 14 | ); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | |
158 | 158 | $new_data_order = array(); |
159 | 159 | if (!empty($docs_to_sort)) { |
160 | - foreach($docs_to_sort as $id => $document) { |
|
160 | + foreach ($docs_to_sort as $id => $document) { |
|
161 | 161 | if (isset($new_data[$id])) { |
162 | 162 | $new_data_order[] = $new_data[$id]; |
163 | 163 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | if (!empty($folder_to_sort)) { |
168 | - foreach($folder_to_sort as $id => $document) { |
|
168 | + foreach ($folder_to_sort as $id => $document) { |
|
169 | 169 | if (isset($new_data[$id])) { |
170 | 170 | $new_data_order[] = $new_data[$id]; |
171 | 171 | } |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | //extra options |
426 | 426 | $plugin_settings = api_get_settings_params( |
427 | 427 | array( |
428 | - "subkey = ? AND category = ? AND type = ? " => array($plugin_name, 'Plugins','setting') |
|
428 | + "subkey = ? AND category = ? AND type = ? " => array($plugin_name, 'Plugins', 'setting') |
|
429 | 429 | ) |
430 | 430 | ); |
431 | 431 | $settings_filtered = array(); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | if (!empty($obj->course_settings)) { |
531 | 531 | if (is_file(api_get_path(SYS_CODE_PATH).'img/icons/'.ICON_SIZE_SMALL.'/'.$plugin_name.'.png')) { |
532 | 532 | $icon = Display::return_icon( |
533 | - $plugin_name . '.png', |
|
533 | + $plugin_name.'.png', |
|
534 | 534 | Security::remove_XSS($pluginTitle), |
535 | 535 | '', |
536 | 536 | ICON_SIZE_SMALL |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | $exemplary_content |
66 | 66 | ) { |
67 | 67 | $wanted_code = trim($wanted_code); |
68 | - $user_id = (int)$user_id; |
|
69 | - $exemplary_content = (bool)$exemplary_content ? 1 : 0; |
|
68 | + $user_id = (int) $user_id; |
|
69 | + $exemplary_content = (bool) $exemplary_content ? 1 : 0; |
|
70 | 70 | |
71 | 71 | if ($wanted_code == '') { |
72 | 72 | return false; |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | $user_id, |
255 | 255 | $exemplary_content |
256 | 256 | ) { |
257 | - $id = (int)$id; |
|
257 | + $id = (int) $id; |
|
258 | 258 | $wanted_code = trim($wanted_code); |
259 | - $user_id = (int)$user_id; |
|
260 | - $exemplary_content = (bool)$exemplary_content ? 1 : 0; |
|
259 | + $user_id = (int) $user_id; |
|
260 | + $exemplary_content = (bool) $exemplary_content ? 1 : 0; |
|
261 | 261 | |
262 | 262 | if ($wanted_code == '') { |
263 | 263 | return false; |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | */ |
361 | 361 | public static function delete_course_request($id) |
362 | 362 | { |
363 | - $id = (int)$id; |
|
363 | + $id = (int) $id; |
|
364 | 364 | $sql = "DELETE FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." |
365 | 365 | WHERE id = ".$id; |
366 | 366 | $result = Database::query($sql); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | if (is_null($status)) { |
378 | 378 | $sql = "SELECT COUNT(id) AS number FROM ".$course_table; |
379 | 379 | } else { |
380 | - $status = (int)$status; |
|
380 | + $status = (int) $status; |
|
381 | 381 | $sql = "SELECT COUNT(id) AS number FROM ".$course_table." |
382 | 382 | WHERE status = ".$status; |
383 | 383 | } |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | */ |
396 | 396 | public static function get_course_request_info($id) |
397 | 397 | { |
398 | - $id = (int)$id; |
|
398 | + $id = (int) $id; |
|
399 | 399 | $sql = "SELECT * |
400 | 400 | FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." |
401 | 401 | WHERE id = ".$id; |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | public static function get_course_request_code($id) |
415 | 415 | { |
416 | - $id = (int)$id; |
|
416 | + $id = (int) $id; |
|
417 | 417 | $sql = "SELECT code |
418 | 418 | FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." |
419 | 419 | WHERE id = ".$id; |
@@ -434,7 +434,7 @@ discard block |
||
434 | 434 | */ |
435 | 435 | public static function accept_course_request($id) |
436 | 436 | { |
437 | - $id = (int)$id; |
|
437 | + $id = (int) $id; |
|
438 | 438 | |
439 | 439 | // Retrieve request's data |
440 | 440 | $course_request_info = self::get_course_request_info($id); |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | return false; |
448 | 448 | }*/ |
449 | 449 | |
450 | - $user_id = (int)$course_request_info['user_id']; |
|
450 | + $user_id = (int) $course_request_info['user_id']; |
|
451 | 451 | if ($user_id <= 0) { |
452 | 452 | return false; |
453 | 453 | } |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | */ |
532 | 532 | public static function reject_course_request($id) |
533 | 533 | { |
534 | - $id = (int)$id; |
|
534 | + $id = (int) $id; |
|
535 | 535 | // Retrieve request's data |
536 | 536 | $course_request_info = self::get_course_request_info($id); |
537 | 537 | if (!is_array($course_request_info)) { |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | */ |
610 | 610 | public static function ask_for_additional_info($id) |
611 | 611 | { |
612 | - $id = (int)$id; |
|
612 | + $id = (int) $id; |
|
613 | 613 | |
614 | 614 | // Retrieve request's data |
615 | 615 | $course_request_info = self::get_course_request_info($id); |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | */ |
701 | 701 | public static function additional_info_asked($id) |
702 | 702 | { |
703 | - $id = (int)$id; |
|
703 | + $id = (int) $id; |
|
704 | 704 | $sql = "SELECT id FROM ".Database :: get_main_table(TABLE_MAIN_COURSE_REQUEST)." |
705 | 705 | WHERE (id = ".$id." AND info > 0)"; |
706 | 706 | $result = Database::num_rows(Database::query($sql)); |
@@ -15,7 +15,7 @@ |
||
15 | 15 | return isset($_REQUEST[$key]) ? $_REQUEST[$key] : $default; |
16 | 16 | } |
17 | 17 | |
18 | - public static function has($key){ |
|
18 | + public static function has($key) { |
|
19 | 19 | return isset($_REQUEST[$key]); |
20 | 20 | } |
21 | 21 |
@@ -44,17 +44,17 @@ |
||
44 | 44 | ORDER BY name, id |
45 | 45 | LIMIT 11'; |
46 | 46 | $rs = Database::query($sql); |
47 | - $i=0; |
|
47 | + $i = 0; |
|
48 | 48 | while ($session = Database :: fetch_array($rs)) { |
49 | 49 | $i++; |
50 | - if ($i<=10) { |
|
50 | + if ($i <= 10) { |
|
51 | 51 | $return .= '<a href="#" onclick="add_user_to_url(\''.addslashes($session['id']).'\',\''.addslashes($session['name']).' ('.addslashes($session['id']).')'.'\')">'.$session['name'].' </a><br />'; |
52 | 52 | } else { |
53 | 53 | $return .= '...<br />'; |
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
57 | - $xajax_response -> addAssign('ajax_list_courses','innerHTML',api_utf8_encode($return)); |
|
57 | + $xajax_response -> addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return)); |
|
58 | 58 | return $xajax_response; |
59 | 59 | } |
60 | 60 | } |
@@ -482,14 +482,14 @@ discard block |
||
482 | 482 | $attributes['z-index'] = 100000; |
483 | 483 | $s = ' '; |
484 | 484 | foreach ($attributes as $key => $value) { |
485 | - $s .= $key . '="' . $value . '" '; |
|
485 | + $s .= $key.'="'.$value.'" '; |
|
486 | 486 | } |
487 | 487 | |
488 | 488 | $result = array(); |
489 | - $result[] = '<span ' . $s . ' >'; |
|
489 | + $result[] = '<span '.$s.' >'; |
|
490 | 490 | $result[] = '<span class="dropdown" >'; |
491 | 491 | $result[] = '<a href="#" data-toggle="dropdown" class="dropdown-toggle">'; |
492 | - $result[] = Display::return_icon('document_send.png', get_lang('Send'), array(), ICON_SIZE_SMALL) . '<b class="caret"></b>'; |
|
492 | + $result[] = Display::return_icon('document_send.png', get_lang('Send'), array(), ICON_SIZE_SMALL).'<b class="caret"></b>'; |
|
493 | 493 | $result[] = '</a>'; |
494 | 494 | $result[] = '<ul class="dropdown-menu">'; |
495 | 495 | |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | $parameters[PortfolioController::PARAM_TOOL] = $tool; |
506 | 506 | $url = api_get_path(WEB_CODE_PATH).'portfolio/share.php?'; |
507 | 507 | $result[] = '<li>'; |
508 | - $result[] = '<a href="' . $url . '">' . $portfolio->get_title() . '</a>'; |
|
508 | + $result[] = '<a href="'.$url.'">'.$portfolio->get_title().'</a>'; |
|
509 | 509 | $result[] = '</li>'; |
510 | 510 | } |
511 | 511 | $result[] = '</ul>'; |
@@ -564,8 +564,8 @@ discard block |
||
564 | 564 | */ |
565 | 565 | public function __construct($portfolio) |
566 | 566 | { |
567 | - $this->name = md5(__CLASS__) . '_' . $portfolio->get_name(); |
|
568 | - $this->title = $portfolio->get_title() ? $portfolio->get_title() : get_lang('SendTo') . ' ' . $portfolio->get_name(); |
|
567 | + $this->name = md5(__CLASS__).'_'.$portfolio->get_name(); |
|
568 | + $this->title = $portfolio->get_title() ? $portfolio->get_title() : get_lang('SendTo').' '.$portfolio->get_name(); |
|
569 | 569 | $this->portfolio = $portfolio; |
570 | 570 | } |
571 | 571 |