From: samhemelryk Date: Fri, 4 Sep 2009 05:50:21 +0000 (+0000) Subject: forum MDL-19808 Upgraded print_header and build_navigation calls to OUTPUT/PAGE equiv... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=15ca5e5e0de64da80a034a0e7c6264c1f51b5f46;p=moodle.git forum MDL-19808 Upgraded print_header and build_navigation calls to OUTPUT/PAGE equivilants --- diff --git a/mod/forum/discuss.php b/mod/forum/discuss.php index 4e4cdd69d0..b754816370 100644 --- a/mod/forum/discuss.php +++ b/mod/forum/discuss.php @@ -141,16 +141,14 @@ $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 diff --git a/mod/forum/index.php b/mod/forum/index.php index fa463d110d..71cab7c1c7 100644 --- a/mod/forum/index.php +++ b/mod/forum/index.php @@ -384,12 +384,11 @@ /// 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'); diff --git a/mod/forum/markposts.php b/mod/forum/markposts.php index 8ce1ebee80..b322fcf0bb 100644 --- a/mod/forum/markposts.php +++ b/mod/forum/markposts.php @@ -33,8 +33,9 @@ } 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').'

'.get_string('liketologin'), get_login_url(), $returnto); echo $OUTPUT->footer(); exit; diff --git a/mod/forum/post.php b/mod/forum/post.php index 516dd8a012..da4499ca92 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -50,9 +50,10 @@ 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').'

'.get_string('liketologin'), get_login_url(), get_referer(false)); echo $OUTPUT->footer(); exit; @@ -314,7 +315,7 @@ 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); @@ -327,7 +328,7 @@ 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); @@ -403,12 +404,10 @@ $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 '
'; @@ -749,18 +748,17 @@ $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)) { diff --git a/mod/forum/report.php b/mod/forum/report.php index e648ca7a6b..4f3f5a4e72 100644 --- a/mod/forum/report.php +++ b/mod/forum/report.php @@ -55,7 +55,8 @@ $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)); diff --git a/mod/forum/search.php b/mod/forum/search.php index d237e904a4..ed67ff01e5 100644 --- a/mod/forum/search.php +++ b/mod/forum/search.php @@ -99,13 +99,12 @@ 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(); @@ -119,14 +118,12 @@ $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) { @@ -139,9 +136,9 @@ exit; } - - print_header_simple("$strsearchresults", "", $navigation, '', "", "", $searchform, navmenu($course)); - + $PAGE->set_title($strsearchresults); + $PAGE->set_button($searchform); + echo $OUTPUT->header(); echo '