Merge branch 'MDL-64119-master' of git://github.com/sarjona/moodle

This commit is contained in:
Jun Pataleta 2018-11-22 09:52:56 +08:00
commit 9946d0a5bf
2 changed files with 4 additions and 4 deletions

View File

@ -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)) {

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;