MDL-64119 user: Display full names consistently for teachers

Fix an error with users with the moodle/site:viewfullnames capability
in a course context (like teachers), to display properly the full
names in pages like the participants one.
This commit is contained in:
Sara Arjona
2018-11-20 19:48:23 +01:00
parent 56d8e413ba
commit 0a519e70d4
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -1200,7 +1200,7 @@ class flexible_table {
* This function is not part of the public api.
*/
function print_headers() {
global $CFG, $OUTPUT;
global $CFG, $OUTPUT, $PAGE;
echo html_writer::start_tag('thead');
echo html_writer::start_tag('tr');
@@ -1222,7 +1222,7 @@ class flexible_table {
case 'fullname':
// Check the full name display for sortable fields.
if (has_capability('moodle/site:viewfullnames', context_system::instance())) {
if (has_capability('moodle/site:viewfullnames', $PAGE->context)) {
$nameformat = $CFG->alternativefullnameformat;
} else {
$nameformat = $CFG->fullnamedisplay;