Merge branch 'MDL-51307-29' of git://github.com/cameron1729/moodle into MOODLE_29_STABLE

This commit is contained in:
Dan Poltawski
2015-09-08 09:11:55 +01:00
+2 -2
View File
@@ -3937,7 +3937,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'])) {
@@ -3967,7 +3967,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',