]> git.mjollnir.org Git - moodle.git/commitdiff
course MDL-19794 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
authorsamhemelryk <samhemelryk>
Mon, 7 Sep 2009 07:33:41 +0000 (07:33 +0000)
committersamhemelryk <samhemelryk>
Mon, 7 Sep 2009 07:33:41 +0000 (07:33 +0000)
course/editcategory.php

index c3b3a873842ac97f823faba195bc5d2c565ad5fb..cf2a48e15cab64b5f48eb3b8fcd07c42ba0fa9d2 100644 (file)
@@ -87,27 +87,21 @@ $strcategories = get_string('categories');
 $navlinks = array();
 
 if ($id) {
-    $navlinks[] = array('name' => $strtitle,
-                        'link' => null,
-                        'type' => 'misc');
+    $PAGE->navbar->add($strtitle);
     $title = $strtitle;
     $fullname = $category->name;
 } else {
-    $navlinks[] = array('name' => $stradministration,
-                        'link' => "$CFG->wwwroot/$CFG->admin/index.php",
-                        'type' => 'misc');
-    $navlinks[] = array('name' => $strcategories,
-                        'link' => 'index.php',
-                        'type' => 'misc');
-    $navlinks[] = array('name' => $straddnewcategory,
-                        'link' => null,
-                        'type' => 'misc');
+    $PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
+    $PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'));
+    $PAGE->navbar->add($straddnewcategory);
     $title = "$SITE->shortname: $straddnewcategory";
     $fullname = $SITE->fullname;
 }
 
-$navigation = build_navigation($navlinks);
-print_header($title, $fullname, $navigation, $mform->focus());
+$PAGE->set_title($title);
+$PAGE->set_heading($fullname);
+$PAGE->set_focuscontrol($mform->focus());
+echo $OUTPUT->header();
 echo $OUTPUT->heading($strtitle);
 
 $mform->display();