MDL-74179 mod_chat: Fix warnings header when accessing as a guest
Initialize before showing the no guest message when user is accesing as a guest.
This commit is contained in:
+8
-10
@@ -58,9 +58,16 @@ require_course_login($course, true, $cm);
|
||||
$context = context_module::instance($cm->id);
|
||||
$PAGE->set_context($context);
|
||||
|
||||
// Initialize $PAGE.
|
||||
$courseshortname = format_string($course->shortname, true, array('context' => context_course::instance($course->id)));
|
||||
$title = $courseshortname . ': ' . format_string($chat->name);
|
||||
$PAGE->set_url('/mod/chat/view.php', ['id' => $cm->id]);
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->add_body_class('limitedwidth');
|
||||
|
||||
// Show some info for guests.
|
||||
if (isguestuser()) {
|
||||
$PAGE->set_title($chat->name);
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->confirm('<p>'.get_string('noguests', 'chat').'</p>'.get_string('liketologin'),
|
||||
get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
|
||||
@@ -76,15 +83,6 @@ $strenterchat = get_string('enterchat', 'chat');
|
||||
$stridle = get_string('idle', 'chat');
|
||||
$strcurrentusers = get_string('currentusers', 'chat');
|
||||
|
||||
$courseshortname = format_string($course->shortname, true, array('context' => context_course::instance($course->id)));
|
||||
$title = $courseshortname . ': ' . format_string($chat->name);
|
||||
|
||||
// Initialize $PAGE.
|
||||
$PAGE->set_url('/mod/chat/view.php', array('id' => $cm->id));
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$PAGE->add_body_class('limitedwidth');
|
||||
|
||||
// Check to see if groups are being used here.
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
|
||||
Reference in New Issue
Block a user