*
* @param \mod_forum_renderer $renderer The render to be used for formatting the message and attachments
* @param bool $plaintext Whethe the target is a plaintext target
- * @return stdClass Data ready for use in a mustache template
+ * @return array Data ready for use in a mustache template
*/
public function export_for_template(\renderer_base $renderer, $plaintext = false) {
if ($plaintext) {
* Export this data so it can be used as the context for a mustache template.
*
* @param \mod_forum_renderer $renderer The render to be used for formatting the message and attachments
- * @return stdClass Data ready for use in a mustache template
+ * @return array Data ready for use in a mustache template
*/
protected function export_for_template_text(\mod_forum_renderer $renderer) {
return array(
'discussionlink' => $this->get_discussionlink(),
'authorlink' => $this->get_authorlink(),
- 'authorpicture' => $this->get_author_picture(),
+ 'authorpicture' => $this->get_author_picture($renderer),
- 'grouppicture' => $this->get_group_picture(),
+ 'grouppicture' => $this->get_group_picture($renderer),
);
}
* Export this data so it can be used as the context for a mustache template.
*
* @param \mod_forum_renderer $renderer The render to be used for formatting the message and attachments
- * @return stdClass Data ready for use in a mustache template
+ * @return array Data ready for use in a mustache template
*/
protected function export_for_template_html(\mod_forum_renderer $renderer) {
return array(
'discussionlink' => $this->get_discussionlink(),
'authorlink' => $this->get_authorlink(),
- 'authorpicture' => $this->get_author_picture(),
+ 'authorpicture' => $this->get_author_picture($renderer),
- 'grouppicture' => $this->get_group_picture(),
+ 'grouppicture' => $this->get_group_picture($renderer),
);
}
/**
* The HTML for the author's user picture.
*
+ * @param \renderer_base $renderer
* @return string
*/
- public function get_author_picture() {
- global $OUTPUT;
-
- return $OUTPUT->user_picture($this->author, array('courseid' => $this->course->id));
+ public function get_author_picture(\renderer_base $renderer) {
+ return $renderer->user_picture($this->author, array('courseid' => $this->course->id));
}
/**
* The HTML for a group picture.
*
+ * @param \renderer_base $renderer
* @return string
*/
- public function get_group_picture() {
+ public function get_group_picture(\renderer_base $renderer) {
if (isset($this->userfrom->groups)) {
$groups = $this->userfrom->groups[$this->forum->id];
} else {
}
if ($this->get_is_firstpost()) {
- return print_group_picture($groups, $this->course->id, false, true, true);
+ return print_group_picture($groups, $this->course->id, false, true, true, true);
}
}
}