require_login($course->id, false, $cm);
require_capability('mod/chat:chat',$context);
-if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id)))
-{
- print_header();
+if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id))) {
+ echo $OUTPUT->header();
notice(get_string("activityiscurrentlyhidden"));
}
redirect('index.php?id='.$id.'&newonly='.$newonly.'&last='.$last);
}
-
- print_header("$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname", '', '', 'message');
-
+ $PAGE->set_title("$strchat: $course->shortname: ".format_string($chat->name,true)."$groupname");
+ $PAGE->set_focuscontrol('message');
+ echo $OUTPUT->header();
echo '<div id="mod-chat-gui_basic">';
echo '<h1>'.get_string('participants').'</h1>';
echo '<div id="participants"><ul>';
function start() {
timer = setTimeout("update()", f*1000);
+ YAHOO.util.Event.addListener(document.body, 'unload', stop);
}
function update() {
$PAGE->set_course($course);
$PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head();
$PAGE->set_generaltype('embedded');
-
- print_header('', '', '', 'input_chat_message', '', false);
+ $PAGE->set_focuscontrol('input_chat_message');
+ $PAGE->set_cacheable(false);
+ echo $OUTPUT->header();
?>
<form action="../empty.php" method="post" target="empty" id="inputForm"
require_capability('mod/chat:chat',$context);
if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id))) {
- print_header();
+ echo $OUTPUT->header();
notice(get_string("activityiscurrentlyhidden"));
}
}
$PAGE->requires->data_for_js('uidles', $uidles)->in_head();
$PAGE->requires->js('mod/chat/gui_header_js/chat_gui_header.js')->in_head();
-
- // Use ob to support Keep-Alive
- ob_start();
- print_header('', '', '', '', '', false, '', '', false, 'onload="start()" onunload="stop()"');
-
+ $PAGE->requires->js_function_call('start')->on_dom_ready();
+ echo $OUTPUT->header();
/// Print user panel body
$timenow = time();
$PAGE->set_course($DB->get_record('course', array('id' => $chatuser->course)));
$PAGE->requires->js('mod/chat/gui_sockets/chat_gui_sockets.js')->in_head();
$PAGE->requires->js_function_call('setfocus');
- // TODO: there will be two onload in body tag, does it matter?
- print_header('', '', '', 'inputform.chat_message', '', false, ' ', '', false);
+ $PAGE->set_focuscontrol('chat_message');
+ $PAGE->set_cacheable(false);
+ echo $OUTPUT->header();
?>
<form action="../empty.php" method="get" target="empty" id="inputform"
onsubmit="return empty_field_and_submit();">
- <input type="text" name="chat_message" size="60" value="" />
+ <input type="text" name="chat_message" id="chat_message" size="60" value="" />
<?php echo $OUTPUT->help_icon(moodle_help_icon::make("chatting", get_string("helpchatting", "chat"), "chat", true)); ?>
</form>
}
if (!$cm->visible and !has_capability('moodle/course:viewhiddenactivities', get_context_instance(CONTEXT_MODULE, $cm->id))) {
- print_header();
+ echo $OUTPUT->header();
notice(get_string("activityiscurrentlyhidden"));
}
/// Print the header
-
- $navlinks = array();
- $navlinks[] = array('name' => $strchats, 'link' => '', 'type' => 'activity');
- $navigation = build_navigation($navlinks);
-
- print_header_simple($strchats, '', $navigation, '', '', true, '', navmenu($course));
+ $PAGE->navbar->add($strchats);
+ $PAGE->set_title($strchats);
+ echo $OUTPUT->header();
/// Get all the appropriate data
/// Print a session if one has been specified
if ($start and $end and !$confirmdelete) { // Show a full transcript
- $navigation = build_navigation($strchatreport, $cm);
- print_header_simple(format_string($chat->name).": $strchatreport", '', $navigation,
- '', '', true, '', navmenu($course, $cm));
+ $PAGE->navbar->add($strchatreport);
+ $PAGE->set_title(format_string($chat->name).": $strchatreport");
+ echo $OUTPUT->header();
/// Check to see if groups are being used here
$groupmode = groups_get_activity_groupmode($cm);
/// Print the Sessions display
- $navigation = build_navigation($strchatreport, $cm);
- print_header_simple(format_string($chat->name).": $strchatreport", '', $navigation,
- '', '', true, '', navmenu($course, $cm));
+ $PAGE->navbar->add($strchatreport);
+ $PAGE->set_title(format_string($chat->name).": $strchatreport");
+ echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($chat->name).': '.get_string('sessions', 'chat'));
// show some info for guests
if (isguestuser()) {
- $navigation = build_navigation('', $cm);
- print_header_simple(format_string($chat->name), '', $navigation,
- '', '', true, '', navmenu($course, $cm));
-
+ $PAGE->set_title(format_string($chat->name));
+ echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('noguests', 'chat').'<br /><br />'.get_string('liketologin'),
get_login_url(), $CFG->wwwroot.'/course/view.php?id='.$course->id);
}
$buttons .= '</tr></table>';
- $navigation = build_navigation(array(), $cm);
- print_header($title, $course->fullname, $navigation, '', '', true, $buttons, navmenu($course, $cm));
+ $PAGE->set_title($title);
+ $PAGE->set_heading($course->fullname);
+ $PAGE->set_button($buttons);
+ echo $OUTPUT->header();
/// Check to see if groups are being used here
$groupmode = groups_get_activity_groupmode($cm);