From a1b0ac60fe844cb66fc8b02783ca6d478bd87f4a Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Fri, 7 Dec 2018 11:13:16 +0100 Subject: [PATCH] MDL-64339 core_comment: Update comment display to link to profile. --- comment/locallib.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/comment/locallib.php b/comment/locallib.php index ec0633e3e2dc5..dc30c34ec6d7b 100644 --- a/comment/locallib.php +++ b/comment/locallib.php @@ -170,6 +170,7 @@ public function print_comments($page = 0) { $link = new moodle_url('/comment/index.php', array('action' => 'delete', 'sesskey' => sesskey())); foreach ($comments as $c) { + $userdata = html_writer::link(new moodle_url('/user/profile.php', ['id' => $c->userid]), $c->fullname); $this->setup_plugin($c); if (!empty($this->plugintype)) { $context_url = plugin_callback($this->plugintype, $this->pluginname, 'comment', 'url', array($c)); @@ -180,7 +181,7 @@ public function print_comments($page = 0) { $action .= html_writer::empty_tag('br'); $action .= html_writer::link($context_url, get_string('commentincontext'), array('target'=>'_blank')); } - $table->data[] = array($checkbox, $c->fullname, $c->content, $action); + $table->data[] = array($checkbox, $userdata, $c->content, $action); } echo html_writer::table($table); echo $OUTPUT->paging_bar($count, $page, $this->perpage, $CFG->wwwroot.'/comment/index.php');