Add reply for group coach and member

1.9.x
jmontoya 10 years ago
parent 1c36851240
commit 51094b7004
  1. 15
      main/forum/viewthread_nested.inc.php
  2. 15
      main/forum/viewthread_threaded.inc.php

@ -122,6 +122,21 @@ foreach ($rows as $post) {
if ($current_thread['locked']==1) { if ($current_thread['locked']==1) {
echo get_lang('ThreadLocked').'<br />'; echo get_lang('ThreadLocked').'<br />';
} }
if (!empty($group_id)) {
$reply = api_is_allowed_to_edit() ||
(
GroupManager::is_tutor_of_group($userId, $groupId, $courseId) ||
GroupManager::is_subscribed($userId, $groupId, $courseId)
);
if ($reply) {
echo '<a href="reply.php?'.api_get_cidreq().'&amp;forum='.$clean_forum_id.'&amp;thread='.$clean_thread_id.'&amp;post='.$post['post_id'].'&amp;action=replymessage&amp;origin='.$origin.'">'.
Display :: return_icon('message_reply_forum.png', get_lang('ReplyToMessage'))."</a>";
echo '<a href="reply.php?'.api_get_cidreq().'&amp;forum='.$clean_forum_id.'&amp;thread='.$clean_thread_id.'&amp;post='.$post['post_id'].'&amp;action=quote&amp;origin='.$origin.'">'.
Display :: return_icon('quote.gif', get_lang('QuoteMessage'))."</a>";
}
}
} }
echo "</td>"; echo "</td>";
// note: this can be removed here because it will be displayed in the tree // note: this can be removed here because it will be displayed in the tree

@ -382,6 +382,21 @@ if (
if ($current_thread['locked'] == 1) { if ($current_thread['locked'] == 1) {
echo get_lang('ThreadLocked') . '<br />'; echo get_lang('ThreadLocked') . '<br />';
} }
if (!empty($group_id)) {
$reply = api_is_allowed_to_edit() ||
(
GroupManager::is_tutor_of_group($userId, $groupId, $courseId) ||
GroupManager::is_subscribed($userId, $groupId, $courseId)
);
if ($reply) {
echo '<a href="reply.php?'.api_get_cidreq().'&amp;forum='.$forumId.'&amp;thread='.$threadId.'&amp;post='.$rows[$display_post_id]['post_id'].'&amp;action=replymessage&amp;origin='.$origin.'">'.
Display :: return_icon('message_reply_forum.png', get_lang('ReplyToMessage'))."</a>";
echo '<a href="reply.php?'.api_get_cidreq().'&amp;forum='.$forumId.'&amp;thread='.$threadId.'&amp;post='.$rows[$display_post_id]['post_id'].'&amp;action=quote&amp;origin='.$origin.'">'.
Display :: return_icon('quote.gif', get_lang('QuoteMessage'))."</a>";
}
}
} }
echo "</td>"; echo "</td>";
// Note: this can be removed here because it will be displayed in the tree // Note: this can be removed here because it will be displayed in the tree

Loading…
Cancel
Save