237f4886f623b767594db53c32270baa1f877b83
[moodle.git] / mod / chat / gui_sockets / chatinput.php
1 <?php
3 define('NO_MOODLE_COOKIES', true); // session not used here
5 require('../../../config.php');
6 require('../lib.php');
8 $chat_sid = required_param('chat_sid', PARAM_ALPHANUM);
10 $PAGE->set_url('/mod/chat/gui_sockets/chatinput.php', array('chat_sid'=>$chat_sid));
12 if (!$chatuser = $DB->get_record('chat_users', array('sid'=>$chat_sid))) {
13     print_error('notlogged', 'chat');
14 }
16 //Get the user theme
17 $USER = $DB->get_record('user', array('id'=>$chatuser->userid));
19 //Setup course, lang and theme
20 $PAGE->set_course($DB->get_record('course', array('id' => $chatuser->course)));
21 $PAGE->requires->js('/mod/chat/gui_sockets/chat_gui_sockets.js', true);
22 $PAGE->requires->js_function_call('setfocus');
23 $PAGE->set_focuscontrol('chat_message');
24 $PAGE->set_cacheable(false);
25 echo $OUTPUT->header();
27 ?>
29     <form action="../empty.php" method="get" target="empty" id="inputform"
30           onsubmit="return empty_field_and_submit();">
31         <label class="accesshide" for="chat_message"><?php print_string('entermessage', 'chat'); ?></label>
32         <input type="text" name="chat_message" id="chat_message" size="60" value="" />
33         <?php echo $OUTPUT->help_icon('usingchat', 'chat'); ?>
34     </form>
36     <form action="<?php echo "http://$CFG->chat_serverhost:$CFG->chat_serverport/"; ?>" method="get" target="empty" id="sendform">
37         <input type="hidden" name="win" value="message" />
38         <input type="hidden" name="chat_message" value="" />
39         <input type="hidden" name="chat_msgidnr" value="0" />
40         <input type="hidden" name="chat_sid" value="<?php echo $chat_sid ?>" />
41     </form>
42 <?php
43     echo $OUTPUT->footer();
44 ?>