@@ -43,7 +43,7 @@ |
||
43 | 43 | public function updateProfileInfo($profileId, $name, $description) |
44 | 44 | { |
45 | 45 | $profileId = intval($profileId); |
46 | - $sql = "UPDATE $this->table SET |
|
46 | + $sql = "update $this->table SET |
|
47 | 47 | name = '$name', |
48 | 48 | description = '$description' |
49 | 49 | WHERE id = $profileId "; |
@@ -365,6 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | /** |
367 | 367 | * Gets an element |
368 | + * @param integer $gradebook_id |
|
368 | 369 | */ |
369 | 370 | public function get_skill_info($skill_id, $gradebook_id) |
370 | 371 | { |
@@ -612,7 +613,7 @@ discard block |
||
612 | 613 | * Gets an element |
613 | 614 | * @param int $id |
614 | 615 | * |
615 | - * @return array|mixed |
|
616 | + * @return integer |
|
616 | 617 | */ |
617 | 618 | public function get($id) |
618 | 619 | { |
@@ -1182,7 +1183,7 @@ discard block |
||
1182 | 1183 | * @param int skill id |
1183 | 1184 | * @param bool return a flat array or not |
1184 | 1185 | * @param int depth of the skills |
1185 | - * @return json |
|
1186 | + * @return string |
|
1186 | 1187 | */ |
1187 | 1188 | public function get_skills_tree_json( |
1188 | 1189 | $user_id = null, |
@@ -1677,8 +1678,8 @@ discard block |
||
1677 | 1678 | } |
1678 | 1679 | |
1679 | 1680 | /** |
1680 | - * @param $currentUserId |
|
1681 | - * @param $studentId |
|
1681 | + * @param integer $currentUserId |
|
1682 | + * @param integer $studentId |
|
1682 | 1683 | * @return bool |
1683 | 1684 | */ |
1684 | 1685 | public static function hasAccessToUserSkill($currentUserId, $studentId) |
@@ -123,7 +123,7 @@ |
||
123 | 123 | |
124 | 124 | if (!isset($_SESSION['login_as'])) { |
125 | 125 | $current_date = api_get_utc_datetime(); |
126 | - $sql = "UPDATE $tbl_track_login SET logout_date='".$current_date."' |
|
126 | + $sql = "update $tbl_track_login SET logout_date='".$current_date."' |
|
127 | 127 | WHERE login_id='$i_id_last_connection'"; |
128 | 128 | Database::query($sql); |
129 | 129 | } |
@@ -295,8 +295,8 @@ |
||
295 | 295 | } |
296 | 296 | } |
297 | 297 | |
298 | - //This query will show all registered users. Only for dev purposes. |
|
299 | - /*$query = "SELECT DISTINCT u.id as login_user_id, login_date |
|
298 | + //This query will show all registered users. Only for dev purposes. |
|
299 | + /*$query = "SELECT DISTINCT u.id as login_user_id, login_date |
|
300 | 300 | FROM $track_online_table e, $table_user u |
301 | 301 | GROUP by u.id |
302 | 302 | ORDER BY $column $direction |
@@ -214,7 +214,8 @@ discard block |
||
214 | 214 | $direction = null, |
215 | 215 | $time_limit = null, |
216 | 216 | $friends = false |
217 | -) { |
|
217 | +) |
|
218 | +{ |
|
218 | 219 | // Time limit in seconds? |
219 | 220 | if (empty($time_limit)) { |
220 | 221 | $time_limit = api_get_setting('time_limit_whosonline'); |
@@ -442,7 +443,8 @@ discard block |
||
442 | 443 | $uid, |
443 | 444 | $time_limit, |
444 | 445 | $coursecode = null |
445 | -) { |
|
446 | +) |
|
447 | +{ |
|
446 | 448 | if (empty($coursecode)) { |
447 | 449 | return false; |
448 | 450 | } |
@@ -2533,7 +2533,7 @@ |
||
2533 | 2533 | </div> |
2534 | 2534 | </div> |
2535 | 2535 | </div> |
2536 | -HTML; |
|
2536 | +html; |
|
2537 | 2537 | } else { |
2538 | 2538 | if (!empty($id)) { |
2539 | 2539 | $params['id'] = $id; |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | ); |
51 | 51 | } |
52 | 52 | |
53 | - /** |
|
54 | - * Displays the page header |
|
55 | - * @param string The name of the page (will be showed in the page title) |
|
56 | - * @param string Optional help file name |
|
57 | - * @param string $page_header |
|
58 | - */ |
|
53 | + /** |
|
54 | + * Displays the page header |
|
55 | + * @param string The name of the page (will be showed in the page title) |
|
56 | + * @param string Optional help file name |
|
57 | + * @param string $page_header |
|
58 | + */ |
|
59 | 59 | public static function display_header( |
60 | 60 | $tool_name = '', |
61 | 61 | $help = null, |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | * @param array additional attributes (for instance height, width, onclick, ...) |
727 | 727 | * @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder) |
728 | 728 | * @return void |
729 | - */ |
|
729 | + */ |
|
730 | 730 | public static function display_icon( |
731 | 731 | $image, |
732 | 732 | $alt_text = '', |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | * @author Julio Montoya 2010 Function improved, adding image constants |
763 | 763 | * @author Yannick Warnier 2011 Added size handler |
764 | 764 | * @version Feb 2011 |
765 | - */ |
|
765 | + */ |
|
766 | 766 | public static function return_icon( |
767 | 767 | $image, |
768 | 768 | $alt_text = '', |
@@ -1073,7 +1073,7 @@ discard block |
||
1073 | 1073 | * in the $htmlHeadXtra variable before the display_header |
1074 | 1074 | * Add this script |
1075 | 1075 | * @example |
1076 | - * <script> |
|
1076 | + * <script> |
|
1077 | 1077 | $(function() { |
1078 | 1078 | $( "#tabs" ).tabs(); |
1079 | 1079 | }); |
@@ -1780,8 +1780,8 @@ discard block |
||
1780 | 1780 | return self::page_header($title, $second_title); |
1781 | 1781 | } |
1782 | 1782 | |
1783 | - public static function page_subheader_and_translate($title, $second_title = null) |
|
1784 | - { |
|
1783 | + public static function page_subheader_and_translate($title, $second_title = null) |
|
1784 | + { |
|
1785 | 1785 | $title = get_lang($title); |
1786 | 1786 | return self::page_subheader($title, $second_title); |
1787 | 1787 | } |
@@ -2593,7 +2593,7 @@ discard block |
||
2593 | 2593 | */ |
2594 | 2594 | public static function dateToStringAgoAndLongDate($dateTime) |
2595 | 2595 | { |
2596 | - if (empty($dateTime) || $dateTime === '0000-00-00 00:00:00') { |
|
2596 | + if (empty($dateTime) || $dateTime === '0000-00-00 00:00:00') { |
|
2597 | 2597 | return ''; |
2598 | 2598 | } |
2599 | 2599 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
36 | - * @return array |
|
36 | + * @return string[] |
|
37 | 37 | */ |
38 | 38 | public static function toolList() |
39 | 39 | { |
@@ -307,7 +307,6 @@ discard block |
||
307 | 307 | * 'page_nr' = The page to display |
308 | 308 | * 'hide_navigation' = true to hide the navigation |
309 | 309 | * @param array $query_vars Additional variables to add in the query-string |
310 | - * @param array $form actions Additional variables to add in the query-string |
|
311 | 310 | * @param mixed An array with bool values to know which columns show. |
312 | 311 | * i.e: $visibility_options= array(true, false) we will only show the first column |
313 | 312 | * Can be also only a bool value. TRUE: show all columns, FALSE: show nothing |
@@ -348,7 +347,6 @@ discard block |
||
348 | 347 | * 'page_nr' = The page to display |
349 | 348 | * 'hide_navigation' = true to hide the navigation |
350 | 349 | * @param array $query_vars Additional variables to add in the query-string |
351 | - * @param array $form actions Additional variables to add in the query-string |
|
352 | 350 | * @param mixed An array with bool values to know which columns show. i.e: |
353 | 351 | * $visibility_options= array(true, false) we will only show the first column |
354 | 352 | * Can be also only a bool value. TRUE: show all columns, FALSE: show nothing |
@@ -403,10 +401,11 @@ discard block |
||
403 | 401 | * 'per_page' = number of items to show per page |
404 | 402 | * 'page_nr' = The page to display |
405 | 403 | * @param array $query_vars Additional variables to add in the query-string |
406 | - * @param array $column_show Array of binaries 1= show columns 0. hide a column |
|
404 | + * @param integer[] $column_show Array of binaries 1= show columns 0. hide a column |
|
407 | 405 | * @param array $column_order An array of integers that let us decide how the columns are going to be sort. |
408 | 406 | * i.e: $column_order=array('1''4','3','4'); The 2nd column will be order like the 4th column |
409 | 407 | * @param array $form_actions Set optional forms actions |
408 | + * @param string $table_name |
|
410 | 409 | * |
411 | 410 | * @author Julio Montoya |
412 | 411 | */ |
@@ -462,7 +461,7 @@ discard block |
||
462 | 461 | * @deprecated Use <code>Display::addFlash(Display::return_message($message, 'normal'));</code> |
463 | 462 | * Or <code>echo Display::return_message($message, 'normal')</code> |
464 | 463 | * |
465 | - * @return void |
|
464 | + * @return string|null |
|
466 | 465 | */ |
467 | 466 | public static function display_normal_message( |
468 | 467 | $message, |
@@ -500,7 +499,7 @@ discard block |
||
500 | 499 | * Displays an confirmation message. Use this if something has been done successfully |
501 | 500 | * @param bool Filter (true) or not (false) |
502 | 501 | * @deprecated use Display::addFlash(Display::return_message($message, 'confirm')); |
503 | - * @return void |
|
502 | + * @return string|null |
|
504 | 503 | */ |
505 | 504 | public static function display_confirmation_message( |
506 | 505 | $message, |
@@ -522,7 +521,7 @@ discard block |
||
522 | 521 | * @param bool Filter (true) or not (false) |
523 | 522 | * @deprecated use Display::addFlash(Display::return_message($message, 'error')); |
524 | 523 | * |
525 | - * @return void |
|
524 | + * @return string|null |
|
526 | 525 | */ |
527 | 526 | public static function display_error_message( |
528 | 527 | $message, |
@@ -725,6 +724,7 @@ discard block |
||
725 | 724 | * @param string The alt text (probably a language variable) |
726 | 725 | * @param array additional attributes (for instance height, width, onclick, ...) |
727 | 726 | * @param integer The wanted width of the icon (to be looked for in the corresponding img/icons/ folder) |
727 | + * @param string $image |
|
728 | 728 | * @return void |
729 | 729 | */ |
730 | 730 | public static function display_icon( |
@@ -976,6 +976,7 @@ discard block |
||
976 | 976 | |
977 | 977 | /** |
978 | 978 | * Displays an HTML input tag |
979 | + * @param string $type |
|
979 | 980 | */ |
980 | 981 | public static function input($type, $name, $value, $attributes = array()) |
981 | 982 | { |
@@ -992,8 +993,8 @@ discard block |
||
992 | 993 | } |
993 | 994 | |
994 | 995 | /** |
995 | - * @param $name |
|
996 | - * @param $value |
|
996 | + * @param string $name |
|
997 | + * @param string $value |
|
997 | 998 | * @param array $attributes |
998 | 999 | * @return string |
999 | 1000 | */ |
@@ -1008,6 +1009,7 @@ discard block |
||
1008 | 1009 | /** |
1009 | 1010 | * Displays an HTML select tag |
1010 | 1011 | * |
1012 | + * @param string $blank_item_text |
|
1011 | 1013 | */ |
1012 | 1014 | public static function select( |
1013 | 1015 | $name, |
@@ -1078,8 +1080,8 @@ discard block |
||
1078 | 1080 | $( "#tabs" ).tabs(); |
1079 | 1081 | }); |
1080 | 1082 | </script> |
1081 | - * @param array $headers list of the tab titles |
|
1082 | - * @param array $items |
|
1083 | + * @param string[] $headers list of the tab titles |
|
1084 | + * @param string[] $items |
|
1083 | 1085 | * @param string $id id of the container of the tab in the example "tabs" |
1084 | 1086 | * @param array $attributes for the ul |
1085 | 1087 | * @param array $ul_attributes |
@@ -1159,7 +1161,7 @@ discard block |
||
1159 | 1161 | |
1160 | 1162 | /** |
1161 | 1163 | * @param $headers |
1162 | - * @param null $selected |
|
1164 | + * @param integer $selected |
|
1163 | 1165 | * |
1164 | 1166 | * @return string |
1165 | 1167 | */ |
@@ -1202,6 +1204,7 @@ discard block |
||
1202 | 1204 | * As you can see both function use the same "my_grid_name" this is very important otherwise nothing will work |
1203 | 1205 | * |
1204 | 1206 | * @param string the div id, this value must be the same with the first parameter of Display::grid_js() |
1207 | + * @param string $div_id |
|
1205 | 1208 | * @return string html |
1206 | 1209 | * |
1207 | 1210 | */ |
@@ -1795,6 +1798,9 @@ discard block |
||
1795 | 1798 | return '<'.$size.'>'.Security::remove_XSS($title).'</'.$size.'>'; |
1796 | 1799 | } |
1797 | 1800 | |
1801 | + /** |
|
1802 | + * @param string $title |
|
1803 | + */ |
|
1798 | 1804 | public static function page_subheader2($title, $second_title = null) |
1799 | 1805 | { |
1800 | 1806 | return self::page_header($title, $second_title, 'h4'); |
@@ -2443,7 +2449,7 @@ discard block |
||
2443 | 2449 | |
2444 | 2450 | /** |
2445 | 2451 | * @param string $id |
2446 | - * @param array $content |
|
2452 | + * @param string[] $content |
|
2447 | 2453 | * @param array $colsWidth Optional. Columns width |
2448 | 2454 | * @return string |
2449 | 2455 | */ |
@@ -2484,7 +2490,7 @@ discard block |
||
2484 | 2490 | /** |
2485 | 2491 | * Get a HTML code for a icon by Font Awesome |
2486 | 2492 | * @param string $name The icon name |
2487 | - * @param int|string $size Optional. The size for the icon. (Example: lg, 2, 3, 4, 5) |
|
2493 | + * @param integer $size Optional. The size for the icon. (Example: lg, 2, 3, 4, 5) |
|
2488 | 2494 | * @param boolean $fixWidth Optional. Whether add the fw class |
2489 | 2495 | * @param string $additionalClass Optional. Additional class |
2490 | 2496 | * |
@@ -2529,10 +2535,10 @@ discard block |
||
2529 | 2535 | /** |
2530 | 2536 | * @param string $title |
2531 | 2537 | * @param string $content |
2532 | - * @param null $id |
|
2538 | + * @param string $id |
|
2533 | 2539 | * @param array $params |
2534 | - * @param null $idAccordion |
|
2535 | - * @param null $idCollapse |
|
2540 | + * @param string $idAccordion |
|
2541 | + * @param string $idCollapse |
|
2536 | 2542 | * @param bool|true $open |
2537 | 2543 | * @param bool|false $fullClickable |
2538 | 2544 | * @return null|string |
@@ -77,7 +77,7 @@ |
||
77 | 77 | $id = Database::insert($table, $params); |
78 | 78 | |
79 | 79 | if ($id > 0) { |
80 | - $sql = "UPDATE $table SET notebook_id = $id WHERE iid = $id"; |
|
80 | + $sql = "update $table SET notebook_id = $id WHERE iid = $id"; |
|
81 | 81 | Database::query($sql); |
82 | 82 | |
83 | 83 | //insert into item_property |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | //Parsing and cleaning the where conditions |
482 | 482 | $whereReturn = self::parse_where_conditions($whereConditions); |
483 | 483 | |
484 | - $sql = "UPDATE $tableName SET $updateSql $whereReturn "; |
|
484 | + $sql = "update $tableName SET $updateSql $whereReturn "; |
|
485 | 485 | |
486 | 486 | $statement = self::getManager()->getConnection()->prepare($sql); |
487 | 487 | |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | } |
532 | 532 | } |
533 | 533 | |
534 | - $sql = "SELECT $clean_columns FROM $table_name $conditions"; |
|
534 | + $sql = "select $clean_columns FROM $table_name $conditions"; |
|
535 | 535 | $result = self::query($sql); |
536 | 536 | $array = array(); |
537 | 537 |
@@ -163,7 +163,7 @@ |
||
163 | 163 | );*/ |
164 | 164 | |
165 | 165 | AnnotationRegistry::registerLoader( |
166 | - function ($class) use ($sysPath) { |
|
166 | + function($class) use ($sysPath) { |
|
167 | 167 | $file = str_replace("\\", DIRECTORY_SEPARATOR, $class).".php"; |
168 | 168 | $file = str_replace('Symfony/Component/Validator', '', $file); |
169 | 169 | $file = str_replace('Symfony\Component\Validator', '', $file); |
@@ -2242,11 +2242,11 @@ |
||
2242 | 2242 | WHERE session_id='$id_session' AND c_id='$enreg_course'"; |
2243 | 2243 | $rs = Database::query($sql_select); |
2244 | 2244 | list($nbr_users) = Database::fetch_array($rs); |
2245 | - $sql_update = "UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users |
|
2245 | + $sql_update = "update $tbl_session_rel_course SET nbr_users=$nbr_users |
|
2246 | 2246 | WHERE session_id='$id_session' AND c_id='$enreg_course'"; |
2247 | 2247 | Database::query($sql_update); |
2248 | 2248 | |
2249 | - $sql_update = "UPDATE $tbl_session SET nbr_users= '$nbr_users' WHERE id='$id_session'"; |
|
2249 | + $sql_update = "update $tbl_session SET nbr_users= '$nbr_users' WHERE id='$id_session'"; |
|
2250 | 2250 | Database::query($sql_update); |
2251 | 2251 | } |
2252 | 2252 |
@@ -2272,6 +2272,7 @@ discard block |
||
2272 | 2272 | |
2273 | 2273 | /** |
2274 | 2274 | * Adds missing user-information (which isn't required, like password, etc). |
2275 | + * @return integer |
|
2275 | 2276 | */ |
2276 | 2277 | function complete_missing_data($user) |
2277 | 2278 | { |
@@ -2872,6 +2873,9 @@ discard block |
||
2872 | 2873 | return $result; |
2873 | 2874 | } |
2874 | 2875 | |
2876 | +/** |
|
2877 | + * @param string|null $end_date |
|
2878 | + */ |
|
2875 | 2879 | function add_day_to($end_date) |
2876 | 2880 | { |
2877 | 2881 | $foo_date = strtotime($end_date); |
@@ -1059,11 +1059,13 @@ discard block |
||
1059 | 1059 | ); |
1060 | 1060 | if ($last_login_date_tmp != false && |
1061 | 1061 | $last_login_date == false |
1062 | - ) { // TODO: To be cleaned |
|
1062 | + ) { |
|
1063 | +// TODO: To be cleaned |
|
1063 | 1064 | $last_login_date = $last_login_date_tmp; |
1064 | 1065 | } elseif ($last_login_date_tmp != false && |
1065 | 1066 | $last_login_date != false |
1066 | - ) { // TODO: Repeated previous condition. To be cleaned. |
|
1067 | + ) { |
|
1068 | +// TODO: Repeated previous condition. To be cleaned. |
|
1067 | 1069 | // Find the max and assign it to first_login_date |
1068 | 1070 | if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
1069 | 1071 | $last_login_date = $last_login_date_tmp; |
@@ -1246,9 +1248,11 @@ discard block |
||
1246 | 1248 | null, |
1247 | 1249 | false |
1248 | 1250 | ); |
1249 | - if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned. |
|
1251 | + if ($last_login_date_tmp != false && $last_login_date == false) { |
|
1252 | +// TODO: To be cleaned. |
|
1250 | 1253 | $last_login_date = $last_login_date_tmp; |
1251 | - } elseif ($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned. |
|
1254 | + } elseif ($last_login_date_tmp != false && $last_login_date == false) { |
|
1255 | +// TODO: Repeated previous condition. To be cleaned. |
|
1252 | 1256 | // Find the max and assign it to first_login_date |
1253 | 1257 | if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
1254 | 1258 | $last_login_date = $last_login_date_tmp; |
@@ -1634,9 +1638,11 @@ discard block |
||
1634 | 1638 | $session_id, |
1635 | 1639 | false |
1636 | 1640 | ); |
1637 | - if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: To be cleaned. |
|
1641 | + if ($last_login_date_tmp != false && $last_login_date == false) { |
|
1642 | +// TODO: To be cleaned. |
|
1638 | 1643 | $last_login_date = $last_login_date_tmp; |
1639 | - } else if ($last_login_date_tmp != false && $last_login_date == false) { // TODO: Repeated previous condition. To be cleaned. |
|
1644 | + } else if ($last_login_date_tmp != false && $last_login_date == false) { |
|
1645 | +// TODO: Repeated previous condition. To be cleaned. |
|
1640 | 1646 | // Find the max and assign it to first_login_date |
1641 | 1647 | if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) { |
1642 | 1648 | $last_login_date = $last_login_date_tmp; |
@@ -1906,7 +1912,9 @@ discard block |
||
1906 | 1912 | FROM $tbl_course course |
1907 | 1913 | WHERE course.code IN (".implode(',', $courses_code).")"; |
1908 | 1914 | |
1909 | - if (!in_array($direction, array('ASC', 'DESC'))) $direction = 'ASC'; |
|
1915 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
1916 | + $direction = 'ASC'; |
|
1917 | + } |
|
1910 | 1918 | |
1911 | 1919 | $column = intval($column); |
1912 | 1920 | $from = intval($from); |
@@ -116,7 +116,7 @@ |
||
116 | 116 | }); |
117 | 117 | }); |
118 | 118 | </script> |
119 | -JS; |
|
119 | +js; |
|
120 | 120 | |
121 | 121 | $this->removeAttribute('formatResult'); |
122 | 122 | $this->removeAttribute('minimumInputLength'); |
@@ -47,6 +47,6 @@ |
||
47 | 47 | }) |
48 | 48 | }); |
49 | 49 | </script> |
50 | -JS; |
|
50 | +js; |
|
51 | 51 | } |
52 | 52 | } |
@@ -936,7 +936,8 @@ |
||
936 | 936 | |
937 | 937 | // HTMLPURIFIER-COMPATIBLE SETTINGS |
938 | 938 | |
939 | -function convert_kses_to_htmlpurifier($allowed_tags) { |
|
939 | +function convert_kses_to_htmlpurifier($allowed_tags) |
|
940 | +{ |
|
940 | 941 | $allowed_html = array(); |
941 | 942 | foreach ($allowed_tags as $key1 => & $value1) { |
942 | 943 | $result[0][] = $key1; |