@@ -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 |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $_user['status'] = $uData['status']; |
131 | 131 | Session::write('_user', $_user); |
132 | 132 | Session::erase('conditional_login'); |
133 | - $uidReset=true; |
|
133 | + $uidReset = true; |
|
134 | 134 | Event::event_login($_user['user_id']); |
135 | 135 | } |
136 | 136 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | //is necessary verify check |
214 | 214 | if ($legal_type == 1) { |
215 | - if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) { |
|
215 | + if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) { |
|
216 | 216 | $legal_option = true; |
217 | 217 | } else { |
218 | 218 | $legal_option = false; |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | |
222 | 222 | //no is check option |
223 | 223 | if ($legal_type == 0) { |
224 | - $legal_option=true; |
|
224 | + $legal_option = true; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | if (isset($_POST['legal_accept_type']) && $legal_option === true) { |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | * Process external authentication |
515 | 515 | * on the basis of the given login name |
516 | 516 | */ |
517 | - $loginFailed = true; // Default initialisation. It could |
|
517 | + $loginFailed = true; // Default initialisation. It could |
|
518 | 518 | // change after the external authentication |
519 | 519 | $key = $uData['auth_source']; //'ldap','shibboleth'... |
520 | 520 | /* >>>>>>>> External authentication modules <<<<<<<<< */ |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | } |
534 | 534 | } else { |
535 | 535 | // login failed, Database::num_rows($result) <= 0 |
536 | - $loginFailed = true; // Default initialisation. It could |
|
536 | + $loginFailed = true; // Default initialisation. It could |
|
537 | 537 | // change after the external authentication |
538 | 538 | |
539 | 539 | /* |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | include_once($thisAuthSource['newUser']); |
560 | 560 | } else { |
561 | 561 | error_log( |
562 | - 'Chamilo Authentication file '. $thisAuthSource['newUser']. |
|
562 | + 'Chamilo Authentication file '.$thisAuthSource['newUser']. |
|
563 | 563 | ' could not be found - this might prevent your system from using'. |
564 | 564 | ' the authentication process in the user creation process', |
565 | 565 | 0 |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | online_logout(null, false); |
669 | 669 | $osso->logout(); //redirects and exits |
670 | 670 | } |
671 | - } elseif (api_get_setting('openid_authentication')=='true') { |
|
671 | + } elseif (api_get_setting('openid_authentication') == 'true') { |
|
672 | 672 | if (!empty($_POST['openid_url'])) { |
673 | 673 | include api_get_path(SYS_CODE_PATH).'auth/openid/login.php'; |
674 | 674 | openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php'); |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | if ($res['status'] == 'success') { |
682 | 682 | $id1 = Database::escape_string($res['openid.identity']); |
683 | 683 | //have another id with or without the final '/' |
684 | - $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/'); |
|
684 | + $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/'); |
|
685 | 685 | //lookup the user in the main database |
686 | 686 | $user_table = Database::get_main_table(TABLE_MAIN_USER); |
687 | 687 | $sql = "SELECT user_id, username, password, auth_source, active, expiration_date |
@@ -690,14 +690,14 @@ discard block |
||
690 | 690 | OR openid = '$id2' "; |
691 | 691 | $result = Database::query($sql); |
692 | 692 | if ($result !== false) { |
693 | - if (Database::num_rows($result)>0) { |
|
693 | + if (Database::num_rows($result) > 0) { |
|
694 | 694 | $uData = Database::fetch_array($result); |
695 | 695 | |
696 | 696 | if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) { |
697 | 697 | //the authentification of this user is managed by Chamilo itself |
698 | 698 | |
699 | 699 | // check if the account is active (not locked) |
700 | - if ($uData['active']=='1') { |
|
700 | + if ($uData['active'] == '1') { |
|
701 | 701 | // check if the expiration date has not been reached |
702 | 702 | if ($uData['expiration_date'] > date('Y-m-d H:i:s') |
703 | 703 | || empty($uData['expiration_date']) |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid'])) |
776 | 776 | ) { |
777 | 777 | $cidReset = true; |
778 | - $gidReset = true; // As groups depend from courses, group id is reset |
|
778 | + $gidReset = true; // As groups depend from courses, group id is reset |
|
779 | 779 | } |
780 | 780 | |
781 | 781 | /* USER INIT */ |
@@ -925,8 +925,8 @@ discard block |
||
925 | 925 | $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
926 | 926 | |
927 | 927 | if (!empty($_GET['id_session'])) { |
928 | - $sql = 'SELECT name FROM '.$tbl_session . ' |
|
929 | - WHERE id="'.intval($_GET['id_session']) . '"'; |
|
928 | + $sql = 'SELECT name FROM '.$tbl_session.' |
|
929 | + WHERE id="'.intval($_GET['id_session']).'"'; |
|
930 | 930 | $rs = Database::query($sql); |
931 | 931 | if (Database::num_rows($rs)) { |
932 | 932 | list($_SESSION['session_name']) = Database::fetch_array( |
@@ -1016,7 +1016,7 @@ discard block |
||
1016 | 1016 | // Moreover, if we want to track a course with another session it can be usefull |
1017 | 1017 | if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) { |
1018 | 1018 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
1019 | - $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"'; |
|
1019 | + $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"'; |
|
1020 | 1020 | $rs = Database::query($sql); |
1021 | 1021 | if (Database::num_rows($rs)) { |
1022 | 1022 | list($_SESSION['session_name']) = Database::fetch_array($rs); |
@@ -1097,8 +1097,8 @@ discard block |
||
1097 | 1097 | if (Database::num_rows($result) > 0) { // this user have a recorded state for this course |
1098 | 1098 | $cuData = Database::fetch_array($result, 'ASSOC'); |
1099 | 1099 | |
1100 | - $is_courseAdmin = (bool)($cuData['status'] == 1); |
|
1101 | - $is_courseTutor = (bool)($cuData['is_tutor'] == 1); |
|
1100 | + $is_courseAdmin = (bool) ($cuData['status'] == 1); |
|
1101 | + $is_courseTutor = (bool) ($cuData['is_tutor'] == 1); |
|
1102 | 1102 | $is_courseMember = true; |
1103 | 1103 | } |
1104 | 1104 | |
@@ -1109,7 +1109,7 @@ discard block |
||
1109 | 1109 | // This user has no status related to this course |
1110 | 1110 | // The user is subscribed in a session? The user is a Session coach a Session admin ? |
1111 | 1111 | |
1112 | - $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
1112 | + $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
1113 | 1113 | $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); |
1114 | 1114 | $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
1115 | 1115 | |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | |
1223 | 1223 | //If I'm the admin platform i'm a teacher of the course |
1224 | 1224 | if ($is_platformAdmin) { |
1225 | - $is_courseAdmin = true; |
|
1225 | + $is_courseAdmin = true; |
|
1226 | 1226 | } |
1227 | 1227 | } |
1228 | 1228 | } else { // keys missing => not anymore in the course - user relation |
@@ -1380,12 +1380,12 @@ discard block |
||
1380 | 1380 | ($logging_in && exist_firstpage_parameter()) |
1381 | 1381 | ) { |
1382 | 1382 | $redirectCourseDir = api_get_firstpage_parameter(); |
1383 | - api_delete_firstpage_parameter(); // delete the cookie |
|
1383 | + api_delete_firstpage_parameter(); // delete the cookie |
|
1384 | 1384 | |
1385 | 1385 | if (!isset($_SESSION['request_uri'])) { |
1386 | 1386 | if (CourseManager::get_course_id_from_path($redirectCourseDir)) { |
1387 | 1387 | $_SESSION['noredirection'] = false; |
1388 | - $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/'; |
|
1388 | + $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/'; |
|
1389 | 1389 | } |
1390 | 1390 | } |
1391 | 1391 | } elseif (api_user_is_login() && exist_firstpage_parameter()) { |
@@ -1393,7 +1393,7 @@ discard block |
||
1393 | 1393 | api_delete_firstpage_parameter(); // delete the cookie |
1394 | 1394 | if (CourseManager::get_course_id_from_path($redirectCourseDir)) { |
1395 | 1395 | $_SESSION['noredirection'] = false; |
1396 | - $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/'; |
|
1396 | + $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/'; |
|
1397 | 1397 | } |
1398 | 1398 | } |
1399 | 1399 |
@@ -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 |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | self::navigate($url); |
35 | 35 | } |
36 | 36 | |
37 | - $url = self::www() . $url; |
|
37 | + $url = self::www().$url; |
|
38 | 38 | self::navigate($url); |
39 | 39 | } |
40 | 40 | |
@@ -67,25 +67,25 @@ discard block |
||
67 | 67 | case COURSEMANAGER: |
68 | 68 | $redir = api_get_setting('teacher_page_after_login'); |
69 | 69 | if (!empty($redir)) { |
70 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
70 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
71 | 71 | } |
72 | 72 | break; |
73 | 73 | case STUDENT: |
74 | 74 | $redir = api_get_setting('student_page_after_login'); |
75 | 75 | if (!empty($redir)) { |
76 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
76 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
77 | 77 | } |
78 | 78 | break; |
79 | 79 | case DRH: |
80 | 80 | $redir = api_get_setting('drh_page_after_login'); |
81 | 81 | if (!empty($redir)) { |
82 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
82 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
83 | 83 | } |
84 | 84 | break; |
85 | 85 | case SESSIONADMIN: |
86 | 86 | $redir = api_get_setting('sessionadmin_page_after_login'); |
87 | 87 | if (!empty($redir)) { |
88 | - self::navigate(api_get_path(WEB_PATH) . $redir); |
|
88 | + self::navigate(api_get_path(WEB_PATH).$redir); |
|
89 | 89 | } |
90 | 90 | break; |
91 | 91 | default: |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | } |
112 | 112 | $page_after_login = api_get_setting('page_after_login'); |
113 | 113 | if (!empty($page_after_login)) { |
114 | - self::navigate(api_get_path(WEB_PATH) . $page_after_login); |
|
114 | + self::navigate(api_get_path(WEB_PATH).$page_after_login); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | $c_id = $c_id ? intval($c_id) : api_get_course_int_id(); |
59 | - $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
59 | + $table = Database::get_course_table(TABLE_TOOL_LIST); |
|
60 | 60 | $sql = "SELECT * from $table |
61 | 61 | WHERE c_id = $c_id and name='$name' |
62 | 62 | LIMIT 1"; |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $clean_gradebook = array(); |
114 | 114 | |
115 | 115 | if (!empty($skill_gradebooks_source)) { |
116 | - foreach($skill_gradebooks_source as $source) { |
|
116 | + foreach ($skill_gradebooks_source as $source) { |
|
117 | 117 | $clean_gradebook[] = $source['skill_id']; |
118 | 118 | } |
119 | 119 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $selected_skills = self::get_skills_by_gradebook($gradebook_id); |
193 | 193 | $clean_selected_skills = array(); |
194 | 194 | if (!empty($selected_skills)) { |
195 | - foreach($selected_skills as $skill) { |
|
195 | + foreach ($selected_skills as $skill) { |
|
196 | 196 | $clean_selected_skills[] = $skill['id']; |
197 | 197 | } |
198 | 198 | } |
@@ -73,7 +73,7 @@ |
||
73 | 73 | * @todo the form should be auto generated |
74 | 74 | * @param string url |
75 | 75 | * @param string action add, edit |
76 | - * @return obj form validator obj |
|
76 | + * @return FormValidator form validator obj |
|
77 | 77 | */ |
78 | 78 | public function return_form($url, $action) |
79 | 79 | { |
@@ -115,8 +115,7 @@ discard block |
||
115 | 115 | */ |
116 | 116 | public static function getUTCDateTimeTypeClass() |
117 | 117 | { |
118 | - return isset(self::$utcDateTimeClass) ? self::$utcDateTimeClass : |
|
119 | - 'Application\DoctrineExtensions\DBAL\Types\UTCDateTimeType'; |
|
118 | + return isset(self::$utcDateTimeClass) ? self::$utcDateTimeClass : 'Application\DoctrineExtensions\DBAL\Types\UTCDateTimeType'; |
|
120 | 119 | } |
121 | 120 | |
122 | 121 | /** |
@@ -393,7 +392,7 @@ discard block |
||
393 | 392 | |
394 | 393 | if (!empty($params)) { |
395 | 394 | $sql = 'INSERT INTO '.$table_name.' ('.implode(',', $params).') |
396 | - VALUES (:'.implode(', :' ,$params).')'; |
|
395 | + VALUES (:'.implode(', :', $params).')'; |
|
397 | 396 | |
398 | 397 | $statement = self::getManager()->getConnection()->prepare($sql); |
399 | 398 | $result = $statement->execute($attributes); |
@@ -434,7 +433,7 @@ discard block |
||
434 | 433 | foreach ($attributes as $key => $value) { |
435 | 434 | $update_sql .= "$key = :$key "; |
436 | 435 | if ($count < count($attributes)) { |
437 | - $update_sql.=', '; |
|
436 | + $update_sql .= ', '; |
|
438 | 437 | } |
439 | 438 | $count++; |
440 | 439 | } |
@@ -481,7 +480,7 @@ discard block |
||
481 | 480 | if ($columns == '*') { |
482 | 481 | $clean_columns = '*'; |
483 | 482 | } else { |
484 | - $clean_columns = (string)$columns; |
|
483 | + $clean_columns = (string) $columns; |
|
485 | 484 | } |
486 | 485 | } |
487 | 486 | |
@@ -527,9 +526,9 @@ discard block |
||
527 | 526 | foreach ($condition_data as $condition => $value_array) { |
528 | 527 | if (is_array($value_array)) { |
529 | 528 | $clean_values = array(); |
530 | - foreach($value_array as $item) { |
|
529 | + foreach ($value_array as $item) { |
|
531 | 530 | $item = Database::escape_string($item); |
532 | - $clean_values[]= $item; |
|
531 | + $clean_values[] = $item; |
|
533 | 532 | } |
534 | 533 | } else { |
535 | 534 | $value_array = Database::escape_string($value_array); |
@@ -537,23 +536,23 @@ discard block |
||
537 | 536 | } |
538 | 537 | |
539 | 538 | if (!empty($condition) && $clean_values != '') { |
540 | - $condition = str_replace('%',"'@percentage@'", $condition); //replace "%" |
|
541 | - $condition = str_replace("'?'","%s", $condition); |
|
542 | - $condition = str_replace("?","%s", $condition); |
|
539 | + $condition = str_replace('%', "'@percentage@'", $condition); //replace "%" |
|
540 | + $condition = str_replace("'?'", "%s", $condition); |
|
541 | + $condition = str_replace("?", "%s", $condition); |
|
543 | 542 | |
544 | - $condition = str_replace("@%s@","@-@", $condition); |
|
545 | - $condition = str_replace("%s","'%s'", $condition); |
|
546 | - $condition = str_replace("@-@","@%s@", $condition); |
|
543 | + $condition = str_replace("@%s@", "@-@", $condition); |
|
544 | + $condition = str_replace("%s", "'%s'", $condition); |
|
545 | + $condition = str_replace("@-@", "@%s@", $condition); |
|
547 | 546 | |
548 | 547 | // Treat conditions as string |
549 | 548 | $condition = vsprintf($condition, $clean_values); |
550 | - $condition = str_replace('@percentage@','%', $condition); //replace "%" |
|
549 | + $condition = str_replace('@percentage@', '%', $condition); //replace "%" |
|
551 | 550 | $where_return .= $condition; |
552 | 551 | } |
553 | 552 | } |
554 | 553 | |
555 | 554 | if (!empty($where_return)) { |
556 | - $return_value = " WHERE $where_return" ; |
|
555 | + $return_value = " WHERE $where_return"; |
|
557 | 556 | } |
558 | 557 | break; |
559 | 558 | case 'order': |
@@ -565,7 +564,7 @@ discard block |
||
565 | 564 | $new_order_array = explode(',', $order_array); |
566 | 565 | $temp_value = array(); |
567 | 566 | |
568 | - foreach($new_order_array as $element) { |
|
567 | + foreach ($new_order_array as $element) { |
|
569 | 568 | $element = explode(' ', $element); |
570 | 569 | $element = array_filter($element); |
571 | 570 | $element = array_values($element); |
@@ -576,10 +575,10 @@ discard block |
||
576 | 575 | if (in_array($element[1], array('desc', 'asc'))) { |
577 | 576 | $order = $element[1]; |
578 | 577 | } |
579 | - $temp_value[]= $element[0].' '.$order.' '; |
|
578 | + $temp_value[] = $element[0].' '.$order.' '; |
|
580 | 579 | } else { |
581 | 580 | //by default DESC |
582 | - $temp_value[]= $element[0].' DESC '; |
|
581 | + $temp_value[] = $element[0].' DESC '; |
|
583 | 582 | } |
584 | 583 | } |
585 | 584 | if (!empty($temp_value)) { |
@@ -594,7 +593,7 @@ discard block |
||
594 | 593 | if (!empty($limit_array)) { |
595 | 594 | if (count($limit_array) > 1) { |
596 | 595 | $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]); |
597 | - } else { |
|
596 | + } else { |
|
598 | 597 | $return_value .= ' LIMIT '.intval($limit_array[0]); |
599 | 598 | } |
600 | 599 | } |
@@ -594,7 +594,7 @@ |
||
594 | 594 | if (!empty($limit_array)) { |
595 | 595 | if (count($limit_array) > 1) { |
596 | 596 | $return_value .= ' LIMIT '.intval($limit_array[0]).' , '.intval($limit_array[1]); |
597 | - } else { |
|
597 | + } else { |
|
598 | 598 | $return_value .= ' LIMIT '.intval($limit_array[0]); |
599 | 599 | } |
600 | 600 | } |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param string $table |
68 | 68 | * |
69 | - * @return mixed |
|
69 | + * @return string |
|
70 | 70 | */ |
71 | 71 | public static function get_main_table($table) |
72 | 72 | { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | |
266 | 266 | /** |
267 | 267 | * Frees all the memory associated with the provided result identifier. |
268 | - * @return bool Returns TRUE on success or FALSE on failure. |
|
268 | + * @return boolean|null Returns TRUE on success or FALSE on failure. |
|
269 | 269 | * Notes: Use this method if you are concerned about how much memory is being used for queries that return large result sets. |
270 | 270 | * Anyway, all associated result memory is automatically freed at the end of the script's execution. |
271 | 271 | */ |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | * @param array $attributes |
382 | 382 | * @param bool $show_query |
383 | 383 | * |
384 | - * @return bool|int |
|
384 | + * @return false|string |
|
385 | 385 | */ |
386 | 386 | public static function insert($table_name, $attributes, $show_query = false) |
387 | 387 | { |
@@ -674,7 +674,7 @@ discard block |
||
674 | 674 | } |
675 | 675 | |
676 | 676 | /** |
677 | - * @param $table |
|
677 | + * @param string $table |
|
678 | 678 | * @return \Doctrine\DBAL\Schema\Column[] |
679 | 679 | */ |
680 | 680 | public static function listTableColumns($table) |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * @since 25/september/2010 |
6 | 6 | */ |
7 | 7 | |
8 | -require_once '../../../inc/global.inc.php';//hack for Chamilo |
|
8 | +require_once '../../../inc/global.inc.php'; //hack for Chamilo |
|
9 | 9 | api_protect_course_script(); |
10 | 10 | api_block_anonymous_users(); |
11 | 11 | if (!isset($_SESSION['draw_dir'])) { |
@@ -23,22 +23,22 @@ discard block |
||
23 | 23 | $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array(); |
24 | 24 | |
25 | 25 | if (count($array_to_search) > 0) { |
26 | - while (list($key) = each($array_to_search)) { |
|
27 | - $all_files[] = basename($array_to_search[$key]['path']); |
|
28 | - } |
|
26 | + while (list($key) = each($array_to_search)) { |
|
27 | + $all_files[] = basename($array_to_search[$key]['path']); |
|
28 | + } |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | //get all svg and png files |
32 | 32 | $accepted_extensions = array('.svg', '.png'); |
33 | 33 | |
34 | 34 | if (is_array($all_files) && count($all_files) > 0) { |
35 | - foreach ($all_files as & $file) { |
|
36 | - $slideshow_extension = strrchr($file, '.'); |
|
37 | - $slideshow_extension = strtolower($slideshow_extension); |
|
38 | - if (in_array($slideshow_extension, $accepted_extensions)) { |
|
39 | - $png_svg_files[] =$file; |
|
40 | - } |
|
41 | - } |
|
35 | + foreach ($all_files as & $file) { |
|
36 | + $slideshow_extension = strrchr($file, '.'); |
|
37 | + $slideshow_extension = strtolower($slideshow_extension); |
|
38 | + if (in_array($slideshow_extension, $accepted_extensions)) { |
|
39 | + $png_svg_files[] =$file; |
|
40 | + } |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | $disk_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images/gallery/'; |
@@ -57,24 +57,24 @@ discard block |
||
57 | 57 | <?php |
58 | 58 | echo '<h2>'.get_lang('Course').': '.$course_info['name'].'</h2>'; |
59 | 59 | if (!empty($png_svg_files)) { |
60 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
61 | - echo '<ul>'; |
|
62 | - foreach($png_svg_files as $filename) { |
|
63 | - $image=$disk_path.$filename; |
|
64 | - |
|
65 | - if (strpos($filename, "svg")){ |
|
66 | - $new_sizes['width'] = 60; |
|
67 | - $new_sizes['height'] = 60; |
|
68 | - } |
|
69 | - else { |
|
70 | - $new_sizes = api_resize_image($image, 60, 60); |
|
71 | - } |
|
72 | - |
|
73 | - echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
74 | - } |
|
75 | - echo '</ul>'; |
|
60 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
61 | + echo '<ul>'; |
|
62 | + foreach($png_svg_files as $filename) { |
|
63 | + $image=$disk_path.$filename; |
|
64 | + |
|
65 | + if (strpos($filename, "svg")){ |
|
66 | + $new_sizes['width'] = 60; |
|
67 | + $new_sizes['height'] = 60; |
|
68 | + } |
|
69 | + else { |
|
70 | + $new_sizes = api_resize_image($image, 60, 60); |
|
71 | + } |
|
72 | + |
|
73 | + echo '<li style="display:inline; padding:8px;"><a href="'.$web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
74 | + } |
|
75 | + echo '</ul>'; |
|
76 | 76 | } else { |
77 | - Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath')); |
|
77 | + Display::display_warning_message(get_lang('NoSVGImagesInImagesGalleryPath')); |
|
78 | 78 | } |
79 | 79 | ?> |
80 | 80 | </body> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | $is_allowed_to_edit = api_is_allowed_to_edit(null, true); |
14 | 14 | |
15 | -$curdirpath='/images/gallery'; //path of library directory |
|
15 | +$curdirpath = '/images/gallery'; //path of library directory |
|
16 | 16 | |
17 | 17 | $course_info = api_get_course_info(); |
18 | 18 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $slideshow_extension = strrchr($file, '.'); |
37 | 37 | $slideshow_extension = strtolower($slideshow_extension); |
38 | 38 | if (in_array($slideshow_extension, $accepted_extensions)) { |
39 | - $png_svg_files[] =$file; |
|
39 | + $png_svg_files[] = $file; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $style = '<style>'; |
48 | 48 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
49 | 49 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
50 | -$style .='</style>'; |
|
50 | +$style .= '</style>'; |
|
51 | 51 | |
52 | 52 | ?> |
53 | 53 | <!doctype html> |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | if (!empty($png_svg_files)) { |
60 | 60 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
61 | 61 | echo '<ul>'; |
62 | - foreach($png_svg_files as $filename) { |
|
63 | - $image=$disk_path.$filename; |
|
62 | + foreach ($png_svg_files as $filename) { |
|
63 | + $image = $disk_path.$filename; |
|
64 | 64 | |
65 | - if (strpos($filename, "svg")){ |
|
65 | + if (strpos($filename, "svg")) { |
|
66 | 66 | $new_sizes['width'] = 60; |
67 | 67 | $new_sizes['height'] = 60; |
68 | 68 | } |
@@ -65,8 +65,7 @@ |
||
65 | 65 | if (strpos($filename, "svg")){ |
66 | 66 | $new_sizes['width'] = 60; |
67 | 67 | $new_sizes['height'] = 60; |
68 | - } |
|
69 | - else { |
|
68 | + } else { |
|
70 | 69 | $new_sizes = api_resize_image($image, 60, 60); |
71 | 70 | } |
72 | 71 |
@@ -34,9 +34,9 @@ discard block |
||
34 | 34 | $array_to_search = is_array($docs_and_folders) ? $docs_and_folders : array(); |
35 | 35 | |
36 | 36 | if (count($array_to_search) > 0) { |
37 | - while (list($key) = each($array_to_search)) { |
|
38 | - $all_files[] = basename($array_to_search[$key]['path']); |
|
39 | - } |
|
37 | + while (list($key) = each($array_to_search)) { |
|
38 | + $all_files[] = basename($array_to_search[$key]['path']); |
|
39 | + } |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | //get all svg and png group files |
@@ -70,26 +70,26 @@ discard block |
||
70 | 70 | ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1 |
71 | 71 | ){ |
72 | 72 | |
73 | - if (!empty($png_svg_files)) { |
|
74 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
75 | - echo '<ul>'; |
|
76 | - foreach($png_svg_files as $filename) { |
|
77 | - $image = $group_disk_path.$filename; |
|
78 | - |
|
79 | - if (strpos($filename, "svg")){ |
|
80 | - $new_sizes['width'] = 60; |
|
81 | - $new_sizes['height'] = 60; |
|
82 | - } else { |
|
83 | - $new_sizes = api_resize_image($image, 60, 60); |
|
84 | - } |
|
73 | + if (!empty($png_svg_files)) { |
|
74 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
75 | + echo '<ul>'; |
|
76 | + foreach($png_svg_files as $filename) { |
|
77 | + $image = $group_disk_path.$filename; |
|
78 | + |
|
79 | + if (strpos($filename, "svg")){ |
|
80 | + $new_sizes['width'] = 60; |
|
81 | + $new_sizes['height'] = 60; |
|
82 | + } else { |
|
83 | + $new_sizes = api_resize_image($image, 60, 60); |
|
84 | + } |
|
85 | 85 | echo '<li style="display:inline; padding:8px;">'; |
86 | 86 | echo '<a href = "'.$group_web_path.$filename.'" alt="'.$filename.'" title="'.$filename.'">'; |
87 | 87 | echo '<img src = "'.$group_web_path.$filename.'" width = "'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
88 | - } |
|
89 | - echo '</ul>'; |
|
90 | - } |
|
88 | + } |
|
89 | + echo '</ul>'; |
|
90 | + } |
|
91 | 91 | } else { |
92 | - echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup')); |
|
92 | + echo Display::display_warning_message(get_lang('OnlyAccessFromYourGroup')); |
|
93 | 93 | } |
94 | 94 | ?> |
95 | 95 | </body> |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $slideshow_extension = strrchr($file, '.'); |
48 | 48 | $slideshow_extension = strtolower($slideshow_extension); |
49 | 49 | if (in_array($slideshow_extension, $accepted_extensions)) { |
50 | - $png_svg_files[] =$file; |
|
50 | + $png_svg_files[] = $file; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $style = '<style>'; |
56 | 56 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
57 | 57 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
58 | -$style .='</style>'; |
|
58 | +$style .= '</style>'; |
|
59 | 59 | |
60 | 60 | ?> |
61 | 61 | <!doctype html> |
@@ -68,15 +68,15 @@ discard block |
||
68 | 68 | if (( |
69 | 69 | $group_properties['doc_state'] == 2 && |
70 | 70 | ($is_allowed_to_edit || GroupManager :: is_user_in_group($_user['user_id'], $groupId))) || $group_properties['doc_state'] == 1 |
71 | -){ |
|
71 | +) { |
|
72 | 72 | |
73 | 73 | if (!empty($png_svg_files)) { |
74 | 74 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
75 | 75 | echo '<ul>'; |
76 | - foreach($png_svg_files as $filename) { |
|
76 | + foreach ($png_svg_files as $filename) { |
|
77 | 77 | $image = $group_disk_path.$filename; |
78 | 78 | |
79 | - if (strpos($filename, "svg")){ |
|
79 | + if (strpos($filename, "svg")) { |
|
80 | 80 | $new_sizes['width'] = 60; |
81 | 81 | $new_sizes['height'] = 60; |
82 | 82 | } else { |
@@ -25,14 +25,14 @@ discard block |
||
25 | 25 | $slideshow_extension = strrchr($file, '.'); |
26 | 26 | $slideshow_extension = strtolower($slideshow_extension); |
27 | 27 | if (in_array($slideshow_extension, $accepted_extensions)) { |
28 | - $png_svg_files[] =$file; |
|
28 | + $png_svg_files[] = $file; |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 | } |
32 | 32 | $style = '<style>'; |
33 | 33 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
34 | 34 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'themes/'.api_get_visual_theme().'/default.css";'; |
35 | -$style .='</style>'; |
|
35 | +$style .= '</style>'; |
|
36 | 36 | |
37 | 37 | ?> |
38 | 38 | <!doctype html> |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | if (!empty($png_svg_files)) { |
49 | 49 | echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
50 | 50 | echo '<ul>'; |
51 | - foreach($png_svg_files as $filename) { |
|
51 | + foreach ($png_svg_files as $filename) { |
|
52 | 52 | $image = $user_disk_path.$filename; |
53 | 53 | |
54 | - if (strpos($filename, "svg")){ |
|
54 | + if (strpos($filename, "svg")) { |
|
55 | 55 | $new_sizes['width'] = 60; |
56 | 56 | $new_sizes['height'] = 60; |
57 | 57 | } else { |
@@ -16,19 +16,19 @@ discard block |
||
16 | 16 | //get all files and folders |
17 | 17 | $scan_files = []; |
18 | 18 | if (is_dir($user_disk_path)) { |
19 | - $scan_files = scandir($user_disk_path); |
|
19 | + $scan_files = scandir($user_disk_path); |
|
20 | 20 | } |
21 | 21 | //get all svg and png files |
22 | 22 | $accepted_extensions = array('.svg', '.png'); |
23 | 23 | |
24 | 24 | if (is_array($scan_files) && count($scan_files) > 0) { |
25 | - foreach ($scan_files as & $file) { |
|
26 | - $slideshow_extension = strrchr($file, '.'); |
|
27 | - $slideshow_extension = strtolower($slideshow_extension); |
|
28 | - if (in_array($slideshow_extension, $accepted_extensions)) { |
|
29 | - $png_svg_files[] =$file; |
|
30 | - } |
|
31 | - } |
|
25 | + foreach ($scan_files as & $file) { |
|
26 | + $slideshow_extension = strrchr($file, '.'); |
|
27 | + $slideshow_extension = strtolower($slideshow_extension); |
|
28 | + if (in_array($slideshow_extension, $accepted_extensions)) { |
|
29 | + $png_svg_files[] =$file; |
|
30 | + } |
|
31 | + } |
|
32 | 32 | } |
33 | 33 | $style = '<style>'; |
34 | 34 | $style .= '@import "'.api_get_path(WEB_CSS_PATH).'base.css";'; |
@@ -47,23 +47,23 @@ discard block |
||
47 | 47 | echo '<h2>'.get_lang('SocialNetwork').': '.get_lang('MyFiles').'</h2>'; |
48 | 48 | |
49 | 49 | if (!empty($png_svg_files)) { |
50 | - echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
51 | - echo '<ul>'; |
|
52 | - foreach($png_svg_files as $filename) { |
|
53 | - $image = $user_disk_path.$filename; |
|
50 | + echo '<h3>'.get_lang('SelectSVGEditImage').'</h3>'; |
|
51 | + echo '<ul>'; |
|
52 | + foreach($png_svg_files as $filename) { |
|
53 | + $image = $user_disk_path.$filename; |
|
54 | 54 | |
55 | - if (strpos($filename, "svg")){ |
|
56 | - $new_sizes['width'] = 60; |
|
57 | - $new_sizes['height'] = 60; |
|
58 | - } else { |
|
59 | - $new_sizes = api_resize_image($image, 60, 60); |
|
60 | - } |
|
55 | + if (strpos($filename, "svg")){ |
|
56 | + $new_sizes['width'] = 60; |
|
57 | + $new_sizes['height'] = 60; |
|
58 | + } else { |
|
59 | + $new_sizes = api_resize_image($image, 60, 60); |
|
60 | + } |
|
61 | 61 | |
62 | - echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
63 | - } |
|
64 | - echo '</ul>'; |
|
62 | + echo '<li style="display:inline; padding:8px;"><a href="'.$user_web_path.$filename.'" alt "'.$filename.'" title="'.$filename.'"><img src="'.$user_web_path.$filename.'" width="'.$new_sizes['width'].'" height="'.$new_sizes['height'].'" border="0"></a></li>'; |
|
63 | + } |
|
64 | + echo '</ul>'; |
|
65 | 65 | } else { |
66 | - Display::display_warning_message(get_lang('NoSVGImages')); |
|
66 | + Display::display_warning_message(get_lang('NoSVGImages')); |
|
67 | 67 | } |
68 | 68 | ?> |
69 | 69 | </body> |