3 require_once('../../../config.php');
4 require_once('../lib.php');
6 $id = required_param('id', PARAM_INT
);
7 $groupid = optional_param('groupid', 0, PARAM_INT
); //only for teachers
9 if (!$chat = get_record('chat', 'id', $id)) {
10 error('Could not find that chat room!');
13 if (!$course = get_record('course', 'id', $chat->course
)) {
14 error('Could not find the course this belongs to!');
17 if (!$cm = get_coursemodule_from_instance('chat', $chat->id
, $course->id
)) {
18 error('Course Module ID was incorrect');
21 $context = get_context_instance(CONTEXT_MODULE
, $cm->id
);
23 require_login($course->id
, false, $cm);
25 require_capability('mod/chat:chat',$context);
27 if (!$cm->visible
and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE
, $cm->id
))) {
29 notice(get_string("activityiscurrentlyhidden"));
32 /// Check to see if groups are being used here
33 if ($groupmode = groupmode($course, $cm)) { // Groups are being used
34 if ($groupid = get_and_set_current_group($course, $groupmode, $groupid)) {
35 if (!$group = groups_get_group($groupid, false)) {
36 error("That group (id $groupid) doesn't exist!");
38 $groupname = ': '.$group->name
;
40 $groupname = ': '.get_string('allparticipants');
47 $strchat = get_string('modulename', 'chat'); // must be before current_language() in chat_login_user() to force course language!!!
49 if (!$chat_sid = chat_login_user($chat->id
, 'header_js', $groupid, $course)) {
50 error('Could not log in to chat room!!');
53 $params = "chat_sid=$chat_sid";
55 // fallback to the old jsupdate, but allow other update modes
56 $updatemode = 'jsupdate';
57 if (!empty($CFG->chat_normal_updatemode
)) {
58 $updatemode = $CFG->chat_normal_updatemode
;
62 <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
65 <meta http
-equiv
="content-type" content
="text/html; charset=utf-8" />
67 <?php
echo "$strchat: " . format_string($course->shortname
) . ": ".format_string($chat->name
,true)."$groupname" ?
>
70 <frameset cols
="*,200" border
="5" framespacing
="no" frameborder
="yes" marginwidth
="2" marginheight
="1">
71 <frameset rows
="0,0,*,50" border
="0" framespacing
="no" frameborder
="no" marginwidth
="2" marginheight
="1">
72 <frame src
="../empty.php" name
="empty" scrolling
="no" marginwidth
="0" marginheight
="0">
73 <frame src
="<?php echo $updatemode ?>.php?<?php echo $params ?>" name
="jsupdate" scrolling
="no" marginwidth
="0" marginheight
="0">
74 <frame src
="chatmsg.php?<?php echo $params ?>" name
="msg" scrolling
="auto" marginwidth
="2" marginheight
="1">
75 <frame src
="chatinput.php?<?php echo $params ?>" name
="input" scrolling
="no" marginwidth
="2" marginheight
="1">
77 <frame src
="users.php?<?php echo $params ?>" name
="users" scrolling
="auto" marginwidth
="5" marginheight
="5">
80 Sorry
, this version of Moodle Chat needs a browser that handles frames
.