diff --git a/renderer.php b/renderer.php index e96e0d75..fdf179b8 100644 --- a/renderer.php +++ b/renderer.php @@ -276,7 +276,7 @@ public function discussions($cm, array $discussions, array $options) { $output = '
'; foreach ($discussions as $discussionpost) { list($discussion, $post) = $discussionpost; - $output .= $this->discussion($cm, $discussion, $post, false); + $output .= $this->discussion($cm, $discussion, $post, false, array(), null, true); } @@ -320,9 +320,10 @@ public function discussion_thread($cm, $discussion, $post, array $posts, $canrep * @param \stdClass $post The discussion's post to render * @param \stdClass[] $posts The discussion posts (optional) * @param null|boolean $canreply If the user can reply or not (optional) + * @param null|boolean $hidethreadcontent for main view(optional) * @return string */ - public function discussion($cm, $discussion, $post, $fullthread, array $posts = array(), $canreply = null) { + public function discussion($cm, $discussion, $post, $fullthread, array $posts = array(), $canreply = null, $hidethreadcontent = null) { global $DB, $PAGE, $USER; $forum = hsuforum_get_cm_forum($cm); @@ -437,7 +438,7 @@ public function discussion($cm, $discussion, $post, $fullthread, array $posts = $data->timed = ''; } - return $this->discussion_template($data, $forum->type); + return $this->discussion_template($data, $forum->type, $hidethreadcontent); } public function article_assets($cm) { @@ -551,7 +552,7 @@ public function post($cm, $discussion, $post, $canreply = false, $parent = null, return $this->post_template($data); } - public function discussion_template($d, $forumtype) { + public function discussion_template($d, $forumtype, $hidethreadcontent = null) { global $PAGE; $replies = ''; @@ -624,6 +625,11 @@ public function discussion_template($d, $forumtype) { $revealed = ''.$nonanonymous.''; } + $threadcontent = ''; + if (!$hidethreadcontent) { + $threadcontent = '