mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 08:26:37 +02:00
MDL-79913 grade: respect messaging config for user heading buttons.
This commit is contained in:
parent
87a08ab157
commit
b34c1981b9
1 changed files with 2 additions and 1 deletions
|
@ -998,7 +998,8 @@ function print_grade_page_head(int $courseid, string $active_type, ?string $acti
|
|||
$renderer = $PAGE->get_renderer('core_grades');
|
||||
// If the user is viewing their own grade report, no need to show the "Message"
|
||||
// and "Add to contact" buttons in the user heading.
|
||||
$showuserbuttons = $user->id != $USER->id;
|
||||
$showuserbuttons = $user->id != $USER->id && !empty($CFG->messaging) &&
|
||||
has_capability('moodle/site:sendmessage', $PAGE->context);
|
||||
$output = $renderer->user_heading($user, $courseid, $showuserbuttons);
|
||||
} else if (!empty($heading)) {
|
||||
$output = $OUTPUT->heading($heading);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue