From 5f57c759e1ced72de58adab304d51a253bcdab63 Mon Sep 17 00:00:00 2001 From: Julio Date: Tue, 5 Feb 2019 12:31:15 +0100 Subject: [PATCH] Fix report button, fix report messages see BT#15173 --- main/forum/editthread.php | 9 +++++---- main/forum/forumfunction.inc.php | 24 +++++++++++++++++------- main/forum/viewthread.php | 2 +- main/forum/viewthread_flat.inc.php | 20 +++++++++++++++++--- main/forum/viewthread_nested.inc.php | 11 ++++++++--- 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/main/forum/editthread.php b/main/forum/editthread.php index b8dcaa33df..9b89f0b809 100644 --- a/main/forum/editthread.php +++ b/main/forum/editthread.php @@ -156,6 +156,8 @@ $actions = [ $threadData = getThreadInfo($threadId, $cId); +$gradeThisThread = empty($_POST) && ($threadData['threadQualifyMax'] > 0 || $threadData['threadWeight'] > 0); + $form = new FormValidator( 'thread', 'post', @@ -183,14 +185,13 @@ if ((api_is_course_admin() || api_is_session_general_coach() || api_is_course_tu 'checkbox', 'thread_qualify_gradebook', '', - get_lang('QualifyThreadGradebook'), - ['id' => 'thread_qualify_gradebook'] + get_lang('QualifyThreadGradebook') ); } else { $form->addElement('hidden', 'thread_qualify_gradebook', false); } - $form->addElement('html', ''; - $html .= '
'; + + $highLightClass = ''; + if (isset($_GET['post_id']) && $_GET['post_id'] == $row['post_id']) { + $highLightClass = 'alert alert-danger'; + } + + $html .= '
'; $titlePost = Display::tag( 'h3', @@ -368,6 +380,8 @@ if (isset($current_thread['thread_id'])) { $html .= '
'; $html .= '
'; + + // The post has been displayed => it can be removed from the what's new array unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]); unset($whatsnew_post_info[$current_forum['forum_id']][$current_thread['thread_id']]); diff --git a/main/forum/viewthread_nested.inc.php b/main/forum/viewthread_nested.inc.php index 3acd0e60cc..7bb90d7882 100755 --- a/main/forum/viewthread_nested.inc.php +++ b/main/forum/viewthread_nested.inc.php @@ -317,11 +317,16 @@ foreach ($posts as $post) { ); } - $html .= '
'; - // The post title + $highLightClass = ''; + if (isset($_GET['post_id']) && $_GET['post_id'] == $post['post_id']) { + $highLightClass = 'alert alert-danger'; + } + $html .= '
'; + // The post title $titlePost = Display::tag('h3', $post['post_title'], ['class' => 'forum_post_title']); $html .= Display::tag('div', $titlePost, ['class' => 'post-header']); + $html .= ''; // the post body $html .= Display::tag('div', $post['post_text'], ['class' => 'post-body']); @@ -354,7 +359,7 @@ foreach ($posts as $post) { $html .= '
'; $html .= '
'; - $html .= "$reportButton $editButton $buttonReply $buttonQuote $waitingValidation"; + $html .= "$editButton $buttonReply $buttonQuote $waitingValidation"; $html .= '
'; $html .= '
';