]> git.mjollnir.org Git - moodle.git/commitdiff
message MDL-19801 Upgraded print_header and build_navigation calls to use PAGE and...
authorsamhemelryk <samhemelryk>
Thu, 3 Sep 2009 08:58:41 +0000 (08:58 +0000)
committersamhemelryk <samhemelryk>
Thu, 3 Sep 2009 08:58:41 +0000 (08:58 +0000)
message/edit.php

index f007c9ab534b8a1e480707d5dfe3940b254b24bc..0b58c1304c91c52550637b1f6d4a90a831a6c578 100644 (file)
     $strparticipants  = get_string('participants');
     $userfullname     = fullname($user, true);
 
-    $navlinks = array();
     if (has_capability('moodle/course:viewparticipants', $coursecontext) || 
         has_capability('moodle/site:viewparticipants', $systemcontext)) {
-        $navlinks[] = array('name' => $strparticipants, 'link' => "index.php?id=$course->id", 'type' => 'misc');
+        $PAGE->navbar->add($strparticipants, null, null, navigation_node::TYPE_CUSTOM,
+                           new moodle_url($CFG->wwwroot.'/message/index.php', array('id'=>$course->id)));
     }
-    $navlinks[] = array('name' => $userfullname,
-                        'link' => "view.php?id=$user->id&amp;course=$course->id",
-                        'type' => 'misc');
-    $navlinks[] = array('name' => $streditmymessage, 'link' => null, 'type' => 'misc');
-    $navigation = build_navigation($navlinks);
-
+    $PAGE->navbar->add($userfullname, null, null, navigation_node::TYPE_CUSTOM,
+                       new moodle_url($CFG->wwwroot.'/message/view.php', array('id'=>$user->id, 'course'=>$course->id)));
+    $PAGE->navbar->add($streditmymessage);
+    $PAGE->set_title("$course->shortname: $streditmymessage");
     if ($course->id != SITEID) {
-        print_header("$course->shortname: $streditmymessage", "$course->fullname: $streditmymessage", $navigation);
+        $PAGE->set_heading("$course->fullname: $streditmymessage");
     } else {
-        print_header("$course->shortname: $streditmymessage", $course->fullname, $navigation);
+        $PAGE->set_heading($course->fullname);
     }
+    echo $OUTPUT->header();
 
 /// Print tabs at the top
     $showroles = 1;