@@ -633,10 +633,10 @@ discard block |
||
633 | 633 | $date_format = str_replace( |
634 | 634 | array('%A', '%a', '%B', '%b'), |
635 | 635 | array( |
636 | - $translated['days_long'][(int)strftime('%w', $time)], |
|
637 | - $translated['days_short'][(int)strftime('%w', $time)], |
|
638 | - $translated['months_long'][(int)strftime('%m', $time) - 1], |
|
639 | - $translated['months_short'][(int)strftime('%m', $time) - 1], |
|
636 | + $translated['days_long'][(int) strftime('%w', $time)], |
|
637 | + $translated['days_short'][(int) strftime('%w', $time)], |
|
638 | + $translated['months_long'][(int) strftime('%m', $time) - 1], |
|
639 | + $translated['months_short'][(int) strftime('%m', $time) - 1], |
|
640 | 640 | ), |
641 | 641 | $date_format |
642 | 642 | ); |
@@ -1583,7 +1583,7 @@ discard block |
||
1583 | 1583 | * @return string Returns the encoding identificator modified in suitable for comparison way. |
1584 | 1584 | */ |
1585 | 1585 | function api_refine_encoding_id($encoding) { |
1586 | - if (is_array($encoding)){ |
|
1586 | + if (is_array($encoding)) { |
|
1587 | 1587 | return array_map('api_refine_encoding_id', $encoding); |
1588 | 1588 | } |
1589 | 1589 | return strtoupper(str_replace('_', '-', $encoding)); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once __DIR__.'/../inc/global.inc.php'; |
9 | 9 | |
10 | 10 | if (!api_is_platform_admin() && api_get_setting('ticket_allow_student_add') != 'true') { |
11 | - header('location:' . api_get_path(WEB_CODE_PATH).'ticket/tickets.php'); |
|
11 | + header('location:'.api_get_path(WEB_CODE_PATH).'ticket/tickets.php'); |
|
12 | 12 | exit; |
13 | 13 | } |
14 | 14 | |
@@ -84,15 +84,15 @@ discard block |
||
84 | 84 | var selected = document.getElementById("category_id").selectedIndex; |
85 | 85 | var id = document.getElementById("category_id").options[selected].value; |
86 | 86 | if(parseInt(course_required[id]) == 1 && document.getElementById("course_id").value == 0) { |
87 | - alert("' . addslashes(get_lang("ValidCourse")) . '"); |
|
87 | + alert("' . addslashes(get_lang("ValidCourse")).'"); |
|
88 | 88 | return false; |
89 | 89 | } else if(id != "CUR" && parseInt(course_required[id]) != 1 && !re.test(document.getElementById("personal_email").value)) { |
90 | 90 | if (document.getElementById("personal_email").value != "") { |
91 | - alert("' . addslashes(get_lang("PleaseEnterValidEmail")) . '"); |
|
91 | + alert("' . addslashes(get_lang("PleaseEnterValidEmail")).'"); |
|
92 | 92 | return false; |
93 | 93 | } |
94 | 94 | } else if(fckEditor1val == "") { |
95 | - alert("' . addslashes(get_lang("Filled")) . '"); |
|
95 | + alert("' . addslashes(get_lang("Filled")).'"); |
|
96 | 96 | return false; |
97 | 97 | } |
98 | 98 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | }); |
136 | 136 | |
137 | 137 | img_remove = $("<img/>", { |
138 | - src: "' . Display::returnIconPath('delete.png') . '" |
|
138 | + src: "' . Display::returnIconPath('delete.png').'" |
|
139 | 139 | }); |
140 | 140 | |
141 | 141 | new_filepath_id = $("#filepath_" + counter_image); |
@@ -167,10 +167,10 @@ discard block |
||
167 | 167 | |
168 | 168 | $types = TicketManager::get_all_tickets_categories($projectId, 'category.name ASC'); |
169 | 169 | $htmlHeadXtra[] = '<script language="javascript"> |
170 | - var projects = ' . js_array($types, 'projects', 'project_id') . ' |
|
171 | - var course_required = ' . js_array($types, 'course_required', 'course_required') . ' |
|
172 | - var other_area = ' . js_array($types, 'other_area', 'other_area') . ' |
|
173 | - var email = ' . js_array($types, 'email', 'email') . |
|
170 | + var projects = ' . js_array($types, 'projects', 'project_id').' |
|
171 | + var course_required = ' . js_array($types, 'course_required', 'course_required').' |
|
172 | + var other_area = ' . js_array($types, 'other_area', 'other_area').' |
|
173 | + var email = ' . js_array($types, 'email', 'email'). |
|
174 | 174 | '</script>'; |
175 | 175 | |
176 | 176 | /** |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | */ |
180 | 180 | function js_str($s) |
181 | 181 | { |
182 | - return '"' . addcslashes($s, "\0..\37\"\\") . '"'; |
|
182 | + return '"'.addcslashes($s, "\0..\37\"\\").'"'; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | $return = "new Array(); "; |
194 | 194 | foreach ($array as $value) { |
195 | - $return .= $name . "['" . $value['category_id'] . "'] ='" . $value[$key] . "'; "; |
|
195 | + $return .= $name."['".$value['category_id']."'] ='".$value[$key]."'; "; |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | return $return; |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | $form->addElement( |
381 | 381 | 'text', |
382 | 382 | 'phone', |
383 | - get_lang('Phone') . ' (' . get_lang('Optional') . ')', |
|
383 | + get_lang('Phone').' ('.get_lang('Optional').')', |
|
384 | 384 | array( |
385 | 385 | 'id' => 'phone' |
386 | 386 | ) |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | |
420 | 420 | $form->addLabel('', |
421 | 421 | '<span id="link-more-attach"> |
422 | - <span class="btn btn-success" onclick="return add_image_form()">' . get_lang('AddOneMoreFile') . '</span> |
|
422 | + <span class="btn btn-success" onclick="return add_image_form()">' . get_lang('AddOneMoreFile').'</span> |
|
423 | 423 | </span> |
424 | 424 | ('.sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))).') |
425 | 425 | '); |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | $category_id = $_POST['category_id']; |
454 | 454 | $content = $_POST['content']; |
455 | 455 | if ($_POST['phone'] != '') { |
456 | - $content .= '<p style="color:red"> ' . get_lang('Phone') . ': ' . Security::remove_XSS($_POST['phone']). '</p>'; |
|
456 | + $content .= '<p style="color:red"> '.get_lang('Phone').': '.Security::remove_XSS($_POST['phone']).'</p>'; |
|
457 | 457 | } |
458 | 458 | $course_id = isset($_POST['course_id']) ? $_POST['course_id'] : ''; |
459 | 459 | $sessionId = isset($_POST['session_id']) ? $_POST['session_id'] : ''; |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | $status, |
486 | 486 | $user_id |
487 | 487 | )) { |
488 | - header('Location:' . api_get_path(WEB_CODE_PATH).'ticket/tickets.php'); |
|
488 | + header('Location:'.api_get_path(WEB_CODE_PATH).'ticket/tickets.php'); |
|
489 | 489 | exit; |
490 | 490 | } else { |
491 | 491 | Display::display_header(get_lang('ComposeMessage')); |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $sql = "SELECT COUNT(u.user_id) AS total_number_of_items FROM $user_table u"; |
505 | 505 | if ((api_is_platform_admin() || api_is_session_admin()) && api_get_multiple_access_url()) { |
506 | 506 | $access_url_rel_user_table = Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
507 | - $sql.= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)"; |
|
507 | + $sql .= " INNER JOIN $access_url_rel_user_table url_rel_user ON (u.user_id=url_rel_user.user_id)"; |
|
508 | 508 | } |
509 | 509 | if (isset($_GET['keyword'])) { |
510 | 510 | $keyword = Database::escape_string(trim($_GET['keyword'])); |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | while ($user = Database::fetch_row($res)) { |
582 | 582 | $user_id = $user[0]; |
583 | 583 | $userPicture = UserManager::getUserPicture($user_id); |
584 | - $photo = '<img src="' . $userPicture. '" alt="' . api_get_person_name($user[2], $user[3]) . '" title="' . api_get_person_name($user[2], $user[3]) . '" />'; |
|
584 | + $photo = '<img src="'.$userPicture.'" alt="'.api_get_person_name($user[2], $user[3]).'" title="'.api_get_person_name($user[2], $user[3]).'" />'; |
|
585 | 585 | $users[] = array( |
586 | 586 | $photo, |
587 | 587 | $user_id, |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $nameTools = api_xml_http_response_encode(get_lang('Messages')); |
25 | 25 | /* Constants and variables */ |
26 | 26 | |
27 | -$htmlHeadXtra[]=' |
|
27 | +$htmlHeadXtra[] = ' |
|
28 | 28 | <script> |
29 | 29 | function validate(form, list) { |
30 | 30 | if(list.selectedIndex<0) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | FROM $table_message |
83 | 83 | WHERE user_receiver_id = ".intval($receiver_id)." AND id='".intval($message_id)."';"; |
84 | 84 | $result = Database::query($query); |
85 | - $row = Database::fetch_array($result,'ASSOC'); |
|
85 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
86 | 86 | if (!isset($row['user_sender_id'])) { |
87 | 87 | $html = get_lang('InvalidMessageId'); |
88 | 88 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | return $html; |
96 | 96 | } |
97 | 97 | |
98 | -function show_compose_to_user ($receiver_id) |
|
98 | +function show_compose_to_user($receiver_id) |
|
99 | 99 | { |
100 | 100 | $userInfo = api_get_user_info($receiver_id); |
101 | 101 | $html = get_lang('To').': <strong>'.$userInfo['complete_name'].'</strong>'; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | function manage_form($default, $select_from_user_list = null, $sent_to = null) |
110 | 110 | { |
111 | 111 | $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null; |
112 | - $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
|
112 | + $message_id = isset($_GET['message_id']) ? intval($_GET['message_id']) : null; |
|
113 | 113 | $param_f = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null; |
114 | 114 | |
115 | 115 | $form = new FormValidator( |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | ); |
134 | 134 | $form->addRule('id_text_name', get_lang('ThisFieldIsRequired'), 'required'); |
135 | 135 | $form->addElement('html', '<div id="id_div_search" style="padding:0px" class="message-select-box" > </div>'); |
136 | - $form->addElement('hidden','user_list', 0, array('id'=>'user_list')); |
|
136 | + $form->addElement('hidden', 'user_list', 0, array('id'=>'user_list')); |
|
137 | 137 | } else { |
138 | 138 | if (!empty($sent_to)) { |
139 | 139 | $form->addLabel(get_lang('SendMessageTo'), $sent_to); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | array(), |
148 | 148 | [ |
149 | 149 | 'multiple' => 'multiple', |
150 | - 'url' => api_get_path(WEB_AJAX_PATH) . 'message.ajax.php?a=find_users' |
|
150 | + 'url' => api_get_path(WEB_AJAX_PATH).'message.ajax.php?a=find_users' |
|
151 | 151 | ] |
152 | 152 | ); |
153 | 153 | } else { |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | |
212 | 212 | $form->addLabel( |
213 | 213 | '', |
214 | - '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span> ('.sprintf(get_lang('MaximunFileSizeX'),format_file_size(api_get_setting('message_max_upload_filesize'))).')' |
|
214 | + '<span id="link-more-attach"><a href="javascript://" onclick="return add_image_form()">'.get_lang('AddOneMoreFile').'</a></span> ('.sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))).')' |
|
215 | 215 | ); |
216 | 216 | } |
217 | 217 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $content = $default['content']; |
234 | 234 | $group_id = isset($default['group_id']) ? $default['group_id'] : null; |
235 | 235 | $parent_id = isset($default['parent_id']) ? $default['parent_id'] : null; |
236 | - if (is_array($user_list) && count($user_list)> 0) { |
|
236 | + if (is_array($user_list) && count($user_list) > 0) { |
|
237 | 237 | //all is well, send the message |
238 | 238 | foreach ($user_list as $userId) { |
239 | 239 | $res = MessageManager::send_message( |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | if ($res) { |
249 | 249 | $userInfo = api_get_user_info($userId); |
250 | 250 | Display::addFlash(Display::return_message( |
251 | - get_lang('MessageSentTo') ." <b>" .$userInfo['complete_name'] ."</b>", |
|
251 | + get_lang('MessageSentTo')." <b>".$userInfo['complete_name']."</b>", |
|
252 | 252 | 'confirmation', |
253 | 253 | false |
254 | 254 | )); |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | if ($group_id != 0) { |
292 | 292 | $social_right_content .= '<div class=actions>'; |
293 | 293 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'. |
294 | - Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
294 | + Display::return_icon('back.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
295 | 295 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'. |
296 | - Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
296 | + Display::return_icon('message_new.png', api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>'; |
|
297 | 297 | $social_right_content .= '</div>'; |
298 | 298 | } else { |
299 | 299 | if ($socialToolIsActive) { |
@@ -305,11 +305,11 @@ discard block |
||
305 | 305 | } |
306 | 306 | if (api_get_setting('allow_message_tool') === 'true') { |
307 | 307 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'. |
308 | - Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>'; |
|
308 | + Display::return_icon('message_new.png', get_lang('ComposeMessage')).'</a>'; |
|
309 | 309 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'. |
310 | - Display::return_icon('inbox.png',get_lang('Inbox')).'</a>'; |
|
310 | + Display::return_icon('inbox.png', get_lang('Inbox')).'</a>'; |
|
311 | 311 | $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'. |
312 | - Display::return_icon('outbox.png',get_lang('Outbox')).'</a>'; |
|
312 | + Display::return_icon('outbox.png', get_lang('Outbox')).'</a>'; |
|
313 | 313 | } |
314 | 314 | $social_right_content .= '</div>'; |
315 | 315 | } |
@@ -323,21 +323,21 @@ discard block |
||
323 | 323 | $social_right_content .= '<div class="row">'; |
324 | 324 | $social_right_content .= '<div class="col-md-12">'; |
325 | 325 | $social_right_content .= '<div class="actions">'; |
326 | - $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'. |
|
326 | + $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php?f=social">'. |
|
327 | 327 | Display::return_icon('back.png', get_lang('Back'), array(), 32).'</a>'; |
328 | - $social_right_content .= '</div>'; |
|
329 | - $social_right_content .= '</div>'; |
|
328 | + $social_right_content .= '</div>'; |
|
329 | + $social_right_content .= '</div>'; |
|
330 | 330 | $social_right_content .= '<div class="col-md-12">'; |
331 | 331 | } |
332 | 332 | |
333 | 333 | // MAIN CONTENT |
334 | 334 | if (!isset($_POST['compose'])) { |
335 | - if(isset($_GET['re_id'])) { |
|
335 | + if (isset($_GET['re_id'])) { |
|
336 | 336 | $social_right_content .= show_compose_reply_to_message( |
337 | 337 | $_GET['re_id'], |
338 | 338 | api_get_user_id() |
339 | 339 | ); |
340 | - } elseif(isset($_GET['send_to_user'])) { |
|
340 | + } elseif (isset($_GET['send_to_user'])) { |
|
341 | 341 | $social_right_content .= show_compose_to_user($_GET['send_to_user']); |
342 | 342 | } else { |
343 | 343 | $social_right_content .= show_compose_to_any(api_get_user_id()); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $restrict = true; |
349 | 349 | } elseif (isset($_POST['group_id'])) { |
350 | 350 | $restrict = true; |
351 | - } elseif(isset($_POST['hidden_user'])) { |
|
351 | + } elseif (isset($_POST['hidden_user'])) { |
|
352 | 352 | $restrict = true; |
353 | 353 | } |
354 | 354 | |
@@ -371,13 +371,13 @@ discard block |
||
371 | 371 | } |
372 | 372 | $social_right_content .= manage_form($default); |
373 | 373 | } else { |
374 | - $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'),'error'); |
|
374 | + $social_right_content .= Display::return_message(get_lang('ErrorSendingMessage'), 'error'); |
|
375 | 375 | } |
376 | 376 | } |
377 | 377 | } |
378 | 378 | if (api_get_setting('allow_social_tool') === 'true') { |
379 | - $social_right_content .= '</div>'; |
|
380 | - $social_right_content .= '</div>'; |
|
379 | + $social_right_content .= '</div>'; |
|
380 | + $social_right_content .= '</div>'; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | $tpl = new Template(get_lang('ComposeMessage')); |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | |
21 | 21 | $this_section = SECTION_TRACKING; |
22 | 22 | |
23 | -$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('MySpace')); |
|
23 | +$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('MySpace')); |
|
24 | 24 | |
25 | 25 | if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && !isset($_GET["type"])) { |
26 | - $interbreadcrumb[] = array ("url" => "teachers.php", "name" => get_lang('Teachers')); |
|
26 | + $interbreadcrumb[] = array("url" => "teachers.php", "name" => get_lang('Teachers')); |
|
27 | 27 | } |
28 | 28 | |
29 | -if (isset($_GET["user_id"]) && $_GET["user_id"]!="" && isset($_GET["type"]) && $_GET["type"] == "coach") { |
|
30 | - $interbreadcrumb[] = array ("url" => "coaches.php", "name" => get_lang('Tutors')); |
|
29 | +if (isset($_GET["user_id"]) && $_GET["user_id"] != "" && isset($_GET["type"]) && $_GET["type"] == "coach") { |
|
30 | + $interbreadcrumb[] = array("url" => "coaches.php", "name" => get_lang('Tutors')); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | function get_count_users() |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $detailsLink = '<a href="myStudents.php?student='.$student_id.'&id_coach='.$coach_id.'&id_session='.$sessionId.'"> |
164 | 164 | '.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>'; |
165 | 165 | } else { |
166 | - $detailsLink = '<a href="myStudents.php?student='.$student_id.'"> |
|
166 | + $detailsLink = '<a href="myStudents.php?student='.$student_id.'"> |
|
167 | 167 | '.Display::return_icon('2rightarrow.png', get_lang('Details')).'</a>'; |
168 | 168 | } |
169 | 169 | $row[] = $detailsLink; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | if (api_is_drh()) { |
186 | 186 | $menu_items = array( |
187 | - Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php" ), |
|
187 | + Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH)."auth/my_progress.php"), |
|
188 | 188 | Display::url(Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), '#'), |
189 | 189 | Display::url(Display::return_icon('teacher.png', get_lang('Trainers'), array(), ICON_SIZE_MEDIUM), 'teachers.php'), |
190 | 190 | Display::url(Display::return_icon('course.png', get_lang('Courses'), array(), ICON_SIZE_MEDIUM), 'course.php'), |
@@ -240,14 +240,14 @@ discard block |
||
240 | 240 | |
241 | 241 | if ($export_csv) { |
242 | 242 | if ($is_western_name_order) { |
243 | - $csv_header[] = array ( |
|
243 | + $csv_header[] = array( |
|
244 | 244 | get_lang('FirstName'), |
245 | 245 | get_lang('LastName'), |
246 | 246 | get_lang('FirstLogin'), |
247 | 247 | get_lang('LastConnexion') |
248 | 248 | ); |
249 | 249 | } else { |
250 | - $csv_header[] = array ( |
|
250 | + $csv_header[] = array( |
|
251 | 251 | get_lang('LastName'), |
252 | 252 | get_lang('FirstName'), |
253 | 253 | get_lang('FirstLogin'), |
@@ -54,12 +54,12 @@ discard block |
||
54 | 54 | |
55 | 55 | /* Breadcrumbs */ |
56 | 56 | |
57 | -if (isset($_SESSION['gradebook'])){ |
|
57 | +if (isset($_SESSION['gradebook'])) { |
|
58 | 58 | $gradebook = Security::remove_XSS($_SESSION['gradebook']); |
59 | 59 | } |
60 | 60 | |
61 | 61 | if (!empty($gradebook) && $gradebook == 'view') { |
62 | - $interbreadcrumb[] = array ( |
|
62 | + $interbreadcrumb[] = array( |
|
63 | 63 | 'url' => '../gradebook/'.Security::remove_XSS($_SESSION['gradebook_dest']), |
64 | 64 | 'name' => get_lang('ToolGradebook') |
65 | 65 | ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group.php?'.$cidreq, 'name' => get_lang('Groups')); |
118 | 118 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.$cidreq, 'name' => get_lang('GroupSpace').' '.$groupProperties['name']); |
119 | 119 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => $current_forum['forum_title']); |
120 | - $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']),'name' => get_lang('NewTopic')); |
|
120 | + $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.intval($_GET['forum']), 'name' => get_lang('NewTopic')); |
|
121 | 121 | } else { |
122 | 122 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools); |
123 | 123 | $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH).'forum/viewforumcategory.php?'.$cidreq.'&forumcategory='.$current_forum_category['cat_id'], 'name' => $current_forum_category['cat_title']); |
@@ -53,13 +53,13 @@ discard block |
||
53 | 53 | if ($view == "00000010") |
54 | 54 | $nameTools = get_lang('ScormAccess'); |
55 | 55 | |
56 | -$interbreadcrumb[] = array("url" => api_get_self() . "?view=0000000", "name" => get_lang('ToolName')); |
|
56 | +$interbreadcrumb[] = array("url" => api_get_self()."?view=0000000", "name" => get_lang('ToolName')); |
|
57 | 57 | |
58 | 58 | $is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || api_is_drh(); |
59 | 59 | |
60 | 60 | /* MAIN CODE */ |
61 | 61 | |
62 | -$title[0] = get_lang('StatsOfCourse') . " : " . $_course['official_code']; |
|
62 | +$title[0] = get_lang('StatsOfCourse')." : ".$_course['official_code']; |
|
63 | 63 | |
64 | 64 | |
65 | 65 | $courseInfo = api_get_course_info($_course['official_code']); |
@@ -91,40 +91,40 @@ discard block |
||
91 | 91 | $sql = "SELECT $TABLECOURSUSER.user_i, $table_user.lastname, $table_user.firstname |
92 | 92 | FROM $TABLECOURSUSER, $table_user |
93 | 93 | WHERE |
94 | - $TABLECOURSUSER.c_id = '" . api_get_course_int_id() . "' AND |
|
94 | + $TABLECOURSUSER.c_id = '".api_get_course_int_id()."' AND |
|
95 | 95 | $TABLECOURSUSER.user_id = $table_user.user_id AND |
96 | - $TABLECOURSUSER.relation_type<>" . COURSE_RELATION_TYPE_RRHH . " |
|
96 | + $TABLECOURSUSER.relation_type<>".COURSE_RELATION_TYPE_RRHH." |
|
97 | 97 | ORDER BY $table_user.lastname"; |
98 | 98 | $results = StatsUtils::getManyResults3Col($sql); |
99 | 99 | |
100 | 100 | //BUGFIX: get visual code instead of real course code. Scormpaths use the visual code... (should be fixed in future versions) |
101 | - $sql = "SELECT visual_code FROM $TABLECOURSE WHERE code = '" . api_get_course_id() . "'"; |
|
101 | + $sql = "SELECT visual_code FROM $TABLECOURSE WHERE code = '".api_get_course_id()."'"; |
|
102 | 102 | $_course['visual_code'] = StatsUtils::getOneResult($sql); |
103 | 103 | |
104 | 104 | if (is_array($results)) { |
105 | 105 | $line = ''; |
106 | - $title_line = get_lang('Name') . ";" . get_lang('FirstAccess') . ";" . get_lang('LastAccess') . ";" . get_lang('Visited') . "\n"; |
|
106 | + $title_line = get_lang('Name').";".get_lang('FirstAccess').";".get_lang('LastAccess').";".get_lang('Visited')."\n"; |
|
107 | 107 | |
108 | 108 | for ($j = 0; $j < count($results); $j++) { |
109 | 109 | // BEGIN % visited |
110 | 110 | // sum of all items (= multiple learningpaths + SCORM imported paths) |
111 | - $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) FROM $tbl_learnpath_item_view iv " . |
|
111 | + $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) FROM $tbl_learnpath_item_view iv ". |
|
112 | 112 | "INNER JOIN $tbl_learnpath_view v |
113 | - ON iv.lp_view_id = v.id " . |
|
113 | + ON iv.lp_view_id = v.id ". |
|
114 | 114 | "WHERE |
115 | 115 | v.c_id = $course_id AND |
116 | 116 | iv.c_id = $course_id AND |
117 | - v.user_id = " . $results[$j][0]; |
|
117 | + v.user_id = ".$results[$j][0]; |
|
118 | 118 | $total_lpath_items = StatsUtils::getOneResult($sql); |
119 | 119 | |
120 | 120 | // sum of all completed items (= multiple learningpaths + SCORM imported paths) |
121 | - $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) " . |
|
122 | - "FROM $tbl_learnpath_item_view iv " . |
|
123 | - "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id = v.id " . |
|
121 | + $sql = "SELECT COUNT(DISTINCT(iv.lp_item_id)) ". |
|
122 | + "FROM $tbl_learnpath_item_view iv ". |
|
123 | + "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id = v.id ". |
|
124 | 124 | "WHERE |
125 | 125 | v.c_id = $course_id AND |
126 | 126 | iv.c_id = $course_id AND |
127 | - v.user_id = " . $results[$j][0] . " " . |
|
127 | + v.user_id = ".$results[$j][0]." ". |
|
128 | 128 | "AND (status = 'completed' OR status='passed')"; |
129 | 129 | $total_lpath_items_completed = StatsUtils::getOneResult($sql); |
130 | 130 | |
@@ -135,23 +135,23 @@ discard block |
||
135 | 135 | // BEGIN first/last access |
136 | 136 | // first access |
137 | 137 | $sql = "SELECT access_date FROM $TABLETRACK_ACCESS_2 |
138 | - WHERE access_user_id = '" . $results[$j][0] . "' AND c_id = '" . $courseId . "' AND access_tool = 'learnpath' AND access_session_id = '" . api_get_session_id() . "' |
|
138 | + WHERE access_user_id = '".$results[$j][0]."' AND c_id = '".$courseId."' AND access_tool = 'learnpath' AND access_session_id = '".api_get_session_id()."' |
|
139 | 139 | ORDER BY access_id ASC LIMIT 1"; |
140 | 140 | $first_access = StatsUtils::getOneResult($sql); |
141 | 141 | $first_access = empty($first_access) ? "-" : date('d.m.y', strtotime($first_access)); |
142 | 142 | |
143 | 143 | // last access |
144 | - $sql = "SELECT access_date FROM $TABLETRACK_ACCESS WHERE access_user_id = '" . $results[$j][0] . "' AND c_id = '" . $courseId . "' AND access_tool = 'learnpath'"; |
|
144 | + $sql = "SELECT access_date FROM $TABLETRACK_ACCESS WHERE access_user_id = '".$results[$j][0]."' AND c_id = '".$courseId."' AND access_tool = 'learnpath'"; |
|
145 | 145 | $last_access = StatsUtils::getOneResult($sql); |
146 | 146 | $last_access = empty($last_access) ? "-" : date('d.m.y', strtotime($last_access)); |
147 | 147 | // END first/last access |
148 | 148 | // BEGIN presentation of data |
149 | - $line .= $results[$j][1] . " " . $results[$j][2] . ";" . $first_access . ";" . $last_access . ";" . $lpath_pct_completed . "\n"; |
|
149 | + $line .= $results[$j][1]." ".$results[$j][2].";".$first_access.";".$last_access.";".$lpath_pct_completed."\n"; |
|
150 | 150 | |
151 | 151 | // END presentation of data |
152 | 152 | } |
153 | 153 | } else { |
154 | - $line = get_lang('NoResult') . "\n"; |
|
154 | + $line = get_lang('NoResult')."\n"; |
|
155 | 155 | } |
156 | 156 | } |
157 | 157 | |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | |
164 | 164 | $sql = "SELECT count(*) |
165 | 165 | FROM $TABLECOURSUSER |
166 | - WHERE c_id = '" . api_get_course_int_id() . "' AND relation_type<>" . COURSE_RELATION_TYPE_RRHH . ""; |
|
166 | + WHERE c_id = '".api_get_course_int_id()."' AND relation_type<>".COURSE_RELATION_TYPE_RRHH.""; |
|
167 | 167 | $count = StatsUtils::getOneResult($sql); |
168 | - $title_line = get_lang('CountUsers') . " ; " . $count . "\n"; |
|
168 | + $title_line = get_lang('CountUsers')." ; ".$count."\n"; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /* Access to this course */ |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | AND access_tool IS NULL"; |
184 | 184 | $count = StatsUtils::getOneResult($sql); |
185 | 185 | |
186 | - $line .= get_lang('CountToolAccess') . " ; " . $count . "\n"; |
|
186 | + $line .= get_lang('CountToolAccess')." ; ".$count."\n"; |
|
187 | 187 | |
188 | 188 | // last 31 days |
189 | 189 | $sql = "SELECT count(*) |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | AND access_tool IS NULL"; |
194 | 194 | $count = StatsUtils::getOneResult($sql); |
195 | 195 | |
196 | - $line .= get_lang('Last31days') . " ; " . $count . "\n"; |
|
196 | + $line .= get_lang('Last31days')." ; ".$count."\n"; |
|
197 | 197 | |
198 | 198 | // last 7 days |
199 | 199 | $sql = "SELECT count(*) |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | AND access_tool IS NULL"; |
204 | 204 | $count = StatsUtils::getOneResult($sql); |
205 | 205 | |
206 | - $line .= get_lang('Last7days') . " ; " . $count . "\n"; |
|
206 | + $line .= get_lang('Last7days')." ; ".$count."\n"; |
|
207 | 207 | |
208 | 208 | // today |
209 | 209 | $sql = "SELECT count(*) |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | AND ( access_date > CURDATE() ) |
213 | 213 | AND access_tool IS NULL"; |
214 | 214 | $count = StatsUtils::getOneResult($sql); |
215 | - $line .= get_lang('ThisDay') . " ; " . $count . "\n"; |
|
215 | + $line .= get_lang('ThisDay')." ; ".$count."\n"; |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /* Tools */ |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $tempView[2] = '0'; |
222 | 222 | $title[1] = $nameTools; |
223 | 223 | $line = ''; |
224 | - $title_line = get_lang('ToolTitleToolnameColumn') . ";" . get_lang('ToolTitleUsersColumn') . ";" . get_lang('ToolTitleCountColumn') . "\n"; |
|
224 | + $title_line = get_lang('ToolTitleToolnameColumn').";".get_lang('ToolTitleUsersColumn').";".get_lang('ToolTitleCountColumn')."\n"; |
|
225 | 225 | |
226 | 226 | $sql = "SELECT access_tool, COUNT(DISTINCT access_user_id),count( access_tool ) |
227 | 227 | FROM $TABLETRACK_ACCESS |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | |
234 | 234 | if (is_array($results)) { |
235 | 235 | for ($j = 0; $j < count($results); $j++) { |
236 | - $line .= $results[$j][0] . "/" . get_lang($results[$j][0]) . ";" . $results[$j][1] . ";" . $results[$j][2] . "\n"; |
|
236 | + $line .= $results[$j][0]."/".get_lang($results[$j][0]).";".$results[$j][1].";".$results[$j][2]."\n"; |
|
237 | 237 | } |
238 | 238 | } else { |
239 | - $line = get_lang('NoResult') . "\n"; |
|
239 | + $line = get_lang('NoResult')."\n"; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 | |
@@ -258,14 +258,14 @@ discard block |
||
258 | 258 | |
259 | 259 | $title[1] = $nameTools; |
260 | 260 | $line = ''; |
261 | - $title_line = get_lang('LinksTitleLinkColumn') . ";" . get_lang('LinksTitleUsersColumn') . ";" . get_lang('LinksTitleCountColumn') . "\n"; |
|
261 | + $title_line = get_lang('LinksTitleLinkColumn').";".get_lang('LinksTitleUsersColumn').";".get_lang('LinksTitleCountColumn')."\n"; |
|
262 | 262 | |
263 | 263 | if (is_array($results)) { |
264 | 264 | for ($j = 0; $j < count($results); $j++) { |
265 | - $line .= $results[$j][1] . "'>" . $results[$j][0] . ";" . $results[$j][2] . ";" . $results[$j][3] . "\n"; |
|
265 | + $line .= $results[$j][1]."'>".$results[$j][0].";".$results[$j][2].";".$results[$j][3]."\n"; |
|
266 | 266 | } |
267 | 267 | } else { |
268 | - $line = get_lang('NoResult') . "\n"; |
|
268 | + $line = get_lang('NoResult')."\n"; |
|
269 | 269 | } |
270 | 270 | } |
271 | 271 | |
@@ -284,13 +284,13 @@ discard block |
||
284 | 284 | |
285 | 285 | $title[1] = $nameTools; |
286 | 286 | $line = ''; |
287 | - $title_line = get_lang('DocumentsTitleDocumentColumn') . ";" . get_lang('DocumentsTitleUsersColumn') . ";" . get_lang('DocumentsTitleCountColumn') . "\n"; |
|
287 | + $title_line = get_lang('DocumentsTitleDocumentColumn').";".get_lang('DocumentsTitleUsersColumn').";".get_lang('DocumentsTitleCountColumn')."\n"; |
|
288 | 288 | if (is_array($results)) { |
289 | 289 | for ($j = 0; $j < count($results); $j++) { |
290 | - $line .= $results[$j][0] . ";" . $results[$j][1] . ";" . $results[$j][2] . "\n"; |
|
290 | + $line .= $results[$j][0].";".$results[$j][1].";".$results[$j][2]."\n"; |
|
291 | 291 | } |
292 | 292 | } else { |
293 | - $line = get_lang('NoResult') . "\n"; |
|
293 | + $line = get_lang('NoResult')."\n"; |
|
294 | 294 | } |
295 | 295 | } |
296 | 296 | |
@@ -318,10 +318,10 @@ discard block |
||
318 | 318 | //echo "<a href='".api_get_self()."?view=".$view."&scormcontopen=".$ar['id']."' class='specialLink'>$lp_title</a>"; |
319 | 319 | if ($ar['id'] == $scormcontopen) { //have to list the students here |
320 | 320 | $contentId = $ar['id']; |
321 | - $sql2 = "SELECT u.user_id, u.lastname, u.firstname " . |
|
322 | - "FROM $tbl_learnpath_view sd " . |
|
323 | - "INNER JOIN $table_user u " . |
|
324 | - "ON u.user_id = sd.user_id " . |
|
321 | + $sql2 = "SELECT u.user_id, u.lastname, u.firstname ". |
|
322 | + "FROM $tbl_learnpath_view sd ". |
|
323 | + "INNER JOIN $table_user u ". |
|
324 | + "ON u.user_id = sd.user_id ". |
|
325 | 325 | "WHERE sd.c_id = $course_id AND sd.lp_id=$contentId group by u.user_id"; |
326 | 326 | //error_log($sql2,0); |
327 | 327 | $result2 = Database::query($sql2); |
@@ -333,28 +333,28 @@ discard block |
||
333 | 333 | while ($ar2 != '') { |
334 | 334 | |
335 | 335 | if (isset($_REQUEST["scormstudentopen"]) && $ar2['user_id'] == $scormstudentopen) { |
336 | - $line .= $ar['id'] . " " . $ar2['user_id'] . " " . api_get_person_name($ar2['firstname'], $ar2['lastname']); |
|
336 | + $line .= $ar['id']." ".$ar2['user_id']." ".api_get_person_name($ar2['firstname'], $ar2['lastname']); |
|
337 | 337 | } else { |
338 | - $line .= $ar['id'] . " " . $ar2['user_id'] . " " . api_get_person_name($ar2['firstname'], $ar2['lastname']); |
|
338 | + $line .= $ar['id']." ".$ar2['user_id']." ".api_get_person_name($ar2['firstname'], $ar2['lastname']); |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | if ($ar2['user_id'] == $scormstudentopen) { //have to list the student's results |
342 | 342 | $studentId = $ar2['user_id']; |
343 | - $sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time " . |
|
344 | - "FROM $tbl_learnpath_item i " . |
|
345 | - "INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id " . |
|
346 | - "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id " . |
|
343 | + $sql3 = "SELECT iv.status, iv.score, i.title, iv.total_time ". |
|
344 | + "FROM $tbl_learnpath_item i ". |
|
345 | + "INNER JOIN $tbl_learnpath_item_view iv ON i.id=iv.lp_item_id ". |
|
346 | + "INNER JOIN $tbl_learnpath_view v ON iv.lp_view_id=v.id ". |
|
347 | 347 | "WHERE i.c_id = $course_id AND |
348 | 348 | iv.c_id = $course_id AND |
349 | 349 | v.c_id = $course_id AND |
350 | 350 | v.user_id=$studentId and v.lp_id=$contentId ORDER BY v.id, i.id"; |
351 | 351 | $result3 = Database::query($sql3); |
352 | 352 | $ar3 = Database::fetch_array($result3); |
353 | - $title_line .= get_lang('ScormTitleColumn') . ";" . get_lang('ScormStatusColumn') . ";" . get_lang('ScormScoreColumn') . ";" . get_lang('ScormTimeColumn'); |
|
353 | + $title_line .= get_lang('ScormTitleColumn').";".get_lang('ScormStatusColumn').";".get_lang('ScormScoreColumn').";".get_lang('ScormTimeColumn'); |
|
354 | 354 | while ($ar3['status'] != '') { |
355 | 355 | require_once '../lp/learnpathItem.class.php'; |
356 | 356 | $time = learnpathItem::getScormTimeFromParameter('php', $ar3['total_time']); |
357 | - $line .= $title . ";" . $ar3['status'] . ";" . $ar3['score'] . ";" . $time; |
|
357 | + $line .= $title.";".$ar3['status'].";".$ar3['score'].";".$time; |
|
358 | 358 | $ar3 = Database::fetch_array($result3); |
359 | 359 | } |
360 | 360 | } |
@@ -374,23 +374,23 @@ discard block |
||
374 | 374 | * Export to a CSV file |
375 | 375 | * Force the browser to save the file instead of opening it. |
376 | 376 | */ |
377 | - $len = strlen($title_line . $line); |
|
377 | + $len = strlen($title_line.$line); |
|
378 | 378 | header('Content-type: application/octet-stream'); |
379 | 379 | //header('Content-Type: application/force-download'); |
380 | - header('Content-length: ' . $len); |
|
381 | - $filename = api_html_entity_decode(str_replace(":", "", str_replace(" ", "_", $title[0] . '_' . $title[1] . '.csv'))); |
|
380 | + header('Content-length: '.$len); |
|
381 | + $filename = api_html_entity_decode(str_replace(":", "", str_replace(" ", "_", $title[0].'_'.$title[1].'.csv'))); |
|
382 | 382 | $filename = api_replace_dangerous_char($filename); |
383 | 383 | if (preg_match("/MSIE 5.5/", $_SERVER['HTTP_USER_AGENT'])) { |
384 | - header('Content-Disposition: filename= ' . $filename); |
|
384 | + header('Content-Disposition: filename= '.$filename); |
|
385 | 385 | } else { |
386 | - header('Content-Disposition: attachment; filename= ' . $filename); |
|
386 | + header('Content-Disposition: attachment; filename= '.$filename); |
|
387 | 387 | } |
388 | 388 | if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE')) { |
389 | 389 | header('Pragma: '); |
390 | 390 | header('Cache-Control: '); |
391 | 391 | header('Cache-Control: public'); // IE cannot download from sessions without a cache |
392 | 392 | } |
393 | - header('Content-Description: ' . $filename); |
|
393 | + header('Content-Description: '.$filename); |
|
394 | 394 | header('Content-transfer-encoding: binary'); |
395 | 395 | |
396 | 396 | echo api_html_entity_decode($title_line, ENT_COMPAT); |
@@ -34,8 +34,8 @@ |
||
34 | 34 | $idUserLocal = api_get_user_id(); |
35 | 35 | $userLocal = api_get_user_info($idUserLocal, true); |
36 | 36 | $htmlHeadXtra[] = '<script type="text/javascript" src="' |
37 | - . api_get_path(WEB_PATH) . 'web/assets/simpleWebRTC/latest.js' |
|
38 | - . '"></script>' . "\n"; |
|
37 | + . api_get_path(WEB_PATH).'web/assets/simpleWebRTC/latest.js' |
|
38 | + . '"></script>'."\n"; |
|
39 | 39 | |
40 | 40 | $template = new Template(); |
41 | 41 | $template->assign('room_name', $chatVideo->getRoomName()); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | global $current_tag; |
281 | 281 | switch ($data) { |
282 | 282 | case 'Contact': |
283 | - $user = array (); |
|
283 | + $user = array(); |
|
284 | 284 | break; |
285 | 285 | default: |
286 | 286 | $current_tag = $data; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $allowed_file_mimetype = array('csv', 'xml'); |
374 | 374 | $error_kind_file = false; |
375 | 375 | |
376 | - $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null; |
|
376 | + $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null; |
|
377 | 377 | |
378 | 378 | $uploadInfo = pathinfo($_FILES['import_file']['name']); |
379 | 379 | $ext_import_file = $uploadInfo['extension']; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | if (strcmp($file_type, 'csv') === 0 && |
383 | 383 | $ext_import_file == $allowed_file_mimetype[0] |
384 | 384 | ) { |
385 | - $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
385 | + $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
386 | 386 | $errors = validate_data($users, $checkUniqueEmail); |
387 | 387 | $error_kind_file = false; |
388 | 388 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $from = intval($from); |
75 | 75 | $number_of_items = intval($number_of_items); |
76 | 76 | |
77 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
77 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
78 | 78 | $direction = 'ASC'; |
79 | 79 | } |
80 | 80 | |
@@ -97,24 +97,24 @@ discard block |
||
97 | 97 | $thematic[1] = '<a href="index.php?'.api_get_cidreq().'&action=thematic_details&thematic_id='.$thematic[0].'">'. |
98 | 98 | Security::remove_XSS($thematic[1], STUDENT).$session_star.'</a>'; |
99 | 99 | if (api_is_allowed_to_edit(null, true)) { |
100 | - $actions = ''; |
|
100 | + $actions = ''; |
|
101 | 101 | |
102 | 102 | if (api_get_session_id()) { |
103 | 103 | if (api_get_session_id() == $thematic[3]) { |
104 | 104 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'. |
105 | - Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a> '; |
|
105 | + Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a> '; |
|
106 | 106 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'. |
107 | - Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a> '; |
|
107 | + Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a> '; |
|
108 | 108 | |
109 | 109 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'. |
110 | - Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
110 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
111 | 111 | $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'. |
112 | - Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
112 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
113 | 113 | } else { |
114 | - $actions .= Display::return_icon('lesson_plan_na.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).' '; |
|
115 | - $actions .= Display::return_icon('lesson_plan_calendar_na.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).' '; |
|
116 | - $actions .= Display::return_icon('edit_na.png',get_lang('Edit'),'',ICON_SIZE_SMALL); |
|
117 | - $actions .= Display::return_icon('delete_na.png',get_lang('Delete'),'',ICON_SIZE_SMALL).' '; |
|
114 | + $actions .= Display::return_icon('lesson_plan_na.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).' '; |
|
115 | + $actions .= Display::return_icon('lesson_plan_calendar_na.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).' '; |
|
116 | + $actions .= Display::return_icon('edit_na.png', get_lang('Edit'), '', ICON_SIZE_SMALL); |
|
117 | + $actions .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL).' '; |
|
118 | 118 | $actions .= Display::url( |
119 | 119 | Display::return_icon('cd.gif', get_lang('Copy')), |
120 | 120 | 'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$thematic[0] |
@@ -122,26 +122,26 @@ discard block |
||
122 | 122 | } |
123 | 123 | } else { |
124 | 124 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'. |
125 | - Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a> '; |
|
125 | + Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a> '; |
|
126 | 126 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'. |
127 | - Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a> '; |
|
127 | + Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a> '; |
|
128 | 128 | |
129 | 129 | if ($thematic[2] > 1) { |
130 | 130 | $actions .= '<a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'. |
131 | - Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>'; |
|
131 | + Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>'; |
|
132 | 132 | } else { |
133 | - $actions .= Display::return_icon('up_na.png',' ','',ICON_SIZE_SMALL); |
|
133 | + $actions .= Display::return_icon('up_na.png', ' ', '', ICON_SIZE_SMALL); |
|
134 | 134 | } |
135 | 135 | if ($thematic[2] < self::get_max_thematic_item()) { |
136 | 136 | $actions .= '<a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'. |
137 | - Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>'; |
|
137 | + Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>'; |
|
138 | 138 | } else { |
139 | - $actions .= Display::return_icon('down_na.png',' ','',ICON_SIZE_SMALL); |
|
139 | + $actions .= Display::return_icon('down_na.png', ' ', '', ICON_SIZE_SMALL); |
|
140 | 140 | } |
141 | 141 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'. |
142 | - Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
142 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
143 | 143 | $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'. |
144 | - Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
144 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
145 | 145 | } |
146 | 146 | $thematics[] = array($thematic[0], $thematic[1], $actions); |
147 | 147 | } |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | |
376 | 376 | if (is_array($thematic_id)) { |
377 | 377 | foreach ($thematic_id as $id) { |
378 | - $id = intval($id); |
|
378 | + $id = intval($id); |
|
379 | 379 | $sql = "UPDATE $tbl_thematic SET active = 0 |
380 | 380 | WHERE c_id = $course_id AND id = $id"; |
381 | 381 | $result = Database::query($sql); |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | ); |
392 | 392 | } |
393 | 393 | } |
394 | - } else { |
|
395 | - $thematic_id = intval($thematic_id); |
|
394 | + } else { |
|
395 | + $thematic_id = intval($thematic_id); |
|
396 | 396 | $sql = "UPDATE $tbl_thematic SET active = 0 |
397 | 397 | WHERE c_id = $course_id AND id = $thematic_id"; |
398 | 398 | $result = Database::query($sql); |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | $new_thematic_id = $thematic_copy->thematic_save(); |
430 | 430 | if (!empty($new_thematic_id)) { |
431 | 431 | $thematic_advanced = self::get_thematic_advance_by_thematic_id($thematic_id); |
432 | - if(!empty($thematic_advanced)) { |
|
433 | - foreach($thematic_advanced as $item) { |
|
432 | + if (!empty($thematic_advanced)) { |
|
433 | + foreach ($thematic_advanced as $item) { |
|
434 | 434 | $thematic = new Thematic(); |
435 | 435 | $thematic->set_thematic_advance_attributes( |
436 | 436 | 0, |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | $column = intval($column); |
495 | 495 | $from = intval($from); |
496 | 496 | $number_of_items = intval($number_of_items); |
497 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
497 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
498 | 498 | $direction = 'ASC'; |
499 | 499 | } |
500 | 500 | $data = array(); |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | $thematic_advance[1] = api_get_local_time($thematic_advance[1]); |
528 | 528 | $thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG); |
529 | 529 | $actions = ''; |
530 | - $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>'; |
|
531 | - $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a></center>'; |
|
530 | + $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', 22).'</a>'; |
|
531 | + $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a></center>'; |
|
532 | 532 | $data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions); |
533 | 533 | $i++; |
534 | 534 | } |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | |
593 | 593 | $session_star = ''; |
594 | 594 | if (api_is_allowed_to_edit(null, true)) { |
595 | - if ($thematic_advance['session_id'] !=0) { |
|
595 | + if ($thematic_advance['session_id'] != 0) { |
|
596 | 596 | $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']); |
597 | 597 | } |
598 | 598 | } |
@@ -618,13 +618,13 @@ discard block |
||
618 | 618 | |
619 | 619 | foreach ($data as $thematic_id => $thematic_plan_data) { |
620 | 620 | $new_thematic_plan_data = array(); |
621 | - foreach($thematic_plan_data as $thematic_item) { |
|
621 | + foreach ($thematic_plan_data as $thematic_item) { |
|
622 | 622 | $thematic_simple_list[] = $thematic_item['description_type']; |
623 | 623 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
624 | 624 | } |
625 | 625 | |
626 | 626 | if (!empty($thematic_simple_list)) { |
627 | - foreach($thematic_simple_list as $item) { |
|
627 | + foreach ($thematic_simple_list as $item) { |
|
628 | 628 | $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title']; |
629 | 629 | } |
630 | 630 | } |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | } |
641 | 641 | if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) { |
642 | 642 | if (api_is_allowed_to_edit(null, true)) { |
643 | - if ($data[$thematic_id][$id]['session_id'] !=0) { |
|
643 | + if ($data[$thematic_id][$id]['session_id'] != 0) { |
|
644 | 644 | $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']); |
645 | 645 | } |
646 | 646 | } |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | if ($no_data) { |
654 | 654 | $return .= '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>'; |
655 | 655 | } |
656 | - $return .= '</div>'; |
|
656 | + $return .= '</div>'; |
|
657 | 657 | $final_return[$thematic_id] = $return; |
658 | 658 | } |
659 | 659 | |
@@ -866,18 +866,18 @@ discard block |
||
866 | 866 | api_get_session_id() |
867 | 867 | ); |
868 | 868 | |
869 | - $thematic_plan_complete_list = array(); |
|
869 | + $thematic_plan_complete_list = array(); |
|
870 | 870 | $thematic_plan_id_list = array(); |
871 | 871 | |
872 | 872 | if (!empty($items_from_course)) { |
873 | - foreach($items_from_course as $item) { |
|
873 | + foreach ($items_from_course as $item) { |
|
874 | 874 | $thematic_plan_id_list[] = $item['ref']; |
875 | 875 | $thematic_plan_complete_list[$item['ref']] = $item; |
876 | 876 | } |
877 | 877 | } |
878 | 878 | |
879 | 879 | if (!empty($items_from_session)) { |
880 | - foreach($items_from_session as $item) { |
|
880 | + foreach ($items_from_session as $item) { |
|
881 | 881 | $thematic_plan_id_list[] = $item['ref']; |
882 | 882 | $thematic_plan_complete_list[$item['ref']] = $item; |
883 | 883 | } |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | if (!isset($thematic_id) && !isset($description_type)) { |
901 | 901 | // group all data group by thematic id |
902 | 902 | $tmp = array(); |
903 | - while ($row = Database::fetch_array($rs,'ASSOC')) { |
|
903 | + while ($row = Database::fetch_array($rs, 'ASSOC')) { |
|
904 | 904 | $tmp[] = $row['thematic_id']; |
905 | 905 | if (in_array($row['thematic_id'], $tmp)) { |
906 | 906 | $row['session_id'] = $thematic_plan_complete_list[$row['id']]; |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | } |
909 | 909 | } |
910 | 910 | } else { |
911 | - while ($row = Database::fetch_array($rs,'ASSOC')) { |
|
911 | + while ($row = Database::fetch_array($rs, 'ASSOC')) { |
|
912 | 912 | $row['session_id'] = $thematic_plan_complete_list[$row['id']]; |
913 | 913 | $data[] = $row; |
914 | 914 | } |
@@ -943,8 +943,8 @@ discard block |
||
943 | 943 | ); |
944 | 944 | |
945 | 945 | $elements_to_show = array(); |
946 | - foreach($list as $value) { |
|
947 | - $elements_to_show[]= $value['ref']; |
|
946 | + foreach ($list as $value) { |
|
947 | + $elements_to_show[] = $value['ref']; |
|
948 | 948 | } |
949 | 949 | $condition = ''; |
950 | 950 | if (!empty($elements_to_show)) { |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | c_id = $course_id AND |
957 | 957 | thematic_id = $thematic_id AND |
958 | 958 | description_type = '$description_type'"; |
959 | - $rs = Database::query($sql); |
|
959 | + $rs = Database::query($sql); |
|
960 | 960 | |
961 | 961 | $affected_rows = 0; |
962 | 962 | if (Database::num_rows($rs) > 0) { |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | $diff = array_diff($all, $a_thematic_advance_ids); |
1191 | 1191 | if (!empty($diff)) { |
1192 | 1192 | $upd = "UPDATE $tbl_thematic_advance SET done_advance = 0 |
1193 | - WHERE c_id = $course_id AND id IN(".implode(',',$diff).") "; |
|
1193 | + WHERE c_id = $course_id AND id IN(".implode(',', $diff).") "; |
|
1194 | 1194 | Database::query($upd); |
1195 | 1195 | } |
1196 | 1196 | |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | $course_code = api_get_course_id(); |
1306 | 1306 | } |
1307 | 1307 | if (api_get_session_id()) { |
1308 | - $thematic_data = $this->get_thematic_list(null, $course_code ); |
|
1308 | + $thematic_data = $this->get_thematic_list(null, $course_code); |
|
1309 | 1309 | } else { |
1310 | 1310 | $thematic_data = $this->get_thematic_list(null, $course_code, 0); |
1311 | 1311 | } |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | } |
1362 | 1362 | // calculate average by thematic |
1363 | 1363 | $count_total_advances = count($advances); |
1364 | - $average = round(($count_done_advances*100)/$count_total_advances); |
|
1364 | + $average = round(($count_done_advances * 100) / $count_total_advances); |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | return $average; |
@@ -1451,12 +1451,12 @@ discard block |
||
1451 | 1451 | public function get_default_thematic_plan_title() |
1452 | 1452 | { |
1453 | 1453 | $default_thematic_plan_titles = array(); |
1454 | - $default_thematic_plan_titles[1]= get_lang('Objectives'); |
|
1455 | - $default_thematic_plan_titles[2]= get_lang('SkillToAcquire'); |
|
1456 | - $default_thematic_plan_titles[3]= get_lang('Methodology'); |
|
1457 | - $default_thematic_plan_titles[4]= get_lang('Infrastructure'); |
|
1458 | - $default_thematic_plan_titles[5]= get_lang('Assessment'); |
|
1459 | - $default_thematic_plan_titles[6]= get_lang('Others'); |
|
1454 | + $default_thematic_plan_titles[1] = get_lang('Objectives'); |
|
1455 | + $default_thematic_plan_titles[2] = get_lang('SkillToAcquire'); |
|
1456 | + $default_thematic_plan_titles[3] = get_lang('Methodology'); |
|
1457 | + $default_thematic_plan_titles[4] = get_lang('Infrastructure'); |
|
1458 | + $default_thematic_plan_titles[5] = get_lang('Assessment'); |
|
1459 | + $default_thematic_plan_titles[6] = get_lang('Others'); |
|
1460 | 1460 | |
1461 | 1461 | return $default_thematic_plan_titles; |
1462 | 1462 | } |
@@ -1468,12 +1468,12 @@ discard block |
||
1468 | 1468 | public function get_default_thematic_plan_icon() |
1469 | 1469 | { |
1470 | 1470 | $default_thematic_plan_icon = array(); |
1471 | - $default_thematic_plan_icon[1]= 'icons/32/objective.png'; |
|
1472 | - $default_thematic_plan_icon[2]= 'icons/32/skills.png'; |
|
1473 | - $default_thematic_plan_icon[3]= 'icons/32/strategy.png'; |
|
1474 | - $default_thematic_plan_icon[4]= 'icons/32/laptop.png'; |
|
1475 | - $default_thematic_plan_icon[5]= 'icons/32/assessment.png'; |
|
1476 | - $default_thematic_plan_icon[6]= 'icons/32/wizard.png'; |
|
1471 | + $default_thematic_plan_icon[1] = 'icons/32/objective.png'; |
|
1472 | + $default_thematic_plan_icon[2] = 'icons/32/skills.png'; |
|
1473 | + $default_thematic_plan_icon[3] = 'icons/32/strategy.png'; |
|
1474 | + $default_thematic_plan_icon[4] = 'icons/32/laptop.png'; |
|
1475 | + $default_thematic_plan_icon[5] = 'icons/32/assessment.png'; |
|
1476 | + $default_thematic_plan_icon[6] = 'icons/32/wizard.png'; |
|
1477 | 1477 | |
1478 | 1478 | return $default_thematic_plan_icon; |
1479 | 1479 | } |
@@ -1485,11 +1485,11 @@ discard block |
||
1485 | 1485 | public function get_default_question() |
1486 | 1486 | { |
1487 | 1487 | $question = array(); |
1488 | - $question[1]= get_lang('ObjectivesQuestions'); |
|
1489 | - $question[2]= get_lang('SkillToAcquireQuestions'); |
|
1490 | - $question[3]= get_lang('MethodologyQuestions'); |
|
1491 | - $question[4]= get_lang('InfrastructureQuestions'); |
|
1492 | - $question[5]= get_lang('AssessmentQuestions'); |
|
1488 | + $question[1] = get_lang('ObjectivesQuestions'); |
|
1489 | + $question[2] = get_lang('SkillToAcquireQuestions'); |
|
1490 | + $question[3] = get_lang('MethodologyQuestions'); |
|
1491 | + $question[4] = get_lang('InfrastructureQuestions'); |
|
1492 | + $question[5] = get_lang('AssessmentQuestions'); |
|
1493 | 1493 | |
1494 | 1494 | return $question; |
1495 | 1495 | } |