Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function discussions($cm, array $discussions, array $options) {
$output = '<div class="hsuforum-new-discussion-target"></div>';
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);
}


Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 = '';
Expand Down Expand Up @@ -624,6 +625,11 @@ public function discussion_template($d, $forumtype) {
$revealed = '<span class="label label-danger">'.$nonanonymous.'</span>';
}

$threadcontent = '';
if (!$hidethreadcontent) {
$threadcontent = '<div class="hsuforum-thread-content" tabindex="0">' . $d->message . '</div>';
}


$threadheader = <<<HTML
<div class="hsuforum-thread-header">
Expand All @@ -649,10 +655,7 @@ public function discussion_template($d, $forumtype) {
</div>

$threadheader

<div class="hsuforum-thread-content" tabindex="0">
$d->message
</div>
$threadcontent
$tools
</header>

Expand Down
1 change: 0 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
/* Hide things in the main view */
.hsuforum-thread .hsuforum-footer-reply,
.hsuforum-thread .hsuforum-thread-body,
.hsuforum-thread .hsuforum-thread-content,
.hsuforum-thread .hsuforum-replycount-link,
.hsuforum-reply-wrapper + header {
display: none;
Expand Down