diff --git a/block_groups.php b/block_groups.php index 0474b78..91baac0 100644 --- a/block_groups.php +++ b/block_groups.php @@ -130,7 +130,7 @@ private function block_groups_get_content_teaching() { private function block_groups_get_content_groupmembers() { // Records the current course. - global $COURSE, $DB, $PAGE; + global $COURSE, $DB, $PAGE, $CFG, $USER; // Initialises an array to save the enrolled groups. $enrolledgroups = array(); // List renders all enrolled groups. @@ -154,7 +154,8 @@ private function block_groups_get_content_groupmembers() { $groupstext = ''; return $groupstext; } - $groupstext = $renderer->get_membership_content($enrolledgroups); + $href = $CFG->wwwroot ."/message/index.php?&user1=" . $USER->id ."&viewing=course_" . $COURSE->id; + $groupstext = $renderer->get_membership_content($enrolledgroups, $href); return $groupstext; } /** diff --git a/lang/en/block_groups.php b/lang/en/block_groups.php index 224e1cb..50c2fcb 100644 --- a/lang/en/block_groups.php +++ b/lang/en/block_groups.php @@ -36,3 +36,4 @@ $string['hidegroup'] = 'hide group'; $string['nochangeindatabasepossible'] = 'The required change was not possible'; $string['nocourse'] = 'Problem to find course, please try again later.'; +$string['message'] = 'Message'; diff --git a/renderer.php b/renderer.php index 600e043..0c25de2 100644 --- a/renderer.php +++ b/renderer.php @@ -119,8 +119,14 @@ public function get_groupingsarray($name, $counter) { * @params enrolledgroups * @return string */ - public function get_membership_content($enrolledgroups) { + public function get_membership_content($enrolledgroups, $href) { + global $OUTPUT; $membercontent = get_string('introduction', 'block_groups'); + foreach ($enrolledgroups as $g => $value) { + $img = html_writer::img($OUTPUT->pix_url('t/message'), get_string('message', 'block_groups'), + array('class' => "messagepic rightalign")); + $enrolledgroups[$g] = $value . html_writer::link($href , $img); + } $membercontent .= html_writer::alist($enrolledgroups); return html_writer::tag('div', $membercontent, array('class' => 'memberlist')); }