@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | */ |
9 | 9 | |
10 | 10 | require_once '../global.inc.php'; |
11 | -require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php'; |
|
11 | +require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php'; |
|
12 | 12 | |
13 | 13 | // First, protect this script |
14 | 14 | api_protect_course_script(false); |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | break; |
64 | 64 | } |
65 | 65 | // If pass all previous control, user can edit post |
66 | - $courseId = isset($_REQUEST['c_id'])? intval($_REQUEST['c_id']) : api_get_course_int_id(); |
|
66 | + $courseId = isset($_REQUEST['c_id']) ? intval($_REQUEST['c_id']) : api_get_course_int_id(); |
|
67 | 67 | $json['courseId'] = $courseId; |
68 | - $forumId = isset($_REQUEST['forum'])? intval($_REQUEST['forum']) : null; |
|
68 | + $forumId = isset($_REQUEST['forum']) ? intval($_REQUEST['forum']) : null; |
|
69 | 69 | $json['forum'] = $forumId; |
70 | - $threadId = isset($_REQUEST['thread'])? intval($_REQUEST['thread']) : null; |
|
70 | + $threadId = isset($_REQUEST['thread']) ? intval($_REQUEST['thread']) : null; |
|
71 | 71 | $json['thread'] = $threadId; |
72 | - $postId = isset($_REQUEST['postId'])? intval($_REQUEST['postId']) : null; |
|
72 | + $postId = isset($_REQUEST['postId']) ? intval($_REQUEST['postId']) : null; |
|
73 | 73 | $json['postId'] = $postId; |
74 | 74 | |
75 | 75 | if (!empty($courseId) && |
@@ -23,7 +23,7 @@ |
||
23 | 23 | // set URL and other appropriate options |
24 | 24 | $defaults = array( |
25 | 25 | CURLOPT_URL => $url, |
26 | - CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com |
|
26 | + CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com |
|
27 | 27 | CURLOPT_HEADER => 0, |
28 | 28 | CURLOPT_RETURNTRANSFER => true, |
29 | 29 | CURLOPT_TIMEOUT => 4 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $list_sessions = SessionManager::get_sessions_by_user($user_id, true); |
16 | 16 | if (!empty($list_sessions)) { |
17 | 17 | foreach ($list_sessions as $session_item) { |
18 | - echo $session_item['session_name'] . '<br />'; |
|
18 | + echo $session_item['session_name'].'<br />'; |
|
19 | 19 | } |
20 | 20 | } else { |
21 | 21 | echo get_lang('NoSessionsForThisUser'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | [ |
30 | 30 | 's.name' => [ |
31 | 31 | 'operator' => 'LIKE', |
32 | - 'value' => "%" . $_REQUEST['q'] . "%" |
|
32 | + 'value' => "%".$_REQUEST['q']."%" |
|
33 | 33 | ] |
34 | 34 | ] |
35 | 35 | ); |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $action = $_REQUEST['a']; |
12 | 12 | |
13 | 13 | unset($_REQUEST['a']); |
14 | -$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; |
|
14 | +$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; |
|
15 | 15 | |
16 | 16 | //Fix in order to add the exe_id |
17 | 17 | |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $user_info = api_get_user_info($nano->params['user_id']); |
40 | 40 | $name = get_lang('Quiz').'-'.$user_info['firstname'].'-'.$user_info['lastname'].'.'.$info['extension']; |
41 | 41 | $download = true; |
42 | - if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
42 | + if (isset($_REQUEST['download']) && $_REQUEST['download'] == 0) { |
|
43 | 43 | $download = false; |
44 | 44 | } |
45 | 45 | DocumentManager::file_send_for_download($file_path, $download); |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | |
5 | 5 | $action = $_GET['a']; |
6 | 6 | |
7 | -switch($action) { |
|
7 | +switch ($action) { |
|
8 | 8 | case 'load_online_user': |
9 | 9 | if (isset($_SESSION['who_is_online_counter'])) { |
10 | 10 | $_SESSION['who_is_online_counter']++; |
@@ -14,8 +14,8 @@ discard block |
||
14 | 14 | $images_to_show = 9; |
15 | 15 | |
16 | 16 | $page = intval($_REQUEST['online_page_nr']); |
17 | - $max_page = ceil(who_is_online_count()/$images_to_show); |
|
18 | - $page_rows = ($page-1)*9; |
|
17 | + $max_page = ceil(who_is_online_count() / $images_to_show); |
|
18 | + $page_rows = ($page - 1) * 9; |
|
19 | 19 | |
20 | 20 | if (!empty($max_page) && $page <= $max_page) { |
21 | 21 | if (isset($_GET['cidReq']) && strlen($_GET['cidReq']) > 0) { |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | break; |
38 | 38 | } |
39 | 39 | $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); |
40 | - $tbl_my_user = Database::get_main_table(TABLE_MAIN_USER); |
|
40 | + $tbl_my_user = Database::get_main_table(TABLE_MAIN_USER); |
|
41 | 41 | $tbl_my_user_friend = Database::get_main_table(TABLE_MAIN_USER_REL_USER); |
42 | - $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
42 | + $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
43 | 43 | $tbl_access_url_rel_user = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
44 | - $search = Database::escape_string($_REQUEST['q']); |
|
44 | + $search = Database::escape_string($_REQUEST['q']); |
|
45 | 45 | |
46 | 46 | $access_url_id = api_get_multiple_access_url() == 'true' ? api_get_current_access_url_id() : 1; |
47 | 47 | $user_id = api_get_user_id(); |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | |
50 | 50 | $likeCondition = " AND (firstname LIKE '%$search%' OR lastname LIKE '%$search%' OR email LIKE '%$search%') "; |
51 | 51 | |
52 | - if (api_get_setting('allow_social_tool')=='true' && api_get_setting('allow_message_tool') == 'true') { |
|
52 | + if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') { |
|
53 | 53 | // All users |
54 | - if (api_get_setting('allow_send_message_to_all_platform_users') == 'true' || api_is_platform_admin() ) { |
|
54 | + if (api_get_setting('allow_send_message_to_all_platform_users') == 'true' || api_is_platform_admin()) { |
|
55 | 55 | if ($access_url_id != 0) { |
56 | 56 | $sql = "SELECT DISTINCT u.user_id as id, u.firstname, u.lastname, u.email |
57 | 57 | FROM $tbl_user u LEFT JOIN $tbl_access_url_rel_user r ON u.user_id = r.user_id |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $likeCondition"; |
98 | 98 | } |
99 | 99 | } |
100 | - } elseif (api_get_setting('allow_social_tool')=='false' && api_get_setting('allow_message_tool')=='true') { |
|
100 | + } elseif (api_get_setting('allow_social_tool') == 'false' && api_get_setting('allow_message_tool') == 'true') { |
|
101 | 101 | if (api_get_setting('allow_send_message_to_all_platform_users') == 'true') { |
102 | 102 | $sql = "SELECT DISTINCT u.user_id as id, u.firstname, u.lastname, u.email |
103 | 103 | FROM $tbl_user u LEFT JOIN $tbl_access_url_rel_user r ON u.user_id = r.user_id |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $likeCondition "; |
109 | 109 | } else { |
110 | 110 | $time_limit = api_get_setting('time_limit_whosonline'); |
111 | - $online_time = time() - $time_limit*60; |
|
111 | + $online_time = time() - $time_limit * 60; |
|
112 | 112 | $limit_date = api_get_utc_datetime($online_time); |
113 | 113 | $sql = "SELECT SELECT DISTINCT u.user_id as id, u.firstname, u.lastname, u.email |
114 | 114 | FROM $tbl_my_user u INNER JOIN $track_online_table t |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $likeCondition"; |
118 | 118 | } |
119 | 119 | } |
120 | - $sql .=' LIMIT 20'; |
|
120 | + $sql .= ' LIMIT 20'; |
|
121 | 121 | $result = Database::query($sql); |
122 | 122 | |
123 | 123 | $showEmail = api_get_setting('show_email_addresses'); |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $urlInfo['url'])); |
51 | 51 | $cleanUrl = str_replace('/', '-', $url); |
52 | 52 | |
53 | - $newUrlDir = api_get_path(SYS_APP_PATH) . "home/$cleanUrl/admin/"; |
|
53 | + $newUrlDir = api_get_path(SYS_APP_PATH)."home/$cleanUrl/admin/"; |
|
54 | 54 | } else { |
55 | - $newUrlDir = api_get_path(SYS_APP_PATH) . "home/admin/"; |
|
55 | + $newUrlDir = api_get_path(SYS_APP_PATH)."home/admin/"; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (!file_exists($newUrlDir)) { |
@@ -166,15 +166,15 @@ discard block |
||
166 | 166 | } |
167 | 167 | |
168 | 168 | if ($system_version != $version_info) { |
169 | - $output = '<br /><span style="color:red">' . get_lang('YourVersionNotUpToDate') . '. '.get_lang('LatestVersionIs').' <b>Chamilo '.$version_info.'</b>. '.get_lang('YourVersionIs').' <b>Chamilo '.$system_version. '</b>. '.str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')).'</span>'; |
|
169 | + $output = '<br /><span style="color:red">'.get_lang('YourVersionNotUpToDate').'. '.get_lang('LatestVersionIs').' <b>Chamilo '.$version_info.'</b>. '.get_lang('YourVersionIs').' <b>Chamilo '.$system_version.'</b>. '.str_replace('http://www.chamilo.org', '<a href="http://www.chamilo.org">http://www.chamilo.org</a>', get_lang('PleaseVisitOurWebsite')).'</span>'; |
|
170 | 170 | } else { |
171 | 171 | $output = '<br /><span style="color:green">'.get_lang('VersionUpToDate').': Chamilo '.$version_info.'</span>'; |
172 | 172 | } |
173 | 173 | } else { |
174 | - $output = '<span style="color:red">' . get_lang('ImpossibleToContactVersionServerPleaseTryAgain') . '</span>'; |
|
174 | + $output = '<span style="color:red">'.get_lang('ImpossibleToContactVersionServerPleaseTryAgain').'</span>'; |
|
175 | 175 | } |
176 | 176 | } else { |
177 | - $output = '<span style="color:red">' . get_lang('AllowurlfopenIsSetToOff') . '</span>'; |
|
177 | + $output = '<span style="color:red">'.get_lang('AllowurlfopenIsSetToOff').'</span>'; |
|
178 | 178 | } |
179 | 179 | return $output; |
180 | 180 | } |
@@ -197,17 +197,17 @@ discard block |
||
197 | 197 | $getdata_str = count($getdata) ? '?' : ''; |
198 | 198 | |
199 | 199 | foreach ($getdata as $k => $v) { |
200 | - $getdata_str .= urlencode($k) .'='. urlencode($v) . '&'; |
|
200 | + $getdata_str .= urlencode($k).'='.urlencode($v).'&'; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | $crlf = "\r\n"; |
204 | - $req = $verb .' '. $uri . $getdata_str .' HTTP/1.1' . $crlf; |
|
205 | - $req .= 'Host: '. $ip . $crlf; |
|
206 | - $req .= 'User-Agent: Mozilla/5.0 Firefox/3.6.12' . $crlf; |
|
207 | - $req .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' . $crlf; |
|
208 | - $req .= 'Accept-Language: en-us,en;q=0.5' . $crlf; |
|
209 | - $req .= 'Accept-Encoding: deflate' . $crlf; |
|
210 | - $req .= 'Accept-Charset: utf-8;q=0.7,*;q=0.7' . $crlf; |
|
204 | + $req = $verb.' '.$uri.$getdata_str.' HTTP/1.1'.$crlf; |
|
205 | + $req .= 'Host: '.$ip.$crlf; |
|
206 | + $req .= 'User-Agent: Mozilla/5.0 Firefox/3.6.12'.$crlf; |
|
207 | + $req .= 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'.$crlf; |
|
208 | + $req .= 'Accept-Language: en-us,en;q=0.5'.$crlf; |
|
209 | + $req .= 'Accept-Encoding: deflate'.$crlf; |
|
210 | + $req .= 'Accept-Charset: utf-8;q=0.7,*;q=0.7'.$crlf; |
|
211 | 211 | |
212 | 212 | $req .= $crlf; |
213 | 213 |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | case 'update_lp_item_order': |
65 | 65 | if (api_is_allowed_to_edit(null, true)) { |
66 | 66 | |
67 | - $new_order = $_POST['new_order']; |
|
67 | + $new_order = $_POST['new_order']; |
|
68 | 68 | |
69 | - $sections = explode('^', $new_order); |
|
69 | + $sections = explode('^', $new_order); |
|
70 | 70 | $new_array = array(); |
71 | 71 | |
72 | 72 | // We have to update parent_item_id, previous_item_id, next_item_id, display_order in the database |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | foreach ($tab_parents_id as $parent_id) { |
85 | 85 | $Same_parent_LP_item_list = $LP_item_list->get_item_with_same_parent($parent_id); |
86 | 86 | $previous_item_id = 0; |
87 | - for ($i=0; $i < count($Same_parent_LP_item_list->list);$i++) { |
|
87 | + for ($i = 0; $i < count($Same_parent_LP_item_list->list); $i++) { |
|
88 | 88 | $item_id = $Same_parent_LP_item_list->list[$i]->id; |
89 | 89 | // display_order |
90 | 90 | $display_order = $i + 1; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // next_item_id |
96 | 96 | $next_item_id = 0; |
97 | 97 | if ($i < count($Same_parent_LP_item_list->list) - 1) { |
98 | - $next_item_id = $Same_parent_LP_item_list->list[$i+1]->id; |
|
98 | + $next_item_id = $Same_parent_LP_item_list->list[$i + 1]->id; |
|
99 | 99 | } |
100 | 100 | $LP_item_list->set_parameters_for_id($item_id, $next_item_id, "next_item_id"); |
101 | 101 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $params['display_order'] = $LP_item->display_order; |
107 | 107 | $params['previous_item_id'] = $LP_item->previous_item_id; |
108 | 108 | $params['next_item_id'] = $LP_item->next_item_id; |
109 | - $params['parent_item_id'] = $LP_item->parent_item_id; |
|
109 | + $params['parent_item_id'] = $LP_item->parent_item_id; |
|
110 | 110 | |
111 | 111 | Database::update( |
112 | 112 | $tbl_lp_item, |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | |
308 | 308 | public function get_item_with_same_parent($in_parent_id) { |
309 | 309 | $out_res = new LP_item_order_list(); |
310 | - for ($i=0; $i < count($this->list); $i++) { |
|
310 | + for ($i = 0; $i < count($this->list); $i++) { |
|
311 | 311 | if ($this->list[$i]->parent_item_id == $in_parent_id) { |
312 | 312 | $out_res->add($this->list[$i]); |
313 | 313 | } |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | public function set_parameters_for_id($in_id, $in_value, $in_parameters) { |
329 | - for ($i=0; $i < count($this->list); $i++) { |
|
329 | + for ($i = 0; $i < count($this->list); $i++) { |
|
330 | 330 | if ($this->list[$i]->id == $in_id) { |
331 | 331 | $this->list[$i]->$in_parameters = $in_value; |
332 | 332 | break; |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | public $next_item_id = 0; |
344 | 344 | public $display_order = 0; |
345 | 345 | |
346 | - public function __construct($in_id=0, $in_parent_id=0) { |
|
346 | + public function __construct($in_id = 0, $in_parent_id = 0) { |
|
347 | 347 | $this->id = $in_id; |
348 | 348 | $this->parent_item_id = $in_parent_id; |
349 | 349 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | 0, //howMany |
74 | 74 | 1, //$orderby = 1 |
75 | 75 | 'ASC', |
76 | - -1, //visibility |
|
76 | + -1, //visibility |
|
77 | 77 | $_GET['q'], |
78 | 78 | null, //$urlId |
79 | 79 | true //AlsoSearchCode |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | if (!empty($course['category_code'])) { |
94 | 94 | $parents = getParentsToString($course['category_code']); |
95 | - $title = $parents . $course['title']; |
|
95 | + $title = $parents.$course['title']; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | $results['items'][] = array( |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | INNER JOIN $session_course_user r ON u.user_id = r.user_id |
173 | 173 | WHERE session_id = %d AND c_id = '%s' |
174 | 174 | AND (u.firstname LIKE '%s' OR u.username LIKE '%s' OR u.lastname LIKE '%s')"; |
175 | - $needle = '%' . $_GET['q'] . '%'; |
|
175 | + $needle = '%'.$_GET['q'].'%'; |
|
176 | 176 | $sql_query = sprintf($sql, $_GET['session_id'], $course['real_id'], $needle, $needle, $needle); |
177 | 177 | |
178 | 178 | $result = Database::query($sql_query); |
@@ -191,11 +191,11 @@ discard block |
||
191 | 191 | case 'search_exercise_by_course': |
192 | 192 | if (api_is_platform_admin()) { |
193 | 193 | $course = api_get_course_info_by_id($_GET['course_id']); |
194 | - $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0 ; |
|
194 | + $session_id = (!empty($_GET['session_id'])) ? intval($_GET['session_id']) : 0; |
|
195 | 195 | $exercises = ExerciseLib::get_all_exercises($course, $session_id, false, $_GET['q'], true, 3); |
196 | 196 | |
197 | 197 | foreach ($exercises as $exercise) { |
198 | - $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title']) ); |
|
198 | + $data[] = array('id' => $exercise['id'], 'text' => html_entity_decode($exercise['title'])); |
|
199 | 199 | } |
200 | 200 | if (!empty($data)) { |
201 | 201 | $data[] = array('id' => 'T', 'text' => 'TODOS'); |
@@ -220,11 +220,11 @@ discard block |
||
220 | 220 | $sql, |
221 | 221 | intval($_GET['course_id']), |
222 | 222 | intval($_GET['session_id']), |
223 | - '%' . Database::escape_string($_GET['q']).'%' |
|
223 | + '%'.Database::escape_string($_GET['q']).'%' |
|
224 | 224 | ); |
225 | 225 | $result = Database::query($sql_query); |
226 | 226 | while ($survey = Database::fetch_assoc($result)) { |
227 | - $survey['title'] .= ($survey['anonymous'] == 1) ? ' (' . get_lang('Anonymous') . ')' : ''; |
|
227 | + $survey['title'] .= ($survey['anonymous'] == 1) ? ' ('.get_lang('Anonymous').')' : ''; |
|
228 | 228 | $data[] = array( |
229 | 229 | 'id' => $survey['id'], |
230 | 230 | 'text' => strip_tags(html_entity_decode($survey['title'])) |