]> git.mjollnir.org Git - moodle.git/commitdiff
notes MDL-19818 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
authorsamhemelryk <samhemelryk>
Mon, 7 Sep 2009 05:31:58 +0000 (05:31 +0000)
committersamhemelryk <samhemelryk>
Mon, 7 Sep 2009 05:31:58 +0000 (05:31 +0000)
notes/delete.php
notes/edit.php
notes/index.php

index 1d8ad9f3a9c2f95124153e58457986ef091bfa88..95dc23750eb8c2c6a510423fc26cea9bdd483637 100644 (file)
@@ -53,13 +53,17 @@ if (data_submitted() && confirm_sesskey()) {
     $optionsno  = array('course'=>$course->id, 'user'=>$note->userid);
 
 // output HTML
+    $link = null;
     if (has_capability('moodle/course:viewparticipants', $context) || has_capability('moodle/site:viewparticipants', get_context_instance(CONTEXT_SYSTEM))) {
-        $nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
+        $link = new moodle_url($CFG->wwwroot.'/user/index.php',array('id'=>$course->id));
     }
-    $nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&amp;course=' . $course->id, 'type' => 'misc');
-    $nav[] = array('name' => get_string('notes', 'notes'), 'link' => $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $user->id, 'type' => 'misc');
-    $nav[] = array('name' => get_string('delete'), 'link' => '', 'type' => 'activity');
-    print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($nav));
+    $PAGE->navbar->add(get_string('participants'), $link);
+    $PAGE->navbar->add(fullname($user), new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id,'course'=>$course->id)));
+    $PAGE->navbar->add(get_string('notes', 'notes'), new moodle_url($CFG->wwwroot.'/notes/index.php', array('user'=>$user->id,'course'=>$course->id)));
+    $PAGE->navbar->add(get_string('delete'));
+    $PAGE->set_title($course->shortname . ': ' . $strnotes);
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
     echo $OUTPUT->confirm(get_string('deleteconfirm', 'notes'), new moodle_url('delete.php',$optionsyes),  new moodle_url('index.php',$optionsno));
     echo '<br />';
     note_print($note, NOTES_SHOW_BODY | NOTES_SHOW_HEAD);
index 512aa9c3a8145f70e8bd1807e23ff3ba90043834..271085e3829d58a5c1d5ba1c1f87e2ed6a17d166 100644 (file)
     }
 
 /// output HTML
-    $nav = array();
+    $link = null;
     if (has_capability('moodle/course:viewparticipants', $context) || has_capability('moodle/site:viewparticipants', get_context_instance(CONTEXT_SYSTEM))) {
-        $nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
+        $link = new moodle_url($CFG->wwwroot.'/user/index.php',array('id'=>$course->id));
     }
-    $nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&amp;course=' . $course->id, 'type' => 'misc');
-    $nav[] = array('name' => get_string('notes', 'notes'), 'link' => $CFG->wwwroot . '/notes/index.php?course=' . $course->id . '&amp;user=' . $user->id, 'type' => 'misc');
-    $nav[] = array('name' => $strnotes, 'link' => '', 'type' => 'activity');
-
-    print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($nav));
-
+    $PAGE->navbar->add(get_string('participants'), $link);
+    $PAGE->navbar->add(fullname($user), new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id,'course'=>$course->id)));
+    $PAGE->navbar->add(get_string('notes', 'notes'), new moodle_url($CFG->wwwroot.'/notes/index.php', array('user'=>$user->id,'course'=>$course->id)));
+    $PAGE->navbar->add($strnotes);
+    $PAGE->set_title($course->shortname . ': ' . $strnotes);
+    $PAGE->set_heading($course->fullname);
+    
+    echo $OUTPUT->header();
     echo $OUTPUT->heading(fullname($user));
 
     $noteform->display();
index 88f19dbff9560772954d22d63bf5c8f59b465ca2..2672ef2e6d903698dad775b1e3fb977ba6e95b35 100644 (file)
@@ -39,7 +39,7 @@
         $filterselect = $user->id;
 
         if ($user->deleted) {
-            print_header();
+            echo $OUTPUT->header();
             echo $OUTPUT->heading(get_string('userdeleted'));
             echo $OUTPUT->footer();
             die;
     $systemcontext = get_context_instance(CONTEXT_SYSTEM);   // SYSTEM context
 
     $strnotes = get_string('notes', 'notes');
-    $nav = array();
+    $link = null;
     if (has_capability('moodle/course:viewparticipants', $coursecontext) || has_capability('moodle/site:viewparticipants', $systemcontext)) {
-        $nav[] = array('name' => get_string('participants'), 'link' => $CFG->wwwroot . '/user/index.php?id=' . $course->id, 'type' => 'misc');
+        $link = new moodle_url($CFG->wwwroot.'/user/index.php',array('id'=>$course->id));
     }
+    $PAGE->navbar->add(get_string('participants'), $link);
     if ($userid) {
-        $nav[] = array('name' => fullname($user), 'link' => $CFG->wwwroot . '/user/view.php?id=' . $user->id. '&amp;course=' . $course->id, 'type' => 'misc');
+        $PAGE->navbar->add(fullname($user), new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id,'course'=>$course->id)));
     }
-    $nav[] = array('name' => $strnotes, 'link' => '', 'type' => 'misc');
-
-    print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($nav));
+    $PAGE->navbar->add($strnotes);
+    $PAGE->set_title($course->shortname . ': ' . $strnotes);
+    $PAGE->set_heading($course->fullname);
+    
+    echo $OUTPUT->header();
+    echo $OUTPUT->heading(fullname($user));
 
     $showroles = 1;
     $currenttab = 'notes';