$searchform = forum_search_form($course);
- $navlinks = array();
- $navlinks[] = array('name' => format_string($discussion->name), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title');
+ $PAGE->navbar->add(format_string($discussion->name), new moodle_url($CFG->wwwroot.'/mod/forum/discuss.php', array('id'=>$discussion->id)));
if ($parent != $discussion->firstpost) {
- $navlinks[] = array('name' => format_string($post->subject), 'type' => 'title');
+ $PAGE->navbar->add(format_string($post->subject));
}
-
- $navigation = build_navigation($navlinks, $cm);
- print_header("$course->shortname: ".format_string($discussion->name), $course->fullname,
- $navigation, "", "", true, $searchform, navmenu($course, $cm));
-
+ $PAGE->set_title("$course->shortname: ".format_string($discussion->name));
+ $PAGE->set_heading($course->fullname);
+ $PAGE->set_button($searchform);
+ echo $OUTPUT->header();
/// Check to see if groups are being used in this forum
/// If so, make sure the current person is allowed to see this discussion
/// Output the page
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => '', 'type' => 'activity');
-
- print_header("$course->shortname: $strforums", $course->fullname,
- build_navigation($navlinks),
- "", "", true, $searchform, navmenu($course));
+ $PAGE->navbar->add($strforums);
+ $PAGE->set_title("$course->shortname: $strforums");
+ $PAGE->set_heading($course->fullname);
+ $PAGE->set_button($searchform);
+ echo $OUTPUT->header();
if (!isguest()) {
echo $OUTPUT->box_start('subscription');
}
if (isguest()) { // Guests can't change forum
- $navigation = build_navigation('', $cm);
- print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
+ $PAGE->set_title($course->shortname);
+ $PAGE->set_heading($course->fullname);
+ echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('noguesttracking', 'forum').'<br /><br />'.get_string('liketologin'), get_login_url(), $returnto);
echo $OUTPUT->footer();
exit;
require_login();
}
- $navigation = build_navigation('', $cm);
- print_header($course->shortname, $course->fullname, $navigation, '' , '', true, "", navmenu($course, $cm));
-
+ $PAGE->set_title($course->shortname);
+ $PAGE->set_heading($course->fullname);
+
+ echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('noguestpost', 'forum').'<br /><br />'.get_string('liketologin'), get_login_url(), get_referer(false));
echo $OUTPUT->footer();
exit;
print_error("couldnotdeletereplies", "forum",
forum_go_back_to("discuss.php?d=$post->discussion"));
}
- print_header();
+ echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string("deletesureplural", "forum", $replycount+1),
"post.php?delete=$delete&confirm=$delete",
$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#p'.$post->id);
forum_print_posts_nested($course, $cm, $forum, $discussion, $post, false, false, $forumtracked, $posts);
}
} else {
- print_header();
+ echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string("deletesure", "forum", $replycount),
"post.php?delete=$delete&confirm=$delete",
$CFG->wwwroot.'/mod/forum/discuss.php?d='.$post->discussion.'#p'.$post->id);
$course = $DB->get_record('course', array('id' => $forum->course));
- $navlinks = array();
- $navlinks[] = array('name' => format_string($post->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title');
- $navlinks[] = array('name' => get_string("prune", "forum"), 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks, $cm);
- print_header_simple(format_string($discussion->name).": ".format_string($post->subject), "", $navigation, '', "", true, "", navmenu($course, $cm));
-
+ $PAGE->navbar->add(format_string($post->subject, true), new moodle_url($CFG->wwwroot.'/mod/forum/discuss.php', array('d'=>$discussion->id)));
+ $PAGE->navbar->add(get_string("prune", "forum"));
+ $PAGE->set_title(format_string($discussion->name).": ".format_string($post->subject));
+ echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('pruneheading', 'forum'));
echo '<center>';
$forcefocus = empty($reply) ? NULL : 'message';
- $navlinks = array();
+
+ $PAGE->navbar->add(format_string($toppost->subject, true), "discuss.php?d=$discussion->id");
if ($post->parent) {
- $navlinks[] = array('name' => format_string($toppost->subject, true), 'link' => "discuss.php?d=$discussion->id", 'type' => 'title');
- $navlinks[] = array('name' => get_string('editing', 'forum'), 'link' => '', 'type' => 'title');
- } else {
- $navlinks[] = array('name' => format_string($toppost->subject), 'link' => '', 'type' => 'title');
+ $PAGE->navbar->add(get_string('editing', 'forum'));
}
- $navigation = build_navigation($navlinks, $cm);
- print_header("$course->shortname: $strdiscussionname ".
- format_string($toppost->subject), $course->fullname,
- $navigation, $mform_post->focus($forcefocus), "", true, "", navmenu($course, $cm));
+ $PAGE->set_title("$course->shortname: $strdiscussionname ".format_string($toppost->subject));
+ $PAGE->set_heading($course->fullname);
+ $PAGE->set_focuscontrol($mform_post->focus($forcefocus));
+
+ echo $OUTPUT->header();
// checkup
if (!empty($parent) && !forum_user_can_see_post($forum, $discussion, $post, null, $cm)) {
$strname = get_string('name');
$strtime = get_string('time');
- print_header("$strratings: ".format_string($post->subject));
+ $PAGE->set_title("$strratings: ".format_string($post->subject));
+ echo $OUTPUT->header();
if (!$ratings = forum_get_ratings($post->id, $sqlsort)) {
print_error('noresult', 'forum', '', format_string($post->subject));
if (!$search || $showform) {
- $navlinks = array();
- $navlinks[] = array('name' => $strforums, 'link' => "index.php?id=$course->id", 'type' => 'activity');
- $navlinks[] = array('name' => $strsearch, 'link' => '', 'type' => 'title');
- $navigation = build_navigation($navlinks);
+ $PAGE->navbar->add($strforums, new moodle_url($CFG->wwwroot.'/mod/forum/index.php', array('id'=>$course->id)));
+ $PAGE->navbar->add($strsearch);
- print_header_simple("$strsearch", "", $navigation, 'search.words',
- "", "", " ", navmenu($course));
+ $PAGE->set_title($strsearch);
+ $PAGE->set_focuscontrol('search.words');
+ echo $OUTPUT->header();
forum_print_big_search_form($course);
echo $OUTPUT->footer();
$searchform = forum_search_form($course, $search);
- $navlinks = array();
- $navlinks[] = array('name' => $strsearch, 'link' => "search.php?id=$course->id", 'type' => 'activityinstance');
- $navlinks[] = array('name' => s($search, true), 'link' => '', 'type' => 'link');
- $navigation = build_navigation($navlinks);
-
-
+ $PAGE->navbar->add($strsearch, new moodle_url($CFG->wwwroot.'/mod/forum/search.php', array('id'=>$course->id)));
+ $PAGE->navbar->add(s($search, true));
if (!$posts = forum_search_posts($searchterms, $course->id, $page*$perpage, $perpage, $totalcount)) {
- print_header_simple("$strsearchresults", "", $navigation, 'search.words', "", "", " ", navmenu($course));
+ $PAGE->set_title($strsearchresults);
+ $PAGE->set_focuscontrol('search.words');
+ echo $OUTPUT->header();
echo $OUTPUT->heading(get_string("nopostscontaining", "forum", $search));
if (!$individualparams) {
exit;
}
-
- print_header_simple("$strsearchresults", "", $navigation, '', "", "", $searchform, navmenu($course));
-
+ $PAGE->set_title($strsearchresults);
+ $PAGE->set_button($searchform);
+ echo $OUTPUT->header();
echo '<div class="reportlink">';
echo '<a href="search.php?id='.$course->id.
'&user='.urlencode($user).
require_login($course->id, false, $cm);
if (isguest()) { // Guests can't subscribe
-
- $navigation = build_navigation('', $cm);
- print_header($course->shortname, $course->fullname, $navigation, '', '', true, "", navmenu($course, $cm));
-
+ $PAGE->set_title($course->shortname);
+ $PAGE->set_heading($course->fullname);
+ echo $OUTPUT->header();
echo $OUTPUT->confirm(get_string('noguestsubscribe', 'forum').'<br /><br />'.get_string('liketologin'),
get_login_url(), new moodle_url());
echo $OUTPUT->footer();
$strsubscribers = get_string("subscribers", "forum");
$strforums = get_string("forums", "forum");
- $navigation = build_navigation($strsubscribers, $cm);
-
+ $PAGE->navbar->add($strsubscribers);
+ $PAGE->set_title($strsubscribers);
if (has_capability('mod/forum:managesubscriptions', $context)) {
- print_header_simple("$strsubscribers", "", $navigation,
- "", "", true, forum_update_subscriptions_button($course->id, $id));
+ $PAGE->set_button(forum_update_subscriptions_button($course->id, $id));
if ($edit != -1) {
$USER->subscriptionsediting = $edit;
}
} else {
- print_header_simple("$strsubscribers", "", $navigation, "", "", true, '');
unset($USER->subscriptionsediting);
}
+ echo $OUTPUT->header();
/// Check to see if groups are being used in this forum
groups_print_activity_menu($cm, "subscribers.php?id=$forum->id");
}
$strunsubscribeall = get_string('unsubscribeall', 'forum');
-$navlinks = array(array('name' => get_string('modulename', 'forum'), 'link' => null, 'type' => 'misc'),
- array('name' => $strunsubscribeall, 'link' => null, 'type' => 'misc'));
-$navigation = build_navigation($navlinks);
-
-print_header($strunsubscribeall, format_string($COURSE->fullname), $navigation);
+$PAGE->navbar->add(get_string('modulename', 'forum'));
+$PAGE->navbar->add($strunsubscribeall);
+$PAGE->set_title($strunsubscribeall);
+$PAGE->set_heading(format_string($COURSE->fullname));
+echo $OUTPUT->header();
echo $OUTPUT->heading($strunsubscribeall);
if (data_submitted() and $confirm and confirm_sesskey()) {
}
if ($user->deleted) {
- print_header();
+ echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('userdeleted'));
echo $OUTPUT->footer();
die;
$strmode = get_string($mode, 'forum');
$fullname = fullname($user, has_capability('moodle/site:viewfullnames', $syscontext));
-$navlinks = array();
+$link = null;
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id)) || has_capability('moodle/site:viewparticipants', $syscontext)) {
- $navlinks[] = array('name' => $strparticipants, 'link' => "$CFG->wwwroot/user/index.php?id=$course->id", 'type' => 'core');
+ $link = new moodle_url($CFG->wwwroot.'/user/index.php',array('id'=>$course->id));
}
-$navlinks[] = array('name' => $fullname, 'link' => "$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id", 'type' => 'title');
-$navlinks[] = array('name' => $strforumposts, 'link' => '', 'type' => 'title');
-$navlinks[] = array('name' => $strmode, 'link' => '', 'type' => 'title');
-
-$navigation = build_navigation($navlinks);
-
-print_header("$course->shortname: $fullname: $strmode", $course->fullname,$navigation);
-
+$PAGE->navbar->add($strparticipants, $link);
+$PAGE->navbar->add($fullname, new moodle_url($CFG->wwwroot.'/user/view.php',array('id'=>$user->id,'course'=>$course->id)));
+$PAGE->navbar->add($strforumposts);
+$PAGE->navbar->add($strmode);
+
+$PAGE->set_title("$course->shortname: $fullname: $strmode");
+$PAGE->set_heading($course->fullname);
+echo $OUTPUT->header();
$currenttab = $mode;
$showroles = 1;