3 $nomoodlecookie = true; // Session not needed!
5 require('../../../config.php');
8 $chat_sid = required_param('chat_sid', PARAM_ALPHANUM
);
10 if (!$chatuser = get_record('chat_users', 'sid', $chat_sid)) {
11 error('Not logged in!');
15 $USER = get_record('user', 'id', $chatuser->userid
);
17 //Setup course, lang and theme
18 course_setup($chatuser->course
);
22 <script type
="text/javascript">
25 function empty_field_and_submit() {
26 if(waitFlag
) return false;
28 var input_chat_message
= document
.getElementById('input_chat_message');
29 document
.getElementById('sendForm').chat_message
.value
= input_chat_message
.value
;
30 input_chat_message
.value
= '';
31 input_chat_message
.className
= 'wait';
32 document
.getElementById('sendForm').submit();
37 function enableForm() {
38 var input_chat_message
= document
.getElementById('input_chat_message');
40 input_chat_message
.className
= '';
41 input_chat_message
.focus();
48 $meta = ob_get_clean();
49 print_header('', '', '', 'input_chat_message', $meta, false);
52 <form action
="../empty.php" method
="post" target
="empty" id
="inputForm"
53 onsubmit
="return empty_field_and_submit()">
54 >
;>
;<input type
="text" id
="input_chat_message" name
="chat_message" size
="60" value
="" />
55 <?php
helpbutton('chatting', get_string('helpchatting', 'chat'), 'chat', true, false); ?
>
58 <form action
="insert.php" method
="post" target
="empty" id
="sendForm">
59 <input type
="hidden" name
="chat_sid" value
="<?php echo $chat_sid ?>" />
60 <input type
="hidden" name
="chat_message" />