2009-09-23 07:08:43 +00:00
|
|
|
<?php
|
2003-07-07 06:44:16 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
define('NO_MOODLE_COOKIES', true); // session not used here
|
2003-07-07 06:44:16 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
require('../../../config.php');
|
|
|
|
require('../lib.php');
|
2003-07-07 09:45:08 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
$chat_sid = required_param('chat_sid', PARAM_ALPHANUM);
|
|
|
|
$chatid = required_param('chat_id', PARAM_INT);
|
2003-07-07 09:45:08 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
if (!$chatuser = $DB->get_record('chat_users', array('sid'=>$chat_sid))) {
|
|
|
|
print_error('notlogged', 'chat');
|
|
|
|
}
|
|
|
|
if (!$chat = $DB->get_record('chat', array('id'=>$chatid))) {
|
|
|
|
print_error('invalidid', 'chat');
|
|
|
|
}
|
2008-12-16 04:58:40 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
if (!$course = $DB->get_record('course', array('id'=>$chat->course))) {
|
|
|
|
print_error('invalidcourseid');
|
|
|
|
}
|
2008-12-16 04:58:40 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
if (!$cm = get_coursemodule_from_instance('chat', $chat->id, $course->id)) {
|
|
|
|
print_error('invalidcoursemodule');
|
|
|
|
}
|
2009-09-17 06:17:05 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/chat/gui_header_js/chatinput.php', array('chat_sid'=>$chat_sid, 'chat_id'=>$chatid)));
|
2009-09-17 06:17:05 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
2003-07-07 09:45:08 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
//Get the user theme
|
|
|
|
$USER = $DB->get_record('user', array('id'=>$chatuser->userid));
|
2005-09-10 22:57:21 +00:00
|
|
|
|
2009-09-23 07:08:43 +00:00
|
|
|
//Setup course, lang and theme
|
|
|
|
$PAGE->set_course($course);
|
|
|
|
$PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head();
|
2009-12-16 18:00:58 +00:00
|
|
|
$PAGE->set_pagelayout('embedded');
|
2009-09-23 07:08:43 +00:00
|
|
|
$PAGE->set_focuscontrol('input_chat_message');
|
|
|
|
$PAGE->set_cacheable(false);
|
|
|
|
echo $OUTPUT->header();
|
2003-07-07 06:44:16 +00:00
|
|
|
|
2005-02-03 20:39:27 +00:00
|
|
|
?>
|
2007-01-04 21:32:36 +00:00
|
|
|
<form action="../empty.php" method="post" target="empty" id="inputForm"
|
2008-06-18 04:06:11 +00:00
|
|
|
onsubmit="return empty_field_and_submit()" style="margin:0">
|
|
|
|
<input type="text" id="input_chat_message" name="chat_message" size="50" value="" />
|
2009-08-18 05:02:38 +00:00
|
|
|
<?php echo $OUTPUT->help_icon(moodle_help_icon::make('chatting', get_string('helpchatting', 'chat'), 'chat', true)); ?><br />
|
2008-10-08 06:48:57 +00:00
|
|
|
<input type="checkbox" id="auto" size="50" value="" checked='true' /><label for="auto"><?php echo get_string('autoscroll', 'chat');?></label>
|
2005-02-03 20:39:27 +00:00
|
|
|
</form>
|
|
|
|
|
2007-01-04 21:32:36 +00:00
|
|
|
<form action="insert.php" method="post" target="empty" id="sendForm">
|
2005-02-03 20:39:27 +00:00
|
|
|
<input type="hidden" name="chat_sid" value="<?php echo $chat_sid ?>" />
|
|
|
|
<input type="hidden" name="chat_message" />
|
|
|
|
</form>
|
2007-12-14 21:22:38 +00:00
|
|
|
<?php
|
2009-08-06 14:15:30 +00:00
|
|
|
echo $OUTPUT->footer();
|
2007-12-14 21:22:38 +00:00
|
|
|
?>
|