@@ -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; |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | $course_user_table = Database:: get_main_table(TABLE_MAIN_COURSE_USER); |
105 | 105 | $course_table = Database:: get_main_table(TABLE_MAIN_COURSE); |
106 | 106 | $user_table = Database:: get_main_table(TABLE_MAIN_USER); |
107 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
107 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
108 | 108 | $current_url_id = api_get_current_access_url_id(); |
109 | - $active_filter = $onlyActive?' AND active=1':''; |
|
110 | - $status_filter = isset($status)?' AND status = '.intval($status):''; |
|
109 | + $active_filter = $onlyActive ? ' AND active=1' : ''; |
|
110 | + $status_filter = isset($status) ? ' AND status = '.intval($status) : ''; |
|
111 | 111 | |
112 | 112 | if (api_is_multiple_url_enabled()) { |
113 | 113 | $sql = "SELECT COUNT(DISTINCT(u.user_id)) AS number |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | FROM $user_table |
132 | 132 | WHERE 1=1 $status_filter $active_filter"; |
133 | 133 | if (isset ($categoryCode)) { |
134 | - $status_filter = isset($status)?' AND status = '.intval($status):''; |
|
134 | + $status_filter = isset($status) ? ' AND status = '.intval($status) : ''; |
|
135 | 135 | $sql = "SELECT COUNT(DISTINCT(cu.user_id)) AS number |
136 | 136 | FROM $course_user_table cu, $course_table c |
137 | 137 | WHERE |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | public static function countSessions() |
157 | 157 | { |
158 | 158 | $session_table = Database :: get_main_table(TABLE_MAIN_SESSION); |
159 | - $access_url_rel_session_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
159 | + $access_url_rel_session_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
160 | 160 | if (api_is_multiple_url_enabled()) { |
161 | 161 | $current_url_id = api_get_current_access_url_id(); |
162 | 162 | $sql = "SELECT COUNT(id) AS number |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | public static function getNumberOfActivities() |
180 | 180 | { |
181 | 181 | // Database table definitions |
182 | - $track_e_default = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT); |
|
182 | + $track_e_default = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT); |
|
183 | 183 | $table_user = Database::get_main_table(TABLE_MAIN_USER); |
184 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
184 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
185 | 185 | $current_url_id = api_get_current_access_url_id(); |
186 | 186 | if (api_is_multiple_url_enabled()) { |
187 | 187 | $sql = "SELECT count(default_id) AS total_number_of_items |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $from = intval($from); |
226 | 226 | $numberOfItems = intval($numberOfItems); |
227 | 227 | |
228 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
228 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
229 | 229 | $direction = 'DESC'; |
230 | 230 | } |
231 | 231 | |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $sql .= " LIMIT $from,$numberOfItems "; |
277 | 277 | |
278 | 278 | $res = Database::query($sql); |
279 | - $activities = array (); |
|
279 | + $activities = array(); |
|
280 | 280 | while ($row = Database::fetch_row($res)) { |
281 | 281 | |
282 | 282 | if (strpos($row[1], '_object') === false && strpos($row[1], '_array') === false) { |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | $sql = "SELECT code, name FROM $categoryTable |
344 | 344 | ORDER BY tree_pos"; |
345 | 345 | $res = Database::query($sql); |
346 | - $categories = array (); |
|
346 | + $categories = array(); |
|
347 | 347 | while ($category = Database::fetch_object($res)) { |
348 | 348 | $categories[$category->code] = $category->name; |
349 | 349 | } |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | $data_max = ($data_max < $value ? $value : $data_max); |
365 | 365 | } |
366 | 366 | reset($data); |
367 | - $result = array (); |
|
367 | + $result = array(); |
|
368 | 368 | $delta = $max / $data_max; |
369 | 369 | foreach ($data as $index => $value) { |
370 | 370 | $result[$index] = (int) round($value * $delta); |
@@ -398,9 +398,9 @@ discard block |
||
398 | 398 | } else { |
399 | 399 | $number_label = Statistics::makeSizeString($number); |
400 | 400 | } |
401 | - $percentage = ($total>0?number_format(100*$number/$total, 1, ',', '.'):'0'); |
|
401 | + $percentage = ($total > 0 ? number_format(100 * $number / $total, 1, ',', '.') : '0'); |
|
402 | 402 | |
403 | - echo '<tr class="row_'.($i%2 == 0 ? 'odd' : 'even').'"> |
|
403 | + echo '<tr class="row_'.($i % 2 == 0 ? 'odd' : 'even').'"> |
|
404 | 404 | <td width="150">'.$subtitle.'</td> |
405 | 405 | <td width="550">'.Display::bar_progress($percentage, false).'</td> |
406 | 406 | <td align="right">'.$number_label.'</td>'; |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | echo '<td align="right"> '.$percentage.'%</td>'; |
409 | 409 | } |
410 | 410 | echo '</tr>'; |
411 | - $i ++; |
|
411 | + $i++; |
|
412 | 412 | } |
413 | 413 | if ($showTotal) { |
414 | 414 | if (!$isFileSize) { |
@@ -428,17 +428,17 @@ discard block |
||
428 | 428 | public static function printLoginStats($type) |
429 | 429 | { |
430 | 430 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
431 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
431 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
432 | 432 | $current_url_id = api_get_current_access_url_id(); |
433 | 433 | |
434 | 434 | $table_url = null; |
435 | 435 | $where_url = null; |
436 | 436 | $now = api_get_utc_datetime(); |
437 | - $where_url_last = ' WHERE login_date > DATE_SUB("' . $now . '",INTERVAL 1 %s)'; |
|
437 | + $where_url_last = ' WHERE login_date > DATE_SUB("'.$now.'",INTERVAL 1 %s)'; |
|
438 | 438 | if (api_is_multiple_url_enabled()) { |
439 | 439 | $table_url = ", $access_url_rel_user_table"; |
440 | 440 | $where_url = " WHERE login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
441 | - $where_url_last = ' AND login_date > DATE_SUB("' . $now . '",INTERVAL 1 %s)'; |
|
441 | + $where_url_last = ' AND login_date > DATE_SUB("'.$now.'",INTERVAL 1 %s)'; |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | $period = get_lang('PeriodMonth'); |
@@ -453,13 +453,13 @@ discard block |
||
453 | 453 | case 'hour': |
454 | 454 | $period = get_lang('PeriodHour'); |
455 | 455 | $sql = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table.$table_url.$where_url." GROUP BY stat_date ORDER BY stat_date "; |
456 | - $sql_last_x = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table.$table_url.$where_url.sprintf($where_url_last,'DAY')." GROUP BY stat_date ORDER BY stat_date "; |
|
456 | + $sql_last_x = "SELECT DATE_FORMAT( login_date, '%H' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table.$table_url.$where_url.sprintf($where_url_last, 'DAY')." GROUP BY stat_date ORDER BY stat_date "; |
|
457 | 457 | break; |
458 | 458 | case 'day': |
459 | 459 | $periodCollection = api_get_week_days_long(); |
460 | 460 | $period = get_lang('PeriodDay'); |
461 | 461 | $sql = "SELECT DATE_FORMAT( login_date, '%w' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table.$table_url.$where_url." GROUP BY stat_date ORDER BY DATE_FORMAT( login_date, '%w' ) "; |
462 | - $sql_last_x = "SELECT DATE_FORMAT( login_date, '%w' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table.$table_url.$where_url.sprintf($where_url_last,'WEEK')." GROUP BY stat_date ORDER BY DATE_FORMAT( login_date, '%w' ) "; |
|
462 | + $sql_last_x = "SELECT DATE_FORMAT( login_date, '%w' ) AS stat_date , count( login_id ) AS number_of_logins FROM ".$table.$table_url.$where_url.sprintf($where_url_last, 'WEEK')." GROUP BY stat_date ORDER BY DATE_FORMAT( login_date, '%w' ) "; |
|
463 | 463 | break; |
464 | 464 | } |
465 | 465 | if ($sql_last_x) { |
@@ -501,14 +501,14 @@ discard block |
||
501 | 501 | { |
502 | 502 | $totalLogin = array(); |
503 | 503 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
504 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
504 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
505 | 505 | $current_url_id = api_get_current_access_url_id(); |
506 | 506 | if (api_is_multiple_url_enabled()) { |
507 | 507 | $table_url = ", $access_url_rel_user_table"; |
508 | 508 | $where_url = " AND login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
509 | 509 | } else { |
510 | 510 | $table_url = ''; |
511 | - $where_url=''; |
|
511 | + $where_url = ''; |
|
512 | 512 | } |
513 | 513 | $now = api_get_utc_datetime(); |
514 | 514 | $field = 'login_user_id'; |
@@ -540,14 +540,14 @@ discard block |
||
540 | 540 | { |
541 | 541 | $totalLogin = []; |
542 | 542 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
543 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
543 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
544 | 544 | $current_url_id = api_get_current_access_url_id(); |
545 | 545 | if (api_is_multiple_url_enabled()) { |
546 | 546 | $table_url = ", $access_url_rel_user_table"; |
547 | 547 | $where_url = " AND login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
548 | 548 | } else { |
549 | 549 | $table_url = ''; |
550 | - $where_url=''; |
|
550 | + $where_url = ''; |
|
551 | 551 | } |
552 | 552 | $now = api_get_utc_datetime(); |
553 | 553 | $field = 'login_user_id'; |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | $sql = "SELECT count($field) AS number, date(login_date) as login_date FROM $table $table_url WHERE DATE_ADD(login_date, INTERVAL 15 DAY) >= '$now' $where_url GROUP BY date(login_date)"; |
558 | 558 | |
559 | 559 | $res = Database::query($sql); |
560 | - while($row = Database::fetch_array($res,'ASSOC')){ |
|
560 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
561 | 561 | $totalLogin[$row['login_date']] = $row['number']; |
562 | 562 | } |
563 | 563 | |
@@ -652,13 +652,13 @@ discard block |
||
652 | 652 | public static function printUserPicturesStats() |
653 | 653 | { |
654 | 654 | $user_table = Database :: get_main_table(TABLE_MAIN_USER); |
655 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
655 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
656 | 656 | $current_url_id = api_get_current_access_url_id(); |
657 | 657 | $url_condition = null; |
658 | 658 | $url_condition2 = null; |
659 | 659 | $table = null; |
660 | 660 | if (api_is_multiple_url_enabled()) { |
661 | - $url_condition = ", $access_url_rel_user_table as url WHERE url.user_id=u.user_id AND access_url_id='".$current_url_id."'"; |
|
661 | + $url_condition = ", $access_url_rel_user_table as url WHERE url.user_id=u.user_id AND access_url_id='".$current_url_id."'"; |
|
662 | 662 | $url_condition2 = " AND url.user_id=u.user_id AND access_url_id='".$current_url_id."'"; |
663 | 663 | $table = ", $access_url_rel_user_table as url "; |
664 | 664 | } |
@@ -690,7 +690,7 @@ discard block |
||
690 | 690 | 'width=200px', |
691 | 691 | false |
692 | 692 | ); |
693 | - $renderer =& $form->defaultRenderer(); |
|
693 | + $renderer = & $form->defaultRenderer(); |
|
694 | 694 | $renderer->setCustomElementTemplate('<span>{element}</span> '); |
695 | 695 | $form->addElement('hidden', 'report', 'activities'); |
696 | 696 | $form->addElement('hidden', 'activities_direction', 'DESC'); |
@@ -740,10 +740,10 @@ discard block |
||
740 | 740 | $columns[1] = 'access_date'; |
741 | 741 | $sql_order[SORT_ASC] = 'ASC'; |
742 | 742 | $sql_order[SORT_DESC] = 'DESC'; |
743 | - $per_page = isset($_GET['per_page'])?intval($_GET['per_page']) : 10; |
|
744 | - $page_nr = isset($_GET['page_nr'])?intval($_GET['page_nr']) : 1; |
|
745 | - $column = isset($_GET['column'])?intval($_GET['column']) : 0; |
|
746 | - $date_diff = isset($_GET['date_diff'])?intval($_GET['date_diff']) : 60; |
|
743 | + $per_page = isset($_GET['per_page']) ? intval($_GET['per_page']) : 10; |
|
744 | + $page_nr = isset($_GET['page_nr']) ? intval($_GET['page_nr']) : 1; |
|
745 | + $column = isset($_GET['column']) ? intval($_GET['column']) : 0; |
|
746 | + $date_diff = isset($_GET['date_diff']) ? intval($_GET['date_diff']) : 60; |
|
747 | 747 | |
748 | 748 | $direction = isset($_GET['direction']) ? $_GET['direction'] : SORT_ASC; |
749 | 749 | |
@@ -772,25 +772,25 @@ discard block |
||
772 | 772 | access_url_id='".$current_url_id."' |
773 | 773 | GROUP BY c_id |
774 | 774 | HAVING c_id <> '' |
775 | - AND DATEDIFF( '".date('Y-m-d h:i:s')."' , access_date ) <= ". $date_diff; |
|
775 | + AND DATEDIFF( '".date('Y-m-d h:i:s')."' , access_date ) <= ".$date_diff; |
|
776 | 776 | } else { |
777 | 777 | $sql = "SELECT * FROM $table |
778 | 778 | GROUP BY c_id |
779 | 779 | HAVING c_id <> '' |
780 | - AND DATEDIFF( '".date('Y-m-d h:i:s')."' , access_date ) <= ". $date_diff; |
|
780 | + AND DATEDIFF( '".date('Y-m-d h:i:s')."' , access_date ) <= ".$date_diff; |
|
781 | 781 | } |
782 | 782 | $sql .= ' ORDER BY '.$columns[$column].' '.$sql_order[$direction]; |
783 | - $from = ($page_nr -1) * $per_page; |
|
783 | + $from = ($page_nr - 1) * $per_page; |
|
784 | 784 | $sql .= ' LIMIT '.$from.','.$per_page; |
785 | 785 | |
786 | 786 | echo '<p>'.get_lang('LastAccess').' >= '.$date_diff.' '.get_lang('Days').'</p>'; |
787 | 787 | $res = Database::query($sql); |
788 | 788 | if (Database::num_rows($res) > 0) { |
789 | - $courses = array (); |
|
789 | + $courses = array(); |
|
790 | 790 | while ($obj = Database::fetch_object($res)) { |
791 | 791 | $courseInfo = api_get_course_info_by_id($obj->c_id); |
792 | - $course = array (); |
|
793 | - $course[]= '<a href="'.api_get_path(WEB_COURSE_PATH).$courseInfo['code'].'">'.$courseInfo['code'].' <a>'; |
|
792 | + $course = array(); |
|
793 | + $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$courseInfo['code'].'">'.$courseInfo['code'].' <a>'; |
|
794 | 794 | // Allow sort by date hiding the numerical date |
795 | 795 | $course[] = '<span style="display:none;">'.$obj->access_date.'</span>'.api_convert_and_format_date($obj->access_date); |
796 | 796 | $courses[] = $course; |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | { |
864 | 864 | $user_friend_table = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
865 | 865 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
866 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
866 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
867 | 867 | $current_url_id = api_get_current_access_url_id(); |
868 | 868 | |
869 | 869 | if (api_is_multiple_url_enabled()) { |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | { |
896 | 896 | $totalLogin = array(); |
897 | 897 | $table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN); |
898 | - $access_url_rel_user_table= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
898 | + $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
899 | 899 | $current_url_id = api_get_current_access_url_id(); |
900 | 900 | $total = self::countUsers(); |
901 | 901 | if (api_is_multiple_url_enabled()) { |
@@ -903,14 +903,14 @@ discard block |
||
903 | 903 | $where_url = " AND login_user_id=user_id AND access_url_id='".$current_url_id."'"; |
904 | 904 | } else { |
905 | 905 | $table_url = ''; |
906 | - $where_url=''; |
|
906 | + $where_url = ''; |
|
907 | 907 | } |
908 | 908 | $now = api_get_utc_datetime(); |
909 | - $sql[get_lang('ThisDay')] = |
|
909 | + $sql[get_lang('ThisDay')] = |
|
910 | 910 | "SELECT count(distinct(login_user_id)) AS number ". |
911 | 911 | " FROM $table $table_url ". |
912 | 912 | " WHERE DATE_ADD(login_date, INTERVAL 1 DAY) >= '$now' $where_url"; |
913 | - $sql[get_lang('Last7days')] = |
|
913 | + $sql[get_lang('Last7days')] = |
|
914 | 914 | "SELECT count(distinct(login_user_id)) AS number ". |
915 | 915 | " FROM $table $table_url ". |
916 | 916 | " WHERE DATE_ADD(login_date, INTERVAL 7 DAY) >= '$now' $where_url"; |
@@ -922,7 +922,7 @@ discard block |
||
922 | 922 | "SELECT count(distinct(login_user_id)) AS number ". |
923 | 923 | " FROM $table $table_url ". |
924 | 924 | " WHERE DATE_ADD(login_date, INTERVAL 6 MONTH) >= '$now' $where_url"; |
925 | - $sql[get_lang('NeverConnected')] = |
|
925 | + $sql[get_lang('NeverConnected')] = |
|
926 | 926 | "SELECT count(distinct(login_user_id)) AS number ". |
927 | 927 | " FROM $table $table_url WHERE 1=1 $where_url"; |
928 | 928 | foreach ($sql as $index => $query) { |
@@ -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 | } |