@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | } |
99 | 99 | $new_thematic_list = array(); |
100 | 100 | |
101 | - foreach($thematic_list_temp as $item) { |
|
102 | - if (!empty($item['attendance_id']) ) { |
|
101 | + foreach ($thematic_list_temp as $item) { |
|
102 | + if (!empty($item['attendance_id'])) { |
|
103 | 103 | $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']); |
104 | 104 | } |
105 | 105 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | //checking if was already taken |
116 | 116 | foreach ($new_thematic_list as $key => $thematic_item) { |
117 | 117 | //if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) { |
118 | - if ($calendar['db_date_time'] == $thematic_item['start_date'] ) { |
|
118 | + if ($calendar['db_date_time'] == $thematic_item['start_date']) { |
|
119 | 119 | $insert = false; |
120 | 120 | if ($thematic_advance_id == $key) { |
121 | 121 | $insert = true; |
@@ -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 */ |
@@ -864,8 +864,8 @@ discard block |
||
864 | 864 | $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
865 | 865 | |
866 | 866 | if (!empty($_GET['id_session'])) { |
867 | - $sql = 'SELECT name FROM '.$tbl_session . ' |
|
868 | - WHERE id="'.intval($_GET['id_session']) . '"'; |
|
867 | + $sql = 'SELECT name FROM '.$tbl_session.' |
|
868 | + WHERE id="'.intval($_GET['id_session']).'"'; |
|
869 | 869 | $rs = Database::query($sql); |
870 | 870 | if (Database::num_rows($rs)) { |
871 | 871 | list($_SESSION['session_name']) = Database::fetch_array( |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | // Moreover, if we want to track a course with another session it can be usefull |
957 | 957 | if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) { |
958 | 958 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
959 | - $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"'; |
|
959 | + $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"'; |
|
960 | 960 | $rs = Database::query($sql); |
961 | 961 | if (Database::num_rows($rs)) { |
962 | 962 | list($_SESSION['session_name']) = Database::fetch_array($rs); |
@@ -1005,7 +1005,7 @@ discard block |
||
1005 | 1005 | $session_lifetime = 3600; // 1 hour |
1006 | 1006 | }*/ |
1007 | 1007 | |
1008 | - $session_lifetime = 3600; // 1 hour |
|
1008 | + $session_lifetime = 3600; // 1 hour |
|
1009 | 1009 | |
1010 | 1010 | $course_code = $_course['sysCode']; |
1011 | 1011 | $time = api_get_utc_datetime(); |
@@ -1031,7 +1031,7 @@ discard block |
||
1031 | 1031 | Database::query($sql); |
1032 | 1032 | } else { |
1033 | 1033 | $ip = api_get_real_ip(); |
1034 | - $sql="INSERT INTO $course_tracking_table (c_id, user_ip, user_id, login_course_date, logout_course_date, counter, session_id)" . |
|
1034 | + $sql = "INSERT INTO $course_tracking_table (c_id, user_ip, user_id, login_course_date, logout_course_date, counter, session_id)". |
|
1035 | 1035 | "VALUES('".$_course['real_id']."', '".$ip."', '".$_user['user_id']."', '$time', '$time', '1','".api_get_session_id()."')"; |
1036 | 1036 | Database::query($sql); |
1037 | 1037 | } |
@@ -1096,8 +1096,8 @@ discard block |
||
1096 | 1096 | if (Database::num_rows($result) > 0) { // this user have a recorded state for this course |
1097 | 1097 | $cuData = Database::fetch_array($result, 'ASSOC'); |
1098 | 1098 | |
1099 | - $is_courseAdmin = (bool)($cuData['status'] == 1); |
|
1100 | - $is_courseTutor = (bool)($cuData['is_tutor'] == 1); |
|
1099 | + $is_courseAdmin = (bool) ($cuData['status'] == 1); |
|
1100 | + $is_courseTutor = (bool) ($cuData['is_tutor'] == 1); |
|
1101 | 1101 | $is_courseMember = true; |
1102 | 1102 | } |
1103 | 1103 | |
@@ -1108,7 +1108,7 @@ discard block |
||
1108 | 1108 | // This user has no status related to this course |
1109 | 1109 | // The user is subscribed in a session? The user is a Session coach a Session admin ? |
1110 | 1110 | |
1111 | - $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
1111 | + $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION); |
|
1112 | 1112 | $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE); |
1113 | 1113 | $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
1114 | 1114 | |
@@ -1221,7 +1221,7 @@ discard block |
||
1221 | 1221 | |
1222 | 1222 | //If I'm the admin platform i'm a teacher of the course |
1223 | 1223 | if ($is_platformAdmin) { |
1224 | - $is_courseAdmin = true; |
|
1224 | + $is_courseAdmin = true; |
|
1225 | 1225 | } |
1226 | 1226 | } |
1227 | 1227 | } else { // keys missing => not anymore in the course - user relation |
@@ -1379,12 +1379,12 @@ discard block |
||
1379 | 1379 | ($logging_in && exist_firstpage_parameter()) |
1380 | 1380 | ) { |
1381 | 1381 | $redirectCourseDir = api_get_firstpage_parameter(); |
1382 | - api_delete_firstpage_parameter(); // delete the cookie |
|
1382 | + api_delete_firstpage_parameter(); // delete the cookie |
|
1383 | 1383 | |
1384 | 1384 | if (!isset($_SESSION['request_uri'])) { |
1385 | 1385 | if (CourseManager::get_course_id_from_path($redirectCourseDir)) { |
1386 | 1386 | $_SESSION['noredirection'] = false; |
1387 | - $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/'; |
|
1387 | + $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/'; |
|
1388 | 1388 | } |
1389 | 1389 | } |
1390 | 1390 | } elseif (api_user_is_login() && exist_firstpage_parameter()) { |
@@ -1392,7 +1392,7 @@ discard block |
||
1392 | 1392 | api_delete_firstpage_parameter(); // delete the cookie |
1393 | 1393 | if (CourseManager::get_course_id_from_path($redirectCourseDir)) { |
1394 | 1394 | $_SESSION['noredirection'] = false; |
1395 | - $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/'; |
|
1395 | + $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/'; |
|
1396 | 1396 | } |
1397 | 1397 | } |
1398 | 1398 |
@@ -196,7 +196,7 @@ |
||
196 | 196 | * |
197 | 197 | * @return array |
198 | 198 | */ |
199 | - public function sender($key = '', $userId = '') |
|
199 | + public function sender($key = '', $userId = '') |
|
200 | 200 | { |
201 | 201 | $_user = api_get_user_info($userId); |
202 | 202 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public static function path($name = '') |
37 | 37 | { |
38 | - return api_get_path(SYS_PATH) . 'custompages/' . $name; |
|
38 | + return api_get_path(SYS_PATH).'custompages/'.$name; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | /** |
@@ -50,12 +50,12 @@ discard block |
||
50 | 50 | return false; |
51 | 51 | } |
52 | 52 | |
53 | - $file = self::path($page_name . '.php'); |
|
53 | + $file = self::path($page_name.'.php'); |
|
54 | 54 | if (file_exists($file)) { |
55 | 55 | include($file); |
56 | 56 | exit; |
57 | 57 | } else { |
58 | - error_log('CustomPages::displayPage : could not read file ' . $file); |
|
58 | + error_log('CustomPages::displayPage : could not read file '.$file); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | |
@@ -69,14 +69,14 @@ discard block |
||
69 | 69 | public static function getURLImages($url_id = null) |
70 | 70 | { |
71 | 71 | if (is_null($url_id)) { |
72 | - $url = 'http://' . $_SERVER['HTTP_HOST'] . '/'; |
|
72 | + $url = 'http://'.$_SERVER['HTTP_HOST'].'/'; |
|
73 | 73 | $url_id = UrlManager::get_url_id($url); |
74 | 74 | } |
75 | - $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/'; |
|
75 | + $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/'; |
|
76 | 76 | $images = array(); |
77 | 77 | for ($img_id = 1; $img_id <= 3; $img_id++) { |
78 | - if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) { |
|
79 | - $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png'; |
|
78 | + if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) { |
|
79 | + $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png'; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | $newMessageText = ''; |
356 | 356 | $linkToNewMessage = Display::url( |
357 | 357 | get_lang('SeeMessage'), |
358 | - api_get_path(WEB_CODE_PATH) . 'messages/inbox.php' |
|
358 | + api_get_path(WEB_CODE_PATH).'messages/inbox.php' |
|
359 | 359 | ); |
360 | 360 | break; |
361 | 361 | case self::NOTIFICATION_TYPE_MESSAGE: |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | } |
371 | 371 | $linkToNewMessage = Display::url( |
372 | 372 | get_lang('SeeMessage'), |
373 | - api_get_path(WEB_CODE_PATH) . 'messages/inbox.php' |
|
373 | + api_get_path(WEB_CODE_PATH).'messages/inbox.php' |
|
374 | 374 | ); |
375 | 375 | break; |
376 | 376 | case self::NOTIFICATION_TYPE_INVITATION: |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | $linkToNewMessage = Display::url( |
387 | 387 | get_lang('SeeInvitation'), |
388 | - api_get_path(WEB_CODE_PATH) . 'social/invitations.php' |
|
388 | + api_get_path(WEB_CODE_PATH).'social/invitations.php' |
|
389 | 389 | ); |
390 | 390 | break; |
391 | 391 | case self::NOTIFICATION_TYPE_GROUP: |
@@ -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 | } |
@@ -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 | } |
@@ -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'])) { |