@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | $doc_url = str_replace(' ', '+', $doc_url); |
32 | 32 | $doc_url = str_replace('/..', '', $doc_url); //echo $doc_url; |
33 | 33 | |
34 | -if (! isset($_course)) { |
|
34 | +if (!isset($_course)) { |
|
35 | 35 | api_not_allowed(true); |
36 | 36 | } |
37 | 37 | |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | exit; |
52 | 52 | } |
53 | 53 | |
54 | -$tbl_forum_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT); |
|
54 | +$tbl_forum_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT); |
|
55 | 55 | $tbl_forum_post = Database::get_course_table(TABLE_FORUM_POST); |
56 | 56 | |
57 | 57 | $course_id = api_get_course_int_id(); |
58 | -$courseInfo = api_get_course_info_by_id($course_id); |
|
58 | +$courseInfo = api_get_course_info_by_id($course_id); |
|
59 | 59 | |
60 | 60 | // launch event |
61 | 61 | Event::event_download($doc_url); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | api_get_session_id() |
86 | 86 | ); |
87 | 87 | |
88 | -if ($forum_thread_visibility==1 && $forum_forum_visibility==1) { |
|
88 | +if ($forum_thread_visibility == 1 && $forum_forum_visibility == 1) { |
|
89 | 89 | if (Security::check_abs_path( |
90 | 90 | $full_file_name, |
91 | 91 | api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/upload/forum/') |
@@ -457,8 +457,8 @@ |
||
457 | 457 | |
458 | 458 | // The post has been displayed => it can be removed from the what's new array |
459 | 459 | if (isset($whatsnew_post_info[$forumId][$threadId][$row['post_id']])) { |
460 | - unset($whatsnew_post_info[$forumId][$threadId][$row['post_id']]); |
|
461 | - unset($_SESSION['whatsnew_post_info'][$forumId][$threadId][$row['post_id']]); |
|
460 | + unset($whatsnew_post_info[$forumId][$threadId][$row['post_id']]); |
|
461 | + unset($_SESSION['whatsnew_post_info'][$forumId][$threadId][$row['post_id']]); |
|
462 | 462 | } |
463 | 463 | echo "</table>"; |
464 | 464 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * @package chamilo.forum |
22 | 22 | */ |
23 | 23 | |
24 | -$forumUrl = api_get_path(WEB_CODE_PATH) . 'forum/'; |
|
24 | +$forumUrl = api_get_path(WEB_CODE_PATH).'forum/'; |
|
25 | 25 | $_user = api_get_user_info(); |
26 | 26 | $sortDirection = isset($_GET['posts_order']) && $_GET['posts_order'] === 'desc' ? 'DESC' : 'ASC'; |
27 | 27 | $rows = getPosts($current_forum, $_GET['thread'], $sortDirection, true); |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | // Are we in a lp ? |
43 | 43 | $origin = ''; |
44 | 44 | if (isset($_GET['origin'])) { |
45 | - $origin = Security::remove_XSS($_GET['origin']); |
|
45 | + $origin = Security::remove_XSS($_GET['origin']); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | // Delete attachment file. |
49 | 49 | if ( |
50 | 50 | isset($_GET['action']) && |
51 | - $_GET['action']=='delete_attach' && |
|
51 | + $_GET['action'] == 'delete_attach' && |
|
52 | 52 | isset($_GET['id_attach']) |
53 | 53 | ) { |
54 | 54 | delete_attachment(0, $_GET['id_attach']); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | // Displaying the thread (structure) |
61 | 61 | |
62 | -$thread_structure = "<div class=\"structure\">" .get_lang('Structure')."</div>"; |
|
62 | +$thread_structure = "<div class=\"structure\">".get_lang('Structure')."</div>"; |
|
63 | 63 | $counter = 0; |
64 | 64 | $count = 0; |
65 | 65 | $prev_next_array = array(); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | foreach ($rows as $post) { |
72 | 72 | $counter++; |
73 | 73 | $indent = $post['indent_cnt'] * '20'; |
74 | - $thread_structure .= "<div style=\"margin-left: " . $indent . "px;\">"; |
|
74 | + $thread_structure .= "<div style=\"margin-left: ".$indent."px;\">"; |
|
75 | 75 | |
76 | 76 | if ( |
77 | 77 | !empty($whatsnew_post_info[$forumId][$post['thread_id']]) && |
@@ -89,13 +89,13 @@ discard block |
||
89 | 89 | $counter == 1 AND !isset($_GET['post']) |
90 | 90 | ) |
91 | 91 | ) { |
92 | - $thread_structure .= '<strong>' .prepare4display($post['post_title']) . '</strong>'; |
|
92 | + $thread_structure .= '<strong>'.prepare4display($post['post_title']).'</strong>'; |
|
93 | 93 | $prev_next_array[] = $post['post_id']; |
94 | 94 | } else { |
95 | 95 | $count_loop = ($count == 0) ? '&id=1' : ''; |
96 | 96 | $thread_structure .= Display::url( |
97 | 97 | prepare4display($post['post_title']), |
98 | - 'viewthread.php?' . api_get_cidreq() . "$count_loop&" . http_build_query([ |
|
98 | + 'viewthread.php?'.api_get_cidreq()."$count_loop&".http_build_query([ |
|
99 | 99 | 'forum' => $forumId, |
100 | 100 | 'thread' => $threadId, |
101 | 101 | 'post' => $post['post_id'] |
@@ -151,43 +151,43 @@ discard block |
||
151 | 151 | $class_next = ''; |
152 | 152 | |
153 | 153 | // Links |
154 | -$first_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
155 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
156 | - '&gradebook=' . $gradebook . '&id=1&post=' . $prev_next_array[0]; |
|
157 | -$last_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
158 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
159 | - '&gradebook=' . $gradebook . '&post=' . $prev_next_array[$max-1]; |
|
160 | -$prev_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
161 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
162 | - '&gradebook=' . $gradebook . '&post=' . $prev_next_array[$prev_id]; |
|
163 | -$next_href = $forumUrl . 'viewthread.php?' . api_get_cidreq() . |
|
164 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
165 | - '&post=' . $prev_next_array[$next_id]; |
|
154 | +$first_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
155 | + '&forum='.$forumId.'&thread='.$threadId. |
|
156 | + '&gradebook='.$gradebook.'&id=1&post='.$prev_next_array[0]; |
|
157 | +$last_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
158 | + '&forum='.$forumId.'&thread='.$threadId. |
|
159 | + '&gradebook='.$gradebook.'&post='.$prev_next_array[$max - 1]; |
|
160 | +$prev_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
161 | + '&forum='.$forumId.'&thread='.$threadId. |
|
162 | + '&gradebook='.$gradebook.'&post='.$prev_next_array[$prev_id]; |
|
163 | +$next_href = $forumUrl.'viewthread.php?'.api_get_cidreq(). |
|
164 | + '&forum='.$forumId.'&thread='.$threadId. |
|
165 | + '&post='.$prev_next_array[$next_id]; |
|
166 | 166 | |
167 | 167 | echo '<center style="margin-top: 10px; margin-bottom: 10px;">'; |
168 | 168 | // Go to: first and previous |
169 | 169 | if (((int) $current_id) > 0) { |
170 | - echo '<a href="' . $first_href . '" ' . $class . ' title=' . |
|
171 | - $first_message . '>' . $first_img . ' ' . $first_message .'</a>'; |
|
172 | - echo '<a href="' . $prev_href . '" ' . $class_prev . ' title=' . |
|
173 | - $prev_message . '>' . $prev_img . ' ' . $prev_message . '</a>'; |
|
170 | + echo '<a href="'.$first_href.'" '.$class.' title='. |
|
171 | + $first_message.'>'.$first_img.' '.$first_message.'</a>'; |
|
172 | + echo '<a href="'.$prev_href.'" '.$class_prev.' title='. |
|
173 | + $prev_message.'>'.$prev_img.' '.$prev_message.'</a>'; |
|
174 | 174 | } else { |
175 | - echo '<strong class="text-muted">' . |
|
176 | - $first_img . ' ' . $first_message . '</strong>'; |
|
177 | - echo '<strong class="text-muted">' . |
|
178 | - $prev_img . ' ' . $prev_message . '</strong>'; |
|
175 | + echo '<strong class="text-muted">'. |
|
176 | + $first_img.' '.$first_message.'</strong>'; |
|
177 | + echo '<strong class="text-muted">'. |
|
178 | + $prev_img.' '.$prev_message.'</strong>'; |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | // Current counter |
182 | -echo ' [ ' . ($current_id + 1) . ' / ' . $max . ' ] '; |
|
182 | +echo ' [ '.($current_id + 1).' / '.$max.' ] '; |
|
183 | 183 | |
184 | 184 | // Go to: next and last |
185 | 185 | if (($current_id + 1) < $max) { |
186 | - echo '<a href="' . $next_href . '" ' . $class_next . ' title=' . $next_message . '>' . $next_message . ' ' . $next_img . '</a>'; |
|
187 | - echo '<a href="' . $last_href . '" ' . $class . ' title=' . $last_message . '>' . $last_message . ' ' . $last_img . '</a>'; |
|
186 | + echo '<a href="'.$next_href.'" '.$class_next.' title='.$next_message.'>'.$next_message.' '.$next_img.'</a>'; |
|
187 | + echo '<a href="'.$last_href.'" '.$class.' title='.$last_message.'>'.$last_message.' '.$last_img.'</a>'; |
|
188 | 188 | } else { |
189 | - echo '<strong class="text-muted">' . $next_message . ' ' . $next_img . '</strong>'; |
|
190 | - echo '<strong class="text-muted">' . $last_message . ' ' . $last_img . '</strong>'; |
|
189 | + echo '<strong class="text-muted">'.$next_message.' '.$next_img.'</strong>'; |
|
190 | + echo '<strong class="text-muted">'.$last_message.' '.$last_img.'</strong>'; |
|
191 | 191 | } |
192 | 192 | echo '</center>'; |
193 | 193 | |
@@ -221,18 +221,18 @@ discard block |
||
221 | 221 | } |
222 | 222 | |
223 | 223 | if (api_get_course_setting('allow_user_image_forum')) { |
224 | - echo '<br />' . display_user_image($rows[$display_post_id]['user_id'], $name, $origin) . '<br />'; |
|
224 | + echo '<br />'.display_user_image($rows[$display_post_id]['user_id'], $name, $origin).'<br />'; |
|
225 | 225 | } |
226 | 226 | echo display_user_link( |
227 | 227 | $rows[$display_post_id]['user_id'], |
228 | 228 | $name, |
229 | 229 | $origin, |
230 | 230 | $username |
231 | -) . "<br />"; |
|
231 | +)."<br />"; |
|
232 | 232 | |
233 | 233 | echo api_convert_and_format_date( |
234 | 234 | $rows[$display_post_id]['post_date'] |
235 | -) . '<br /><br />'; |
|
235 | +).'<br /><br />'; |
|
236 | 236 | // Get attach id |
237 | 237 | $attachment_list = get_attachment($display_post_id); |
238 | 238 | $id_attach = !empty($attachment_list) ? $attachment_list['id'] : ''; |
@@ -252,16 +252,16 @@ discard block |
||
252 | 252 | ) |
253 | 253 | ) { |
254 | 254 | if ($locked == false) { |
255 | - echo "<a href=\"editpost.php?" . api_get_cidreq() . |
|
256 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
257 | - "&post=" . $rows[$display_post_id]['post_id'] . |
|
258 | - "&id_attach=" . $id_attach . "\">" . |
|
255 | + echo "<a href=\"editpost.php?".api_get_cidreq(). |
|
256 | + "&forum=".$forumId."&thread=".$threadId. |
|
257 | + "&post=".$rows[$display_post_id]['post_id']. |
|
258 | + "&id_attach=".$id_attach."\">". |
|
259 | 259 | Display::return_icon( |
260 | 260 | 'edit.png', |
261 | 261 | get_lang('Edit'), |
262 | 262 | array(), |
263 | 263 | ICON_SIZE_SMALL |
264 | - ) . '</a>'; |
|
264 | + ).'</a>'; |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | sort($id_posts, SORT_NUMERIC); |
278 | 278 | reset($id_posts); |
279 | 279 | // The post minor |
280 | - $post_minor = (int)$id_posts[0]; |
|
280 | + $post_minor = (int) $id_posts[0]; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | if ( |
@@ -286,13 +286,13 @@ discard block |
||
286 | 286 | !(api_is_course_coach() && $current_forum['session_id'] != $sessionId) |
287 | 287 | ) { |
288 | 288 | if ($locked == false) { |
289 | - echo "<a href=\"" . api_get_self() . "?" . api_get_cidreq() . |
|
290 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
291 | - "&action=delete&content=post&id=" . |
|
292 | - $rows[$display_post_id]['post_id'] . |
|
293 | - "\" onclick=\"javascript:if(!confirm('" . |
|
294 | - addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)) . |
|
295 | - "')) return false;\">" . Display::return_icon( |
|
289 | + echo "<a href=\"".api_get_self()."?".api_get_cidreq(). |
|
290 | + "&forum=".$forumId."&thread=".$threadId. |
|
291 | + "&action=delete&content=post&id=". |
|
292 | + $rows[$display_post_id]['post_id']. |
|
293 | + "\" onclick=\"javascript:if(!confirm('". |
|
294 | + addslashes(api_htmlentities(get_lang('DeletePost'), ENT_QUOTES)). |
|
295 | + "')) return false;\">".Display::return_icon( |
|
296 | 296 | 'delete.png', |
297 | 297 | get_lang('Delete'), |
298 | 298 | array(), |
@@ -311,16 +311,16 @@ discard block |
||
311 | 311 | ); |
312 | 312 | |
313 | 313 | if (!isset($_GET['id']) && $post_id > $post_minor) { |
314 | - echo "<a href=\"viewthread.php?" . api_get_cidreq() . |
|
315 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
316 | - "&action=move&post=" . |
|
317 | - $rows[$display_post_id]['post_id'] . "\">" . |
|
314 | + echo "<a href=\"viewthread.php?".api_get_cidreq(). |
|
315 | + "&forum=".$forumId."&thread=".$threadId. |
|
316 | + "&action=move&post=". |
|
317 | + $rows[$display_post_id]['post_id']."\">". |
|
318 | 318 | Display::return_icon( |
319 | 319 | 'move.png', |
320 | 320 | get_lang('MovePost'), |
321 | 321 | array(), |
322 | 322 | ICON_SIZE_SMALL |
323 | - ) . "</a>"; |
|
323 | + )."</a>"; |
|
324 | 324 | |
325 | 325 | } |
326 | 326 | } |
@@ -343,16 +343,16 @@ discard block |
||
343 | 343 | ); |
344 | 344 | |
345 | 345 | if ($locked == false) { |
346 | - echo "<a href=\"forumqualify.php?" . api_get_cidreq() . |
|
347 | - "&forum=" . $forumId . "&thread=" . $threadId . |
|
348 | - "&action=list&post=" . $rows[$display_post_id]['post_id'] . |
|
349 | - "&user=" . $rows[$display_post_id]['user_id'] . "&user_id=" . |
|
350 | - $rows[$display_post_id]['user_id'] . "&origin=" . $origin . |
|
351 | - "&idtextqualify=" . $current_qualify_thread . |
|
352 | - "\" >" . Display::return_icon( |
|
346 | + echo "<a href=\"forumqualify.php?".api_get_cidreq(). |
|
347 | + "&forum=".$forumId."&thread=".$threadId. |
|
348 | + "&action=list&post=".$rows[$display_post_id]['post_id']. |
|
349 | + "&user=".$rows[$display_post_id]['user_id']."&user_id=". |
|
350 | + $rows[$display_post_id]['user_id']."&origin=".$origin. |
|
351 | + "&idtextqualify=".$current_qualify_thread. |
|
352 | + "\" >".Display::return_icon( |
|
353 | 353 | 'quiz.png', |
354 | 354 | get_lang('Qualify') |
355 | - ) . "</a>"; |
|
355 | + )."</a>"; |
|
356 | 356 | } |
357 | 357 | } |
358 | 358 | } |
@@ -364,33 +364,33 @@ discard block |
||
364 | 364 | ($current_forum['allow_anonymous'] == 1 && !$_user['user_id']) |
365 | 365 | ) { |
366 | 366 | if (!api_is_anonymous() && api_is_allowed_to_session_edit(false, true)) { |
367 | - echo '<a href="reply.php?' . api_get_cidreq() . |
|
368 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
369 | - '&post=' . $rows[$display_post_id]['post_id'] . |
|
370 | - '&action=replymessage">' . |
|
367 | + echo '<a href="reply.php?'.api_get_cidreq(). |
|
368 | + '&forum='.$forumId.'&thread='.$threadId. |
|
369 | + '&post='.$rows[$display_post_id]['post_id']. |
|
370 | + '&action=replymessage">'. |
|
371 | 371 | Display::return_icon( |
372 | 372 | 'message_reply_forum.png', |
373 | 373 | get_lang('ReplyToMessage') |
374 | - ) . "</a>"; |
|
375 | - echo '<a href="reply.php?' . api_get_cidreq() . |
|
376 | - '&forum=' . $forumId . '&thread=' . $threadId . |
|
377 | - '&post=' . $rows[$display_post_id]['post_id'] . |
|
378 | - '&action=quote">' . |
|
374 | + )."</a>"; |
|
375 | + echo '<a href="reply.php?'.api_get_cidreq(). |
|
376 | + '&forum='.$forumId.'&thread='.$threadId. |
|
377 | + '&post='.$rows[$display_post_id]['post_id']. |
|
378 | + '&action=quote">'. |
|
379 | 379 | Display::return_icon( |
380 | 380 | 'quote.gif', |
381 | 381 | get_lang('QuoteMessage') |
382 | - ) . "</a>"; |
|
382 | + )."</a>"; |
|
383 | 383 | } |
384 | 384 | } |
385 | 385 | } else { |
386 | 386 | if ($current_forum_category && $current_forum_category['locked'] == 1) { |
387 | - echo get_lang('ForumcategoryLocked') . '<br />'; |
|
387 | + echo get_lang('ForumcategoryLocked').'<br />'; |
|
388 | 388 | } |
389 | 389 | if ($current_forum['locked'] == 1) { |
390 | - echo get_lang('ForumLocked') . '<br />'; |
|
390 | + echo get_lang('ForumLocked').'<br />'; |
|
391 | 391 | } |
392 | 392 | if ($current_thread['locked'] == 1) { |
393 | - echo get_lang('ThreadLocked') . '<br />'; |
|
393 | + echo get_lang('ThreadLocked').'<br />'; |
|
394 | 394 | } |
395 | 395 | } |
396 | 396 | |
@@ -409,17 +409,17 @@ discard block |
||
409 | 409 | $rows[$display_post_id]['post_notification'] == '1' AND |
410 | 410 | $rows[$display_post_id]['poster_id'] == $_user['user_id'] |
411 | 411 | ) { |
412 | - $post_image .= Display::return_icon('forumnotification.gif',get_lang('YouWillBeNotified')); |
|
412 | + $post_image .= Display::return_icon('forumnotification.gif', get_lang('YouWillBeNotified')); |
|
413 | 413 | } |
414 | 414 | // The post title |
415 | -echo "<td class=\"$titleclass\">" . |
|
416 | - prepare4display($rows[$display_post_id]['post_title']) . "</td>"; |
|
415 | +echo "<td class=\"$titleclass\">". |
|
416 | + prepare4display($rows[$display_post_id]['post_title'])."</td>"; |
|
417 | 417 | echo "</tr>"; |
418 | 418 | |
419 | 419 | // The post message |
420 | 420 | echo "<tr>"; |
421 | -echo "<td class=\"$messageclass\">" . |
|
422 | - prepare4display($rows[$display_post_id]['post_text']) . "</td>"; |
|
421 | +echo "<td class=\"$messageclass\">". |
|
422 | + prepare4display($rows[$display_post_id]['post_text'])."</td>"; |
|
423 | 423 | echo "</tr>"; |
424 | 424 | |
425 | 425 | // The check if there is an attachment |
@@ -432,21 +432,21 @@ discard block |
||
432 | 432 | echo Display::return_icon('attachment.gif', get_lang('Attachment')); |
433 | 433 | echo '<a href="download.php?file='; |
434 | 434 | echo $realname; |
435 | - echo ' "> ' . $user_filename . ' </a>'; |
|
436 | - echo '<span class="forum_attach_comment">' . |
|
437 | - Security::remove_XSS($attachment['comment'], STUDENT) . '</span>'; |
|
435 | + echo ' "> '.$user_filename.' </a>'; |
|
436 | + echo '<span class="forum_attach_comment">'. |
|
437 | + Security::remove_XSS($attachment['comment'], STUDENT).'</span>'; |
|
438 | 438 | |
439 | 439 | if ( |
440 | - ($current_forum['allow_edit'] == 1 &&$rows[$display_post_id]['user_id'] == $_user['user_id']) || |
|
440 | + ($current_forum['allow_edit'] == 1 && $rows[$display_post_id]['user_id'] == $_user['user_id']) || |
|
441 | 441 | (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $sessionId)) |
442 | 442 | ) { |
443 | - echo ' <a href="' . api_get_self() . '?' . |
|
444 | - api_get_cidreq() . '&action=delete_attach&id_attach=' .$attachment['id'] . '&forum=' . $forumId . |
|
445 | - '&thread=' . $threadId . |
|
446 | - '" onclick="javascript:if(!confirm(\'' . |
|
443 | + echo ' <a href="'.api_get_self().'?'. |
|
444 | + api_get_cidreq().'&action=delete_attach&id_attach='.$attachment['id'].'&forum='.$forumId. |
|
445 | + '&thread='.$threadId. |
|
446 | + '" onclick="javascript:if(!confirm(\''. |
|
447 | 447 | addslashes(api_htmlentities( |
448 | 448 | get_lang('ConfirmYourChoice'), ENT_QUOTES) |
449 | - ) . '\')) return false;">' . Display::return_icon( |
|
449 | + ).'\')) return false;">'.Display::return_icon( |
|
450 | 450 | 'delete.gif', |
451 | 451 | get_lang('Delete') |
452 | 452 | ).'</a><br />'; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | echo "<tr>"; |
82 | 82 | echo "<td rowspan=\"2\" class=\"forum_message_left\">"; |
83 | 83 | $username = api_htmlentities(sprintf(get_lang('LoginX'), $row['username']), ENT_QUOTES); |
84 | - if ($row['user_id']=='0') { |
|
84 | + if ($row['user_id'] == '0') { |
|
85 | 85 | $name = $row['poster_name']; |
86 | 86 | } else { |
87 | 87 | $name = api_get_person_name($row['firstname'], $row['lastname']); |
@@ -500,7 +500,7 @@ |
||
500 | 500 | $html .= '</div>'; |
501 | 501 | $html .= '</div></div>'; |
502 | 502 | } |
503 | - echo $html; |
|
503 | + echo $html; |
|
504 | 504 | } |
505 | 505 | } |
506 | 506 | if (count($forum_list) == 0) { |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | $origin = ''; |
53 | 53 | |
54 | 54 | if (isset($_GET['origin'])) { |
55 | - $origin = Security::remove_XSS($_GET['origin']); |
|
55 | + $origin = Security::remove_XSS($_GET['origin']); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /* Header and Breadcrumbs */ |
59 | 59 | $gradebook = null; |
60 | 60 | if (isset($_SESSION['gradebook'])) { |
61 | - $gradebook= $_SESSION['gradebook']; |
|
61 | + $gradebook = $_SESSION['gradebook']; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | if (!empty($gradebook) && $gradebook == 'view') { |
65 | - $interbreadcrumb[] = array ( |
|
65 | + $interbreadcrumb[] = array( |
|
66 | 66 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
67 | 67 | 'name' => get_lang('ToolGradebook') |
68 | 68 | ); |
@@ -72,15 +72,15 @@ discard block |
||
72 | 72 | |
73 | 73 | $current_forum_category = get_forum_categories($_GET['forumcategory']); |
74 | 74 | $interbreadcrumb[] = array( |
75 | - 'url' => 'index.php?gradebook=' . $gradebook . '&search=' |
|
75 | + 'url' => 'index.php?gradebook='.$gradebook.'&search=' |
|
76 | 76 | . Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')), |
77 | 77 | 'name' => get_lang('Forum') |
78 | 78 | ); |
79 | 79 | |
80 | 80 | if (!empty($_GET['action']) && !empty($_GET['content'])) { |
81 | - if ($_GET['action']=='add' && $_GET['content']=='forum' ) { |
|
81 | + if ($_GET['action'] == 'add' && $_GET['content'] == 'forum') { |
|
82 | 82 | $interbreadcrumb[] = array( |
83 | - 'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='. $current_forum_category['cat_id'], |
|
83 | + 'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.$current_forum_category['cat_id'], |
|
84 | 84 | 'name' => $current_forum_category['cat_title'] |
85 | 85 | ); |
86 | 86 | $interbreadcrumb[] = array( |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // then the user is not allowed here. |
111 | 111 | if ( |
112 | 112 | !api_is_allowed_to_edit(false, true) AND |
113 | - ( $current_forum_category && $current_forum_category['visibility'] == 0) |
|
113 | + ($current_forum_category && $current_forum_category['visibility'] == 0) |
|
114 | 114 | ) { |
115 | 115 | api_not_allowed(); |
116 | 116 | } |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | $html .= '<div class="actions">'; |
121 | 121 | $html .= '<a href="index.php?gradebook='.$gradebook.'&'.api_get_cidreq().'">'. |
122 | 122 | Display::return_icon('back.png', get_lang('BackToForumOverview'), '', ICON_SIZE_MEDIUM).'</a>'; |
123 | -if (api_is_allowed_to_edit(false,true)) { |
|
124 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' |
|
125 | - . $current_forum_category['cat_id'] . '&action=add&content=forum"> ' |
|
126 | - . Display::return_icon('new_forum.png', get_lang('AddForum'), '', ICON_SIZE_MEDIUM) . '</a>'; |
|
123 | +if (api_is_allowed_to_edit(false, true)) { |
|
124 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory=' |
|
125 | + . $current_forum_category['cat_id'].'&action=add&content=forum"> ' |
|
126 | + . Display::return_icon('new_forum.png', get_lang('AddForum'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
127 | 127 | } |
128 | 128 | $html .= search_link(); |
129 | 129 | $html .= '</div>'; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $forum_categories_list = ''; |
184 | 184 | $forumId = $forum_category['cat_id']; |
185 | 185 | $forumTitle = $forum_category['cat_title']; |
186 | - $linkForumCategory = 'viewforumcategory.php?' . api_get_cidreq() . '&forumcategory=' . strval(intval($forumId)); |
|
186 | + $linkForumCategory = 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.strval(intval($forumId)); |
|
187 | 187 | $descriptionCategory = $forum_category['cat_comment']; |
188 | 188 | $icoCategory = Display::return_icon( |
189 | 189 | 'forum_blue.png', |
@@ -194,16 +194,16 @@ discard block |
||
194 | 194 | |
195 | 195 | if (api_is_allowed_to_edit(false, true) && !($forum_category['session_id'] == 0 && $sessionId != 0)) { |
196 | 196 | |
197 | - $iconsEdit = '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' |
|
198 | - . Security::remove_XSS($_GET['forumcategory']) . '&action=edit&content=forumcategory&id=' |
|
199 | - . '' . $forumId . '">' |
|
200 | - . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
201 | - $iconsEdit .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' |
|
197 | + $iconsEdit = '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory=' |
|
198 | + . Security::remove_XSS($_GET['forumcategory']).'&action=edit&content=forumcategory&id=' |
|
199 | + . ''.$forumId.'">' |
|
200 | + . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
201 | + $iconsEdit .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory=' |
|
202 | 202 | . Security::remove_XSS($_GET['forumcategory']) |
203 | - . '&action=delete&content=forumcategory&id=' . $forumId |
|
203 | + . '&action=delete&content=forumcategory&id='.$forumId |
|
204 | 204 | . "\" onclick=\"javascript:if(!confirm('" |
205 | 205 | . addslashes(api_htmlentities(get_lang('DeleteForumCategory'), ENT_QUOTES)) |
206 | - . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) |
|
206 | + . "')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL) |
|
207 | 207 | . '</a>'; |
208 | 208 | $iconsEdit .= return_visible_invisible_icon( |
209 | 209 | 'forumcategory', $forum_category['cat_id'], |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | ); |
244 | 244 | |
245 | 245 | |
246 | - if ($descriptionCategory != '' && trim($descriptionCategory)!= ' ') { |
|
246 | + if ($descriptionCategory != '' && trim($descriptionCategory) != ' ') { |
|
247 | 247 | $html .= '<div class="forum-description">'.$descriptionCategory.'</div>'; |
248 | 248 | } |
249 | 249 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | // SHOULD WE SHOW THIS PARTICULAR FORUM |
268 | 268 | // you are teacher => show forum |
269 | 269 | |
270 | - if (api_is_allowed_to_edit(false,true)) { |
|
270 | + if (api_is_allowed_to_edit(false, true)) { |
|
271 | 271 | //echo 'teacher'; |
272 | 272 | $show_forum = true; |
273 | 273 | } else { |
@@ -334,9 +334,9 @@ discard block |
||
334 | 334 | ? $all_groups[$forum['forum_of_group']]['id'] |
335 | 335 | : null; |
336 | 336 | $group_title = api_substr($my_all_groups_forum_name, 0, 30); |
337 | - $forum_title_group_addition = ' (<a href="../group/group_space.php?' . api_get_cidreq() |
|
338 | - . '&gidReq=' . $my_all_groups_forum_id . '" class="forum_group_link">' |
|
339 | - . get_lang('GoTo') . ' ' . $group_title . '</a>)'; |
|
337 | + $forum_title_group_addition = ' (<a href="../group/group_space.php?'.api_get_cidreq() |
|
338 | + . '&gidReq='.$my_all_groups_forum_id.'" class="forum_group_link">' |
|
339 | + . get_lang('GoTo').' '.$group_title.'</a>)'; |
|
340 | 340 | } else { |
341 | 341 | $forum_title_group_addition = ''; |
342 | 342 | } |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | $html .= '<div class="row">'; |
355 | 355 | $html .= '<div class="col-md-6">'; |
356 | 356 | $html .= '<div class="col-md-3">'; |
357 | - $html .= '<div class="number-post">'.$forum_image .'<p>' . $my_number_threads . ' ' . get_lang('ForumThreads') . '</p></div>'; |
|
357 | + $html .= '<div class="number-post">'.$forum_image.'<p>'.$my_number_threads.' '.get_lang('ForumThreads').'</p></div>'; |
|
358 | 358 | $html .= '</div>'; |
359 | 359 | |
360 | 360 | $html .= '<div class="col-md-9">'; |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | 'a', |
370 | 370 | $forum['forum_title'].$session_displayed, |
371 | 371 | array( |
372 | - 'href' => 'viewforum.php?' . api_get_cidreq() |
|
372 | + 'href' => 'viewforum.php?'.api_get_cidreq() |
|
373 | 373 | . "&gidReq={$forum['forum_of_group']}&forum={$forum['forum_id']}&search=" |
374 | 374 | . Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')), |
375 | 375 | 'class' => empty($forum['visibility']) ? 'text-muted' : null |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | ); |
378 | 378 | $html .= Display::tag( |
379 | 379 | 'h3', |
380 | - $linkForum . ' ' . $forum_title_group_addition, |
|
380 | + $linkForum.' '.$forum_title_group_addition, |
|
381 | 381 | array( |
382 | 382 | 'class' => 'title' |
383 | 383 | ) |
@@ -393,19 +393,19 @@ discard block |
||
393 | 393 | $html .= '</div>'; |
394 | 394 | $html .= '<div class="col-md-6">'; |
395 | 395 | |
396 | - $iconEmpty=''; |
|
396 | + $iconEmpty = ''; |
|
397 | 397 | |
398 | 398 | // The number of topics and posts. |
399 | 399 | if ($forum['forum_of_group'] !== '0') { |
400 | 400 | $newPost = ''; |
401 | 401 | if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) { |
402 | - $newPost = ' ' . Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
402 | + $newPost = ' '.Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
403 | 403 | } else { |
404 | 404 | $newPost = $iconEmpty; |
405 | 405 | } |
406 | 406 | } else { |
407 | 407 | if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) { |
408 | - $newPost = ' ' . Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
408 | + $newPost = ' '.Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL); |
|
409 | 409 | } else { |
410 | 410 | $newPost = $iconEmpty; |
411 | 411 | } |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | |
414 | 414 | $html .= '<div class="row">'; |
415 | 415 | $html .= '<div class="col-md-2">'; |
416 | - $html .= $newPost . '</div>'; |
|
416 | + $html .= $newPost.'</div>'; |
|
417 | 417 | |
418 | 418 | $poster_id = 0; |
419 | 419 | $name = ''; |
@@ -428,9 +428,9 @@ discard block |
||
428 | 428 | } |
429 | 429 | $html .= '<div class="col-md-6">'; |
430 | 430 | if (!empty($forum['last_post_id'])) { |
431 | - $html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) . ' '; |
|
431 | + $html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY).' '; |
|
432 | 432 | $html .= api_convert_and_format_date($forum['last_post_date']) |
433 | - . ' ' . get_lang('By') . ' ' |
|
433 | + . ' '.get_lang('By').' ' |
|
434 | 434 | . display_user_link($poster_id, $name); |
435 | 435 | } |
436 | 436 | $html .= '</div>'; |
@@ -440,13 +440,13 @@ discard block |
||
440 | 440 | api_is_allowed_to_edit(false, true) && |
441 | 441 | !($forum['session_id'] == 0 && $sessionId != 0) |
442 | 442 | ) { |
443 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' |
|
443 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory=' |
|
444 | 444 | . Security::remove_XSS($_GET['forumcategory']) |
445 | - . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">' |
|
446 | - . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>'; |
|
447 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' |
|
445 | + . '&action=edit&content=forum&id='.$forum['forum_id'].'">' |
|
446 | + . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>'; |
|
447 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory=' |
|
448 | 448 | . Security::remove_XSS($_GET['forumcategory']) |
449 | - . '&action=delete&content=forum&id=' . $forum['forum_id'] |
|
449 | + . '&action=delete&content=forum&id='.$forum['forum_id'] |
|
450 | 450 | . "\" onclick=\"javascript:if(!confirm('" |
451 | 451 | . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)) |
452 | 452 | . "')) return false;\">" |
@@ -470,15 +470,15 @@ discard block |
||
470 | 470 | $iconnotify = 'notification_mail_na.png'; |
471 | 471 | |
472 | 472 | if (is_array(isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : null)) { |
473 | - if (in_array($forum['forum_id'],$_SESSION['forum_notification']['forum'])) { |
|
473 | + if (in_array($forum['forum_id'], $_SESSION['forum_notification']['forum'])) { |
|
474 | 474 | $iconnotify = 'notification_mail.png'; |
475 | 475 | } |
476 | 476 | } |
477 | 477 | |
478 | 478 | if (!api_is_anonymous()) { |
479 | - $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory=' |
|
480 | - . Security::remove_XSS($_GET['forumcategory']) . '&action=notify&content=forum&id=' |
|
481 | - . $forum['forum_id'] . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>'; |
|
479 | + $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory=' |
|
480 | + . Security::remove_XSS($_GET['forumcategory']).'&action=notify&content=forum&id=' |
|
481 | + . $forum['forum_id'].'">'.Display::return_icon($iconnotify, get_lang('NotifyMe')).'</a>'; |
|
482 | 482 | } |
483 | 483 | $html .= '</div>'; |
484 | 484 | $html .= '</div>'; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | // Are we in a lp ? |
29 | 29 | $origin = ''; |
30 | 30 | if (isset($_GET['origin'])) { |
31 | - $origin = Security::remove_XSS($_GET['origin']); |
|
31 | + $origin = Security::remove_XSS($_GET['origin']); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /* MAIN DISPLAY SECTION */ |
@@ -45,12 +45,12 @@ discard block |
||
45 | 45 | |
46 | 46 | /* Header and Breadcrumbs */ |
47 | 47 | |
48 | -if (isset($_SESSION['gradebook'])){ |
|
48 | +if (isset($_SESSION['gradebook'])) { |
|
49 | 49 | $gradebook = $_SESSION['gradebook']; |
50 | 50 | } |
51 | 51 | |
52 | 52 | if (!empty($gradebook) && $gradebook == 'view') { |
53 | - $interbreadcrumb[] = array ( |
|
53 | + $interbreadcrumb[] = array( |
|
54 | 54 | 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], |
55 | 55 | 'name' => get_lang('ToolGradebook') |
56 | 56 | ); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | echo "\t<tr>\n\t\t<th style=\"padding-left:5px;\" align=\"left\" colspan=\"6\">"; |
184 | 184 | echo '<span class="forum_title">'.prepare4display($current_thread['thread_title']).'</span><br />'; |
185 | 185 | |
186 | - if ($origin!='learnpath') { |
|
186 | + if ($origin != 'learnpath') { |
|
187 | 187 | echo '<span class="forum_low_description">'.prepare4display($current_forum_category['cat_title']).' - '; |
188 | 188 | } |
189 | 189 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | if ($pluginLegal) { |
90 | - header('Location:' .$url); |
|
90 | + header('Location:'.$url); |
|
91 | 91 | exit; |
92 | 92 | } |
93 | 93 | } |
@@ -27,12 +27,12 @@ |
||
27 | 27 | echo Display::page_subheader( |
28 | 28 | Display::return_icon( |
29 | 29 | 'save_import.gif', get_lang('Backup') |
30 | - ) . ' ' . get_lang('Backup') |
|
30 | + ).' '.get_lang('Backup') |
|
31 | 31 | ); |
32 | 32 | |
33 | 33 | $url = api_get_path( |
34 | 34 | WEB_CODE_PATH |
35 | - ) . 'coursecopy/copy_course_session_selected.php?' . api_get_cidreq(); |
|
35 | + ).'coursecopy/copy_course_session_selected.php?'.api_get_cidreq(); |
|
36 | 36 | |
37 | 37 | $link = Display::url(get_lang('CopyCourse'), $url); |
38 | 38 | ?> |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $htmlHeadXtra[] = to_javascript_work(); |
32 | 32 | $interbreadcrumb[] = array( |
33 | - 'url' => api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq(), |
|
33 | + 'url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), |
|
34 | 34 | 'name' => get_lang('StudentPublications') |
35 | 35 | ); |
36 | 36 | $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $form = new FormValidator( |
39 | 39 | 'edit_dir', |
40 | 40 | 'post', |
41 | - api_get_path(WEB_CODE_PATH) . 'work/edit_work.php?id=' . $workId . '&' . api_get_cidreq() |
|
41 | + api_get_path(WEB_CODE_PATH).'work/edit_work.php?id='.$workId.'&'.api_get_cidreq() |
|
42 | 42 | ); |
43 | 43 | $form->addElement('header', get_lang('Edit')); |
44 | 44 |
@@ -41,7 +41,7 @@ |
||
41 | 41 | ) { |
42 | 42 | if (Security::check_abs_path( |
43 | 43 | $workData['file_path'], |
44 | - api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' |
|
44 | + api_get_path(SYS_COURSE_PATH).api_get_course_path().'/' |
|
45 | 45 | ) |
46 | 46 | ) { |
47 | 47 | DocumentManager::file_send_for_download( |