Completed
Push — 1.11.x ( c0f658...e2faf7 )
by José
36:56
created
main/forum/viewthread_threaded.inc.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -457,8 +457,8 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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 '&nbsp;&nbsp;<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 '&nbsp;&nbsp;<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 />';
Please login to merge, or discard this patch.
main/forum/iframe_thread.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
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']);
Please login to merge, or discard this patch.
main/forum/viewforumcategory.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -500,7 +500,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Spacing   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -55,17 +55,17 @@  discard block
 block discarded – undo
55 55
 $origin = '';
56 56
 
57 57
 if (isset($_GET['origin'])) {
58
-    $origin =  Security::remove_XSS($_GET['origin']);
58
+    $origin = Security::remove_XSS($_GET['origin']);
59 59
 }
60 60
 
61 61
 /* Header and Breadcrumbs */
62 62
 $gradebook = null;
63 63
 if (isset($_SESSION['gradebook'])) {
64
-    $gradebook=	$_SESSION['gradebook'];
64
+    $gradebook = $_SESSION['gradebook'];
65 65
 }
66 66
 
67 67
 if (!empty($gradebook) && $gradebook == 'view') {
68
-    $interbreadcrumb[] = array (
68
+    $interbreadcrumb[] = array(
69 69
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
70 70
         'name' => get_lang('ToolGradebook')
71 71
     );
@@ -75,15 +75,15 @@  discard block
 block discarded – undo
75 75
 
76 76
 $current_forum_category = get_forum_categories($_GET['forumcategory']);
77 77
 $interbreadcrumb[] = array(
78
-    'url' => 'index.php?gradebook=' . $gradebook . '&search='
78
+    'url' => 'index.php?gradebook='.$gradebook.'&search='
79 79
         . Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')),
80 80
     'name' => get_lang('Forum')
81 81
 );
82 82
 
83 83
 if (!empty($_GET['action']) && !empty($_GET['content'])) {
84
-    if ($_GET['action']=='add' && $_GET['content']=='forum' ) {
84
+    if ($_GET['action'] == 'add' && $_GET['content'] == 'forum') {
85 85
         $interbreadcrumb[] = array(
86
-            'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='. $current_forum_category['cat_id'],
86
+            'url' => 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.$current_forum_category['cat_id'],
87 87
             'name' => $current_forum_category['cat_title']
88 88
         );
89 89
         $interbreadcrumb[] = array(
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 // then the user is not allowed here.
114 114
 if (
115 115
     !api_is_allowed_to_edit(false, true) AND
116
-    ( $current_forum_category && $current_forum_category['visibility'] == 0)
116
+    ($current_forum_category && $current_forum_category['visibility'] == 0)
117 117
 ) {
118 118
     api_not_allowed();
119 119
 }
@@ -123,10 +123,10 @@  discard block
 block discarded – undo
123 123
 $html .= '<div class="actions">';
124 124
 $html .= '<a href="index.php?gradebook='.$gradebook.'&'.api_get_cidreq().'">'.
125 125
     Display::return_icon('back.png', get_lang('BackToForumOverview'), '', ICON_SIZE_MEDIUM).'</a>';
126
-if (api_is_allowed_to_edit(false,true)) {
127
-    $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory='
128
-        . $current_forum_category['cat_id'] . '&action=add&content=forum"> '
129
-        . Display::return_icon('new_forum.png', get_lang('AddForum'), '', ICON_SIZE_MEDIUM) . '</a>';
126
+if (api_is_allowed_to_edit(false, true)) {
127
+    $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='
128
+        . $current_forum_category['cat_id'].'&action=add&content=forum"> '
129
+        . Display::return_icon('new_forum.png', get_lang('AddForum'), '', ICON_SIZE_MEDIUM).'</a>';
130 130
 }
131 131
 $html .= search_link();
132 132
 $html .= '</div>';
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
     $forum_categories_list = '';
187 187
     $forumId = $forum_category['cat_id'];
188 188
     $forumTitle = $forum_category['cat_title'];
189
-    $linkForumCategory = 'viewforumcategory.php?' . api_get_cidreq() . '&forumcategory=' . strval(intval($forumId));
189
+    $linkForumCategory = 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.strval(intval($forumId));
190 190
     $descriptionCategory = $forum_category['cat_comment'];
191 191
     $icoCategory = Display::return_icon(
192 192
         'forum_blue.png',
@@ -197,16 +197,16 @@  discard block
 block discarded – undo
197 197
 
198 198
     if (api_is_allowed_to_edit(false, true) && !($forum_category['session_id'] == 0 && $sessionId != 0)) {
199 199
 
200
-        $iconsEdit = '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory='
201
-            . Security::remove_XSS($_GET['forumcategory']) . '&action=edit&content=forumcategory&id='
202
-            . '' . $forumId . '">'
203
-            . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
204
-        $iconsEdit .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory='
200
+        $iconsEdit = '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='
201
+            . Security::remove_XSS($_GET['forumcategory']).'&action=edit&content=forumcategory&id='
202
+            . ''.$forumId.'">'
203
+            . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
204
+        $iconsEdit .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='
205 205
             . Security::remove_XSS($_GET['forumcategory'])
206
-            . '&action=delete&content=forumcategory&id=' . $forumId
206
+            . '&action=delete&content=forumcategory&id='.$forumId
207 207
             . "\" onclick=\"javascript:if(!confirm('"
208 208
             . addslashes(api_htmlentities(get_lang('DeleteForumCategory'), ENT_QUOTES))
209
-            . "')) return false;\">" . Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)
209
+            . "')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL)
210 210
             . '</a>';
211 211
         $iconsEdit .= return_visible_invisible_icon(
212 212
             'forumcategory', $forum_category['cat_id'],
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
     );
247 247
 
248 248
 
249
-    if ($descriptionCategory != '' && trim($descriptionCategory)!= '&nbsp;') {
249
+    if ($descriptionCategory != '' && trim($descriptionCategory) != '&nbsp;') {
250 250
         $html .= '<div class="forum-description">'.$descriptionCategory.'</div>';
251 251
     }
252 252
 
@@ -337,9 +337,9 @@  discard block
 block discarded – undo
337 337
                         ? $all_groups[$forum['forum_of_group']]['id']
338 338
                         : null;
339 339
                     $group_title = api_substr($my_all_groups_forum_name, 0, 30);
340
-                    $forum_title_group_addition = ' (<a href="../group/group_space.php?' . api_get_cidreq()
341
-                        . '&gidReq=' . $my_all_groups_forum_id . '" class="forum_group_link">'
342
-                        . get_lang('GoTo') . ' ' . $group_title . '</a>)';
340
+                    $forum_title_group_addition = ' (<a href="../group/group_space.php?'.api_get_cidreq()
341
+                        . '&gidReq='.$my_all_groups_forum_id.'" class="forum_group_link">'
342
+                        . get_lang('GoTo').' '.$group_title.'</a>)';
343 343
                 } else {
344 344
                     $forum_title_group_addition = '';
345 345
                 }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
                 $html .= '<div class="row">';
358 358
                 $html .= '<div class="col-md-6">';
359 359
                 $html .= '<div class="col-md-3">';
360
-                $html .= '<div class="number-post">'.$forum_image .'<p>' . $my_number_threads . ' ' . get_lang('ForumThreads') . '</p></div>';
360
+                $html .= '<div class="number-post">'.$forum_image.'<p>'.$my_number_threads.' '.get_lang('ForumThreads').'</p></div>';
361 361
                 $html .= '</div>';
362 362
 
363 363
                 $html .= '<div class="col-md-9">';
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
                     'a',
373 373
                     $forum['forum_title'].$session_displayed,
374 374
                     array(
375
-                        'href' => 'viewforum.php?' . api_get_cidreq()
375
+                        'href' => 'viewforum.php?'.api_get_cidreq()
376 376
                             . "&gidReq={$forum['forum_of_group']}&forum={$forum['forum_id']}&search="
377 377
                             . Security::remove_XSS(urlencode(isset($_GET['search']) ? $_GET['search'] : '')),
378 378
                         'class' => empty($forum['visibility']) ? 'text-muted' : null
@@ -380,7 +380,7 @@  discard block
 block discarded – undo
380 380
                 );
381 381
                 $html .= Display::tag(
382 382
                     'h3',
383
-                    $linkForum . ' ' . $forum_title_group_addition,
383
+                    $linkForum.' '.$forum_title_group_addition,
384 384
                     array(
385 385
                         'class' => 'title'
386 386
                     )
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
                     );
401 401
                     if (!empty($waitingCount)) {
402 402
                         $html .= Display::label(
403
-                            get_lang('PostsPendingModeration'). ': '.$waitingCount,
403
+                            get_lang('PostsPendingModeration').': '.$waitingCount,
404 404
                             'warning'
405 405
                         );
406 406
                     }
@@ -410,19 +410,19 @@  discard block
 block discarded – undo
410 410
                 $html .= '</div>';
411 411
                 $html .= '<div class="col-md-6">';
412 412
 
413
-                $iconEmpty='';
413
+                $iconEmpty = '';
414 414
 
415 415
                 // The number of topics and posts.
416 416
                 if ($forum['forum_of_group'] !== '0') {
417 417
                     $newPost = '';
418 418
                     if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) {
419
-                        $newPost = ' ' . Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL);
419
+                        $newPost = ' '.Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL);
420 420
                     } else {
421 421
                         $newPost = $iconEmpty;
422 422
                     }
423 423
                 } else {
424 424
                     if (is_array($my_whatsnew_post_info) && !empty($my_whatsnew_post_info)) {
425
-                        $newPost = ' ' . Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL);
425
+                        $newPost = ' '.Display::return_icon('alert.png', get_lang('Forum'), null, ICON_SIZE_SMALL);
426 426
                     } else {
427 427
                         $newPost = $iconEmpty;
428 428
                     }
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 
431 431
                 $html .= '<div class="row">';
432 432
                 $html .= '<div class="col-md-2">';
433
-                $html .= $newPost . '</div>';
433
+                $html .= $newPost.'</div>';
434 434
 
435 435
                 $poster_id = 0;
436 436
                 $name = '';
@@ -445,9 +445,9 @@  discard block
 block discarded – undo
445 445
                 }
446 446
                 $html .= '<div class="col-md-6">';
447 447
                 if (!empty($forum['last_post_id'])) {
448
-                    $html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY) . ' ';
448
+                    $html .= Display::return_icon('post-item.png', null, null, ICON_SIZE_TINY).' ';
449 449
                     $html .= api_convert_and_format_date($forum['last_post_date'])
450
-                        . ' ' . get_lang('By') . ' '
450
+                        . ' '.get_lang('By').' '
451 451
                         . display_user_link($poster_id, $name);
452 452
                 }
453 453
                 $html .= '</div>';
@@ -457,13 +457,13 @@  discard block
 block discarded – undo
457 457
                     api_is_allowed_to_edit(false, true) &&
458 458
                     !($forum['session_id'] == 0 && $sessionId != 0)
459 459
                 ) {
460
-                    $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory='
460
+                    $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='
461 461
                         . Security::remove_XSS($_GET['forumcategory'])
462
-                        . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">'
463
-                        . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL) . '</a>';
464
-                    $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory='
462
+                        . '&action=edit&content=forum&id='.$forum['forum_id'].'">'
463
+                        . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
464
+                    $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='
465 465
                         . Security::remove_XSS($_GET['forumcategory'])
466
-                        . '&action=delete&content=forum&id=' . $forum['forum_id']
466
+                        . '&action=delete&content=forum&id='.$forum['forum_id']
467 467
                         . "\" onclick=\"javascript:if(!confirm('"
468 468
                         . addslashes(api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES))
469 469
                         . "')) return false;\">"
@@ -487,15 +487,15 @@  discard block
 block discarded – undo
487 487
                 $iconnotify = 'notification_mail_na.png';
488 488
 
489 489
                 if (is_array(isset($_SESSION['forum_notification']['forum']) ? $_SESSION['forum_notification']['forum'] : null)) {
490
-                    if (in_array($forum['forum_id'],$_SESSION['forum_notification']['forum'])) {
490
+                    if (in_array($forum['forum_id'], $_SESSION['forum_notification']['forum'])) {
491 491
                         $iconnotify = 'notification_mail.png';
492 492
                     }
493 493
                 }
494 494
 
495 495
                 if (!api_is_anonymous()) {
496
-                    $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&forumcategory='
497
-                        . Security::remove_XSS($_GET['forumcategory']) . '&action=notify&content=forum&id='
498
-                        . $forum['forum_id'] . '">' . Display::return_icon($iconnotify, get_lang('NotifyMe')) . '</a>';
496
+                    $html .= '<a href="'.api_get_self().'?'.api_get_cidreq().'&forumcategory='
497
+                        . Security::remove_XSS($_GET['forumcategory']).'&action=notify&content=forum&id='
498
+                        . $forum['forum_id'].'">'.Display::return_icon($iconnotify, get_lang('NotifyMe')).'</a>';
499 499
                 }
500 500
                 $html .= '</div>';
501 501
                 $html .= '</div>';
Please login to merge, or discard this patch.
main/forum/viewpost.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
main/course_info/legal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
         }
88 88
 
89 89
         if ($pluginLegal) {
90
-            header('Location:' .$url);
90
+            header('Location:'.$url);
91 91
             exit;
92 92
         }
93 93
     }
Please login to merge, or discard this patch.
main/course_info/maintenance_coach.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,12 +27,12 @@
 block discarded – undo
27 27
 echo Display::page_subheader(
28 28
     Display::return_icon(
29 29
         'save_import.gif', get_lang('Backup')
30
-    ) . '&nbsp;&nbsp;' . get_lang('Backup')
30
+    ).'&nbsp;&nbsp;'.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
 ?>
Please login to merge, or discard this patch.
main/work/edit_work.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
main/work/download_comment_file.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
main/work/add_user.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         $usersAdded[] = $myUserId;
75 75
         $userInfo = api_get_user_info($myUserId);
76 76
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=delete&id='.$workId.'&user_id='.$myUserId;
77
-        $link = Display::url('<em class="fa fa-trash"></em> ' . get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
78
-        echo '<li class="list-group-item">' . $userInfo['complete_name_with_username'] . '<div class="pull-right">' . $link . '</div></li>';
77
+        $link = Display::url('<em class="fa fa-trash"></em> '.get_lang('Delete'), $url, array('class' => 'btn btn-danger btn-sm'));
78
+        echo '<li class="list-group-item">'.$userInfo['complete_name_with_username'].'<div class="pull-right">'.$link.'</div></li>';
79 79
     }
80 80
     echo '</ul>';
81 81
 }
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
     foreach ($userToAddList as $user) {
109 109
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') ';
110 110
         $url = api_get_path(WEB_CODE_PATH).'work/add_user.php?action=add&id='.$workId.'&user_id='.$user['user_id'];
111
-        $link = Display::url('<em class="fa fa-plus"></em> ' . get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
112
-        echo '<li class="list-group-item">' . $userName . '<div class="pull-right"> ' . $link . '</div></li>';
111
+        $link = Display::url('<em class="fa fa-plus"></em> '.get_lang('Add'), $url, array('class' => 'btn btn-primary btn-sm'));
112
+        echo '<li class="list-group-item">'.$userName.'<div class="pull-right"> '.$link.'</div></li>';
113 113
     }
114 114
     echo '</ul>';
115 115
 } else {
Please login to merge, or discard this patch.