Completed
Push — 1.10.x ( 23ef56...71a362 )
by
unknown
49:56
created
main/forum/forumfunction.inc.php 1 patch
Doc Comments   +17 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
  * an up and down icon except for the first (no up icon) and the last (no down icon)
1048 1048
  *          The key of this $list array is the id of the item.
1049 1049
  *
1050
- * @return void HTML
1050
+ * @return string HTML
1051 1051
  **/
1052 1052
 function return_up_down_icon($content, $id, $list)
1053 1053
 {
@@ -2007,7 +2007,7 @@  discard block
 block discarded – undo
2007 2007
  * This function retrieves forum thread users details
2008 2008
  * @param   int Thread ID
2009 2009
  * @param   string  Course DB name (optional)
2010
- * @return  resource array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
2010
+ * @return  Doctrine\DBAL\Driver\Statement|null array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
2011 2011
  * @author Christian Fasanando <[email protected]>,
2012 2012
  * @todo     this function need to be improved
2013 2013
  * @version octubre 2008, dokeos 1.8
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
  * This function retrieves forum thread users qualify
2063 2063
  * @param   int Thread ID
2064 2064
  * @param   string  Course DB name (optional)
2065
- * @return  array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
2065
+ * @return  Doctrine\DBAL\Driver\Statement|null Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
2066 2066
  * @author Jhon Hinojosa
2067 2067
  * @todo     this function need to be improved
2068 2068
  */
@@ -2129,7 +2129,7 @@  discard block
 block discarded – undo
2129 2129
  * This function retrieves forum thread users not qualify
2130 2130
  * @param   int Thread ID
2131 2131
  * @param   string  Course DB name (optional)
2132
- * @return  array Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
2132
+ * @return  Doctrine\DBAL\Driver\Statement|null Array of type ([user_id=>w,lastname=>x,firstname=>y,thread_id=>z],[])
2133 2133
  * @author   Jhon Hinojosa<[email protected]>,
2134 2134
  * @version oct 2008, dokeos 1.8
2135 2135
  */
@@ -2733,7 +2733,7 @@  discard block
 block discarded – undo
2733 2733
  *  2. replythread: Replying to a thread ($action = replythread) => I-frame with the complete thread (if enabled)
2734 2734
  *  3. replymessage: Replying to a message ($action =replymessage) => I-frame with the complete thread (if enabled) (I first thought to put and I-frame with the message only)
2735 2735
  *  4. quote: Quoting a message ($action= quotemessage) => I-frame with the complete thread (if enabled). The message will be in the reply. (I first thought not to put an I-frame here)
2736
- * @return void HMTL
2736
+ * @return false|null HMTL
2737 2737
  * @author Patrick Cool <[email protected]>, Ghent University
2738 2738
  * @version february 2006, dokeos 1.8
2739 2739
  */
@@ -3153,6 +3153,10 @@  discard block
 block discarded – undo
3153 3153
  * @param integer contains the information the current user id
3154 3154
  * @param integer contains the information the current thread id
3155 3155
  * @param integer contains the information the current qualify
3156
+ * @param string $option
3157
+ * @param integer $course_id
3158
+ * @param integer $user_id
3159
+ * @param integer $thread_id
3156 3160
  * @return void
3157 3161
  * <code>$option=1 obtained the qualification of the current thread</code>
3158 3162
  * @author Isaac Flores <[email protected]>, U.N.A.S University
@@ -3710,6 +3714,8 @@  discard block
 block discarded – undo
3710 3714
  *
3711 3715
  * @author Patrick Cool <[email protected]>, Ghent University
3712 3716
  * @version february 2006, dokeos 1.8
3717
+ * @param string $last_post_id
3718
+ * @param string $post_date
3713 3719
  */
3714 3720
 function updateThreadInfo($thread_id, $last_post_id, $post_date)
3715 3721
 {
@@ -4013,6 +4019,8 @@  discard block
 block discarded – undo
4013 4019
  *
4014 4020
  * @param string  Content type (post, thread, forum, forum_category)
4015 4021
  * @param int     Item DB ID
4022
+ * @param string $content
4023
+ * @param integer $id
4016 4024
  * @return string language variable
4017 4025
  * @author Patrick Cool <[email protected]>, Ghent University
4018 4026
  * @version february 2006, dokeos 1.8
@@ -4490,6 +4498,7 @@  discard block
 block discarded – undo
4490 4498
 /**
4491 4499
  * Display the search results
4492 4500
  * @param string
4501
+ * @param string $search_term
4493 4502
  * @return void display the results
4494 4503
  * @author Patrick Cool <[email protected]>, Ghent University, Belgium
4495 4504
  * @version march 2008, dokeos 1.8.5
@@ -4619,7 +4628,7 @@  discard block
 block discarded – undo
4619 4628
  * This function adds an attachment file into a forum
4620 4629
  * @param string $file_comment  a comment about file
4621 4630
  * @param int $last_id from forum_post table
4622
- * @return int|bool
4631
+ * @return false|null
4623 4632
  */
4624 4633
 function add_forum_attachment_file($file_comment, $last_id)
4625 4634
 {
@@ -4830,7 +4839,7 @@  discard block
 block discarded – undo
4830 4839
  * @param post id
4831 4840
  * @param int $id_attach
4832 4841
  * @param bool $display to show or not result message
4833
- * @return void
4842
+ * @return integer
4834 4843
  * @author Julio Montoya Dokeos
4835 4844
  * @version october 2014, chamilo 1.9.8
4836 4845
  */
@@ -5112,7 +5121,7 @@  discard block
 block discarded – undo
5112 5121
  * @param integer $forum_id the id of the forum
5113 5122
  * @param integer $thread_id the id of the thread
5114 5123
  * @param integer $post_id the id of the post
5115
- * @return bool
5124
+ * @return false|null
5116 5125
  *
5117 5126
  * @author Patrick Cool <[email protected]>, Ghent University, Belgium
5118 5127
  * @version May 2008, dokeos 1.8.5
Please login to merge, or discard this patch.
main/forum/index.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 
65 65
 if (!empty($gradebook) && $gradebook == 'view') {
66 66
     $interbreadcrumb[] = array(
67
-        'url' => '../gradebook/' . $_SESSION['gradebook_dest'],
67
+        'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
68 68
         'name' => get_lang('ToolGradebook'),
69 69
     );
70 70
 }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     switch ($_GET['content']) {
80 80
         case 'forum':
81 81
             $interbreadcrumb[] = array(
82
-                'url' => 'index.php?search=' . $search_forum . '&' . api_get_cidreq(),
82
+                'url' => 'index.php?search='.$search_forum.'&'.api_get_cidreq(),
83 83
                 'name' => get_lang('Forum'),
84 84
             );
85 85
             $interbreadcrumb[] = array(
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             break;
90 90
         case 'forumcategory':
91 91
             $interbreadcrumb[] = array(
92
-                'url' => 'index.php?search=' . $search_forum . '&' . api_get_cidreq(),
92
+                'url' => 'index.php?search='.$search_forum.'&'.api_get_cidreq(),
93 93
                 'name' => get_lang('Forum'),
94 94
             );
95 95
             $interbreadcrumb[] = array(
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
         . "&gradebook=&action=add_item&type=step&lp_id=$lp_id#resource_tab-5\">"
186 186
         . Display::return_icon(
187 187
             'back.png',
188
-            get_lang("BackTo") . ' ' . get_lang("LearningPaths"),
188
+            get_lang("BackTo").' '.get_lang("LearningPaths"),
189 189
             '',
190 190
             ICON_SIZE_MEDIUM
191 191
         )
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
 
198 198
 if (api_is_allowed_to_edit(false, true)) {
199 199
     echo '<a href="'
200
-        . api_get_self() . '?' . api_get_cidreq()
201
-        . '&action=add&content=forumcategory&lp_id=' . $lp_id . '"> ' .
200
+        . api_get_self().'?'.api_get_cidreq()
201
+        . '&action=add&content=forumcategory&lp_id='.$lp_id.'"> '.
202 202
         Display::return_icon(
203 203
             'new_folder.png', get_lang('AddForumCategory'), '', ICON_SIZE_MEDIUM
204 204
         )
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         );
249 249
 
250 250
         if (empty($sessionId) && !empty($forumCategory['session_name'])) {
251
-            $session_displayed = ' (' . Security::remove_XSS($forumCategory['session_name']) . ')';
251
+            $session_displayed = ' ('.Security::remove_XSS($forumCategory['session_name']).')';
252 252
         } else {
253 253
             $session_displayed = '';
254 254
         }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
         $html = '';
261 261
         $iconsEdit = '';
262 262
         $idCategory = $forumCategory['cat_id'];
263
-        $urlCategory = 'viewforumcategory.php?' . api_get_cidreq() . '&forumcategory=' . intval($idCategory);
263
+        $urlCategory = 'viewforumcategory.php?'.api_get_cidreq().'&forumcategory='.intval($idCategory);
264 264
         $titleCategory = Display::tag(
265 265
             'a',
266 266
             $forumCategory['cat_title'],
@@ -278,9 +278,9 @@  discard block
 block discarded – undo
278 278
                 !($forumCategory['session_id'] == 0 &&
279 279
                 intval($sessionId) != 0)
280 280
             ) {
281
-                $iconsEdit .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
282
-                    . '&action=edit&content=forumcategory&id=' . intval($idCategory)
283
-                    . '">' . Display::return_icon(
281
+                $iconsEdit .= '<a href="'.api_get_self().'?'.api_get_cidreq()
282
+                    . '&action=edit&content=forumcategory&id='.intval($idCategory)
283
+                    . '">'.Display::return_icon(
284 284
                         'edit.png',
285 285
                         get_lang('Edit'),
286 286
                         array(),
@@ -288,8 +288,8 @@  discard block
 block discarded – undo
288 288
                     )
289 289
                     . '</a>';
290 290
 
291
-                $iconsEdit .='<a href="' . api_get_self() . '?' . api_get_cidreq()
292
-                    . '&action=delete&content=forumcategory&id=' . intval($idCategory)
291
+                $iconsEdit .= '<a href="'.api_get_self().'?'.api_get_cidreq()
292
+                    . '&action=delete&content=forumcategory&id='.intval($idCategory)
293 293
                     . "\" onclick=\"javascript:if(!confirm('"
294 294
                     . addslashes(api_htmlentities(
295 295
                         get_lang('DeleteForumCategory'),
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
                         ICON_SIZE_SMALL
304 304
                     )
305 305
                     . '</a>';
306
-                $iconsEdit .=  return_visible_invisible_icon(
306
+                $iconsEdit .= return_visible_invisible_icon(
307 307
                     'forumcategory',
308 308
                     strval(intval($idCategory)),
309 309
                     strval(intval($forumCategory['visibility']))
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
             array(),
338 338
             ICON_SIZE_MEDIUM
339 339
         );
340
-        $html .= '<h3>' . $icoCategory . $titleCategory . '</h3>';
340
+        $html .= '<h3>'.$icoCategory.$titleCategory.'</h3>';
341 341
 
342 342
         if ($descriptionCategory != '' && trim($descriptionCategory) != '&nbsp;') {
343 343
             $html .= '<div class="forum-description">'.$descriptionCategory.'</div>';
@@ -470,15 +470,15 @@  discard block
 block discarded – undo
470 470
                                 30
471 471
                             );
472 472
                             $forum_title_group_addition = ' (<a href="../group/group_space.php?'
473
-                                . api_get_cidreq() . '&gidReq=' . $forum['forum_of_group']
474
-                                . '" class="forum_group_link">' . get_lang('GoTo') . ' ' . $group_title . '</a>)'
473
+                                . api_get_cidreq().'&gidReq='.$forum['forum_of_group']
474
+                                . '" class="forum_group_link">'.get_lang('GoTo').' '.$group_title.'</a>)'
475 475
                                 . $session_img;
476 476
                         } else {
477 477
                             $forum_title_group_addition = '';
478 478
                         }
479 479
 
480 480
                         if (empty($sessionId) && !empty($forum['session_name'])) {
481
-                            $session_displayed = ' (' . $forum['session_name'] . ')';
481
+                            $session_displayed = ' ('.$forum['session_name'].')';
482 482
                         } else {
483 483
                             $session_displayed = '';
484 484
                         }
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
                         $html .= '<div class="row">';
491 491
                         $html .= '<div class="col-md-6">';
492 492
                         $html .= '<div class="col-md-3">';
493
-                        $html .= '<div class="number-post">'.$forum_image.'<p>'.$number_threads.' ' . get_lang('ForumThreads') . '</p>'
493
+                        $html .= '<div class="number-post">'.$forum_image.'<p>'.$number_threads.' '.get_lang('ForumThreads').'</p>'
494 494
                             . '</div>';
495 495
                         $html .= '</div>';
496 496
 
@@ -505,15 +505,15 @@  discard block
 block discarded – undo
505 505
                         $linkForum .= Display::tag(
506 506
                             'a',
507 507
                             $forum['forum_title'],
508
-                            array (
509
-                                'href' => 'viewforum.php?' . api_get_cidreq()
510
-                                    . '&gidReq=' . intval($groupid)
511
-                                    . '&forum=' . intval($forum['forum_id']),
512
-                                'class' => return_visible_invisible( strval( intval($forum['visibility']) ) )
508
+                            array(
509
+                                'href' => 'viewforum.php?'.api_get_cidreq()
510
+                                    . '&gidReq='.intval($groupid)
511
+                                    . '&forum='.intval($forum['forum_id']),
512
+                                'class' => return_visible_invisible(strval(intval($forum['visibility'])))
513 513
                             )
514 514
                         );
515 515
 
516
-                        $html .= '<h3 class="title">' . $iconForum . $linkForum . '</h3>';
516
+                        $html .= '<h3 class="title">'.$iconForum.$linkForum.'</h3>';
517 517
                         $html .= Display::tag(
518 518
                             'p',
519 519
                             Security::remove_XSS($forum['forum_comment']),
@@ -528,9 +528,9 @@  discard block
 block discarded – undo
528 528
 
529 529
                         // The number of topics and posts.
530 530
                         if ($forum['forum_of_group'] !== '0') {
531
-                            $newPost='';
531
+                            $newPost = '';
532 532
                             if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
533
-                                $newPost = ' ' . Display::return_icon(
533
+                                $newPost = ' '.Display::return_icon(
534 534
                                     'alert.png',
535 535
                                     get_lang('Forum'),
536 536
                                     null,
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
                             }
542 542
                         } else {
543 543
                             if (is_array($mywhatsnew_post_info) && !empty($mywhatsnew_post_info)) {
544
-                                $newPost = ' ' . Display::return_icon(
544
+                                $newPost = ' '.Display::return_icon(
545 545
                                     'alert.png',
546 546
                                     get_lang('Forum'),
547 547
                                     null,
@@ -583,9 +583,9 @@  discard block
 block discarded – undo
583 583
                                     null,
584 584
                                     ICON_SIZE_TINY
585 585
                                 )
586
-                                . ' ' .
586
+                                . ' '.
587 587
                                 api_convert_and_format_date($forum['last_post_date'])
588
-                                . '<br /> ' . get_lang('By') . ' ' .
588
+                                . '<br /> '.get_lang('By').' '.
589 589
                                 display_user_link(
590 590
                                     $poster_id,
591 591
                                     $name,
@@ -600,13 +600,13 @@  discard block
 block discarded – undo
600 600
                             api_is_allowed_to_edit(false, true) &&
601 601
                             !($forum['session_id'] == 0 && intval($sessionId) != 0)
602 602
                         ) {
603
-                            $html .= '<a href="'.api_get_self() . '?' . api_get_cidreq()
604
-                                . '&action=edit&content=forum&id=' . $forum['forum_id'] . '">'
603
+                            $html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
604
+                                . '&action=edit&content=forum&id='.$forum['forum_id'].'">'
605 605
                                 . Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL)
606 606
                                 . '</a>';
607
-                            $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
608
-                                . '&action=delete&content=forum&id=' . $forum['forum_id']
609
-                                . "\" onclick=\"javascript:if(!confirm('" . addslashes(
607
+                            $html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
608
+                                . '&action=delete&content=forum&id='.$forum['forum_id']
609
+                                . "\" onclick=\"javascript:if(!confirm('".addslashes(
610 610
                                     api_htmlentities(get_lang('DeleteForum'), ENT_QUOTES)
611 611
                                 )
612 612
                                 . "')) return false;\">"
@@ -644,8 +644,8 @@  discard block
 block discarded – undo
644 644
                             !api_is_anonymous() &&
645 645
                             api_is_allowed_to_session_edit(false, true)
646 646
                         ) {
647
-                            $html .= '<a href="' . api_get_self() . '?' . api_get_cidreq()
648
-                                . '&action=notify&content=forum&id=' . $forum['forum_id'] . '">'
647
+                            $html .= '<a href="'.api_get_self().'?'.api_get_cidreq()
648
+                                . '&action=notify&content=forum&id='.$forum['forum_id'].'">'
649 649
                                 . Display::return_icon($iconnotify, get_lang('NotifyMe'), null, ICON_SIZE_SMALL)
650 650
                                 . '</a>';
651 651
                         }
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
                 }
663 663
             }
664 664
         } else {
665
-            echo '<div class="alert alert-warning">' . get_lang('NoForumInThisCategory') . '</div>'
665
+            echo '<div class="alert alert-warning">'.get_lang('NoForumInThisCategory').'</div>'
666 666
                 . (api_is_allowed_to_edit(false, true) ? '<div>' : '</div>')
667 667
                 . '</div>';
668 668
         }
Please login to merge, or discard this patch.