From 968583af41b232f7f1dfcac035beb2aef8c6fdde Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Tue, 8 Sep 2009 01:30:04 +0000 Subject: [PATCH] tag MDL-19823 Updated print_header_simple and build_navigation to OUTPUT and PAGE equivalents --- tag/coursetags_edit.php | 8 ++++---- tag/coursetags_more.php | 10 ++++------ tag/edit.php | 12 ++++-------- tag/index.php | 15 +++++++-------- tag/manage.php | 11 ++++------- tag/search.php | 8 +++----- 6 files changed, 26 insertions(+), 38 deletions(-) diff --git a/tag/coursetags_edit.php b/tag/coursetags_edit.php index e3435d2a34a0f..c06a932f2e19a 100644 --- a/tag/coursetags_edit.php +++ b/tag/coursetags_edit.php @@ -56,10 +56,10 @@ $title = get_string('edittitle', $tagslang); $coursefullname = format_string($course->fullname); $courseshortname = format_string($course->shortname); -//$navigation[] = array('name' => $coursefullname, 'link' => $CFG->wwwroot.'/course/view.php?id='.$courseid, 'type' => 'misc'); -$navigation[] = array('name' => $title, 'link' => null, 'type' => 'misc'); -$nav = build_navigation($navigation); -print_header_simple($title, '', $nav, '', '', false); +$PAGE->navbar->add($title); +$PAGE->set_title($title); +$PAGE->set_cacheable(false); +echo $OUTPUT->header(); // Print personal tags for all courses $title = get_string('edittitle', $tagslang); diff --git a/tag/coursetags_more.php b/tag/coursetags_more.php index 176951f579cb3..1eb2728edb9fb 100644 --- a/tag/coursetags_more.php +++ b/tag/coursetags_more.php @@ -51,13 +51,11 @@ // The title and breadcrumb if ($courseid) { - $navigation[] = array('name' => format_string($course->shortname), 'link' => $CFG->wwwroot.'/course/view.php?id='.$courseid, 'type' => 'misc'); - $navigation[] = array('name' => $title, 'link' => null, 'type' => 'misc'); -} else { - $navigation[] = array('name' => $title, 'link' => null, 'type' => 'misc'); + $PAGE->navbar->add(format_string($course->shortname), new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$courseid))); } -$nav = build_navigation($navigation); -print_header_simple($title, '', $nav, '', '', false); +$PAGE->navbar->add($title); +$PAGE->set_title($title); +echo $OUTPUT->header(); echo $OUTPUT->heading($title, 'centre'); // Prepare data for tags diff --git a/tag/edit.php b/tag/edit.php index 6010df70cfccd..aa530f35dc764 100644 --- a/tag/edit.php +++ b/tag/edit.php @@ -108,14 +108,10 @@ } } - -$navlinks = array(); -$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => ''); -$navlinks[] = array('name' => $tagname, 'link' => '', 'type' => ''); - -$navigation = build_navigation($navlinks); -print_header_simple(get_string('tag', 'tag') . ' - '. $tagname, '', $navigation); - +$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php')); +$PAGE->navbar->add($tagname); +$PAGE->set_title(get_string('tag', 'tag') . ' - '. $tagname); +echo $OUTPUT->header(); echo $OUTPUT->heading($tagname, 2); if (!empty($errorstring)) { diff --git a/tag/index.php b/tag/index.php index 395a31d598018..1d43d3295ee92 100644 --- a/tag/index.php +++ b/tag/index.php @@ -41,19 +41,18 @@ } $tagname = tag_display_name($tag); - -$navlinks = array(); -$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => ''); -$navlinks[] = array('name' => $tagname, 'link' => '', 'type' => ''); - -$navigation = build_navigation($navlinks); $title = get_string('tag', 'tag') .' - '. $tagname; $button = ''; if ($PAGE->user_allowed_editing() ) { $button = $OUTPUT->edit_button(new moodle_url("$CFG->wwwroot/tag/index.php", array('id' => $tagid))); } -print_header_simple($title, '', $navigation, '', '', '', $button); + +$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php')); +$PAGE->navbar->add($tagname); +$PAGE->set_title($title); +$PAGE->set_button($button); +echo $OUTPUT->header(); // Manage all tags links if (has_capability('moodle/tag:manage', $systemcontext)) { @@ -100,7 +99,7 @@ if (has_capability('moodle/blog:view', $systemcontext)) { // You have to see blogs obviously $count = 10; - if ($blogs = blog_fetch_entries(array('tag'=>$tag->id)), $count) { + if ($blogs = blog_fetch_entries(array('tag'=>$tag->id), $count)) { echo $OUTPUT->box_start('generalbox', 'tag-blogs'); $heading = get_string('relatedblogs', 'tag', $tagname). ' ' . get_string('taggedwith', 'tag', $tagname); diff --git a/tag/manage.php b/tag/manage.php index 8508f1ef95916..d909966f4560f 100644 --- a/tag/manage.php +++ b/tag/manage.php @@ -29,13 +29,10 @@ $PAGE->set_url('tag/manage.php', $params); $PAGE->set_context($systemcontext); $PAGE->set_blocks_editing_capability('moodle/tag:editblocks'); - -$navlinks = array(); -$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => ''); -$navlinks[] = array('name' => get_string('managetags', 'tag'), 'link' => '', 'type' => ''); - -$navigation = build_navigation($navlinks); -print_header_simple(get_string('managetags', 'tag'), '', $navigation); +$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php')); +$PAGE->navbar->add(get_string('managetags', 'tag')); +$PAGE->set_title(get_string('managetags', 'tag')); +echo $OUTPUT->header(); $err_notice = ''; $notice = ''; diff --git a/tag/search.php b/tag/search.php index a509676ac864e..047e980cc68e9 100644 --- a/tag/search.php +++ b/tag/search.php @@ -27,14 +27,12 @@ $PAGE->set_url('tag/search.php', $params); $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM)); -$navlinks = array(); -$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => ''); -$navigation = build_navigation($navlinks); - $systemcontext = get_context_instance(CONTEXT_SYSTEM); $manage_link = ' '; -print_header_simple(get_string('tags', 'tag'), '', $navigation); +$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php')); +$PAGE->set_title(get_string('tags', 'tag')); +echo $OUTPUT->header(); if ( has_capability('moodle/tag:manage',$systemcontext) ) { echo '' ;