Merge branch 'MDL-51307-master' of git://github.com/cameron1729/moodle

This commit is contained in:
Dan Poltawski 2015-09-08 09:11:57 +01:00
commit 07cc2db61b

View File

@ -3946,7 +3946,7 @@ EOD;
* @return string HTML for the header bar.
*/
public function context_header($headerinfo = null, $headinglevel = 1) {
global $DB, $USER;
global $DB, $USER, $CFG;
$context = $this->page->context;
// Make sure to use the heading if it has been set.
if (isset($headerinfo['heading'])) {
@ -3976,7 +3976,7 @@ EOD;
$imagedata = $this->user_picture($user, array('size' => 100));
// Check to see if we should be displaying a message button.
if ($USER->id != $user->id && has_capability('moodle/site:sendmessage', $context)) {
if (!empty($CFG->messaging) && $USER->id != $user->id && has_capability('moodle/site:sendmessage', $context)) {
$userbuttons = array(
'messages' => array(
'buttontype' => 'message',