]> git.mjollnir.org Git - moodle.git/commitdiff
tag MDL-19823 Updated print_header_simple and build_navigation to OUTPUT and PAGE...
authorsamhemelryk <samhemelryk>
Tue, 8 Sep 2009 01:30:04 +0000 (01:30 +0000)
committersamhemelryk <samhemelryk>
Tue, 8 Sep 2009 01:30:04 +0000 (01:30 +0000)
tag/coursetags_edit.php
tag/coursetags_more.php
tag/edit.php
tag/index.php
tag/manage.php
tag/search.php

index e3435d2a34a0f10f9231cf09cd2333f956b038c7..c06a932f2e19a3b0eea6b6ca72342cf7d295c867 100644 (file)
@@ -56,10 +56,10 @@ if ($data = data_submitted()) {
 $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);
index 176951f579cb3ada13db6471c12b2cc707884f10..1eb2728edb9fb83ed12fcf77f02608d13f9ab471 100644 (file)
@@ -51,13 +51,11 @@ $welcome = get_string('morewelcome', $tagslang);
 
 // 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
index 6010df70cfccd4f59eb1bacbe5868ba834eb501a..aa530f35dc764569423e88bf5d9c77291e603006 100644 (file)
@@ -108,14 +108,10 @@ if ($tagnew = $tagform->get_data()) {
     }
 }
 
-
-$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)) {
index 395a31d59801864cd56798b7f6645b63de649ead..1d43d3295ee922d1d476ad78114f9ebb098a8458 100644 (file)
@@ -41,19 +41,18 @@ if (($edit != -1) and $PAGE->user_allowed_editing()) {
 }
 
 $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 ($courses = coursetag_get_tagged_courses($tag->id)) {
 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);
index 8508f1ef959160db181f1f49592f7cfae4c7506c..d909966f4560fbe707a2b79696534eb135ee437b 100644 (file)
@@ -29,13 +29,10 @@ if ($perpage != DEFAULT_PAGE_SIZE) {
 $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 = '';
index a509676ac864e122dc8df9b55c55b090fac28474..047e980cc68e9e7d127218246bdd6c37e473d3a4 100644 (file)
@@ -27,14 +27,12 @@ if ($perpage) {
 $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 = '&nbsp;';
 
-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 '<div class="managelink"><a href="'. $CFG->wwwroot .'/tag/manage.php">' . get_string('managetags', 'tag') . '</a></div>' ;