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
5 changes: 3 additions & 2 deletions block_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}
/**
Expand Down
1 change: 1 addition & 0 deletions lang/en/block_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
8 changes: 7 additions & 1 deletion renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}
Expand Down