mirror of
https://github.com/moodle/moodle.git
synced 2025-04-14 13:02:07 +02:00
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:
parent
0225ad42ea
commit
4ecb387d55
@ -2575,10 +2575,10 @@ class core_renderer extends renderer_base {
|
||||
* @return string
|
||||
*/
|
||||
protected function render_user_picture(user_picture $userpicture) {
|
||||
global $CFG, $DB;
|
||||
global $CFG, $DB, $PAGE;
|
||||
|
||||
$user = $userpicture->user;
|
||||
$canviewfullnames = has_capability('moodle/site:viewfullnames', context_system::instance());
|
||||
$canviewfullnames = has_capability('moodle/site:viewfullnames', $PAGE->context);
|
||||
|
||||
if ($userpicture->alttext) {
|
||||
if (!empty($user->imagealt)) {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user