From b19cad7fd98ab3b8315109112b9f3513f29e5bdd Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 30 Jul 2004 15:33:52 +0000 Subject: [PATCH] New versions for socket-based chat --- mod/chat/gui_sockets/chatinput.php | 103 ++++++++++++++++++++--------- mod/chat/gui_sockets/index.php | 77 +++++++++++++++++---- 2 files changed, 135 insertions(+), 45 deletions(-) diff --git a/mod/chat/gui_sockets/chatinput.php b/mod/chat/gui_sockets/chatinput.php index 354486fac6..01d5f1dd3f 100644 --- a/mod/chat/gui_sockets/chatinput.php +++ b/mod/chat/gui_sockets/chatinput.php @@ -1,36 +1,75 @@ = 0) - { - echo $arsc_parameters["htmlhead_msginput_js"]; - ?> -
- " value=""> -
-
- - - -
- - - chatid)) { + error("No chat found"); +} + +require_login($chat->course); +optional_variable($chat_pretext, ''); + +?> + + + + +Message Input + +javascript"); ?> + + + + + + + + + +
+ +>> + +
+ + + +
chat_serverhost:$CFG->chat_serverport/"; ?>" method="GET" target="empty" id="chatform"> + + + + + + +
+ + + + + diff --git a/mod/chat/gui_sockets/index.php b/mod/chat/gui_sockets/index.php index aae09dc209..e3ea7c5c93 100644 --- a/mod/chat/gui_sockets/index.php +++ b/mod/chat/gui_sockets/index.php @@ -1,26 +1,77 @@ course)) { + error("Could not find the course this belongs to!"); + } + + if (!$cm = get_coursemodule_from_instance("chat", $chat->id, $course->id)) { + error("Course Module ID was incorrect"); + } + + require_login($course->id); + + if (isguest()) { + error("Guest does not have access to chat rooms"); + } + +/// Check to see if groups are being used here + if ($groupmode = groupmode($course, $cm)) { // Groups are being used + if ($currentgroup = get_and_set_current_group($course, $groupmode, $groupid)) { + if (!$group = get_record('groups', 'id', $currentgroup)) { + error("That group (id $currentgroup) doesn't exist!"); + } + $groupname = ': '.$group->name; + } else { + $groupname = ': '.get_string('allparticipants'); + } + } else { + $currentgroup = false; + $groupname = ''; + } + + if (!$chat_sid = chat_login_user($chat->id, 'sockets', $currentgroup)) { + error("Could not log in to chat room!!"); + } + + if ($currentgroup !== false) { + $params = "chat_enter=true&chat_sid=$chat_sid&groupid=$currentgroup"; + } else { + $params = "chat_enter=true&chat_sid=$chat_sid&groupid=0"; + } + + $strchat = get_string("modulename", "chat"); + + ?> + - <?php echo $arsc_parameters["title"]; ?> + <?php echo "$strchat: $course->shortname: $chat->name$groupname" ?> - - - - - - /?arsc_sid=" NAME="msg" scrolling="auto" noresize marginwidth="2" marginheight="0"> - - - + + + + chat_serverhost:$CFG->chat_serverport?win=chat&$params"; ?>" NAME="msg" scrolling="auto" noresize marginwidth="2" marginheight="0"> + + + - Sorry, this version of ARSC needs a browser that understands framesets. But we have a lynx-friendly version too. + Sorry, this version of Moodle Chat needs a browser that handles frames. -- 2.39.5