mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 12:40:01 +01:00
mod-chat MDL-19804 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
This commit is contained in:
parent
cfe1d03998
commit
296b589efd
@ -19,9 +19,8 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
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"));
|
||||
}
|
||||
|
||||
|
@ -95,9 +95,9 @@
|
||||
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>';
|
||||
|
@ -28,6 +28,7 @@ function stop() {
|
||||
|
||||
function start() {
|
||||
timer = setTimeout("update()", f*1000);
|
||||
YAHOO.util.Event.addListener(document.body, 'unload', stop);
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
@ -32,8 +32,9 @@
|
||||
$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"
|
||||
|
@ -25,7 +25,7 @@
|
||||
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"));
|
||||
}
|
||||
|
||||
|
@ -65,11 +65,8 @@
|
||||
}
|
||||
$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();
|
||||
|
@ -18,14 +18,15 @@
|
||||
$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>
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
}
|
||||
|
||||
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"));
|
||||
}
|
||||
|
||||
|
@ -21,12 +21,9 @@
|
||||
|
||||
|
||||
/// 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
|
||||
|
||||
|
@ -39,9 +39,9 @@
|
||||
/// 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);
|
||||
@ -103,9 +103,9 @@
|
||||
|
||||
|
||||
/// 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'));
|
||||
|
||||
|
@ -45,10 +45,8 @@
|
||||
|
||||
// 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);
|
||||
|
||||
@ -83,8 +81,10 @@
|
||||
}
|
||||
$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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user