diff --git a/renderer.php b/renderer.php index 3633c697..7f9085f8 100644 --- a/renderer.php +++ b/renderer.php @@ -270,7 +270,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); } @@ -314,9 +314,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); @@ -432,7 +433,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) { @@ -546,7 +547,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 = ''; @@ -619,7 +620,11 @@ public function discussion_template($d, $forumtype) { $revealed = ''.$nonanonymous.''; } - $arialabeldiscussion = get_string('discussionforum', 'hsuforum', $d->subject); + $threadcontent = ''; + if (!$hidethreadcontent) { + $threadcontent = '