adding some strings
[moodle-linuxchix.git] / mod / chat / gui_sockets / index.php
blob33ca929dc10a91e787000535cafed83ec3169879
1 <?php // $Id$
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 require_login($course->id, false, $cm);
23 if (isguest()) {
24 error('Guest does not have access to chat rooms');
27 if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id))) {
28 print_header();
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 (! groups_group_exists($groupid)) {
36 error("That group (id $groupid) doesn't exist!");
38 $groupname = ': '.$group->name;
39 } else {
40 $groupname = ': '.get_string('allparticipants');
42 } else {
43 $groupid = 0;
44 $groupname = '';
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, 'sockets', $groupid, $course)) {
50 error('Could not log in to chat room!!');
53 $params = "chat_sid=$chat_sid";
57 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
58 <html>
59 <head>
60 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
61 <title>
62 <?php echo "$strchat: " . format_string($course->shortname) . ": ".format_string($chat->name,true)."$groupname" ?>
63 </title>
64 </head>
65 <frameset cols="*,200" border="5" framespacing="no" frameborder="yes" marginwidth="2" marginheight="1">
66 <frameset rows="0,*,50" border="0" framespacing="no" frameborder="no" marginwidth="2" marginheight="1">
67 <frame src="empty.php" name="empty" scrolling="auto" noresize marginwidth="2" marginheight="0">
68 <frame src="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport?win=chat&amp;$params"; ?>" name="msg" scrolling="auto" noresize marginwidth="2" marginheight="0">
69 <frame src="chatinput.php?<?php echo $params ?>" name="input" scrolling="no" marginwidth="2" marginheight="1">
70 </frameset>
71 <frame src="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport?win=users&amp;$params"; ?>" name="users" scrolling="auto" marginwidth="5" marginheight="5">
72 </frameset>
73 <noframes>
74 Sorry, this version of Moodle Chat needs a browser that handles frames.
75 </noframes>
76 </html>