MDL-41369 Set proper context and navigation path for user messages

This commit is contained in:
Marina Glancy
2013-08-26 17:32:57 +10:00
parent d2aa53be1b
commit 0e1bd87cc8
3 changed files with 25 additions and 9 deletions
+5 -1
View File
@@ -342,7 +342,11 @@ echo "</div></div>"; // Closing desriptionbox and userprofilebox.
if (isloggedin() && has_capability('moodle/site:sendmessage', $usercontext)
&& !empty($CFG->messaging) && !isguestuser() && !isguestuser($user) && ($USER->id != $user->id)) {
echo '<div class="messagebox">';
echo '<a href="'.$CFG->wwwroot.'/message/index.php?id='.$user->id.'">'.get_string('messageselectadd').'</a>';
$sendmessageurl = new moodle_url('/message/index.php', array('id' => $user->id));
if ($courseid) {
$sendmessageurl->param('viewing', MESSAGE_VIEW_COURSE. $courseid);
}
echo html_writer::link($sendmessageurl, get_string('messageselectadd'));
echo '</div>';
}