assignments MDL-19803 Updated print_header and build_navigation to OUTPUT and PAGE...
authorsamhemelryk <samhemelryk>
Mon, 7 Sep 2009 06:23:46 +0000 (06:23 +0000)
committersamhemelryk <samhemelryk>
Mon, 7 Sep 2009 06:23:46 +0000 (06:23 +0000)
mod/assignment/index.php
mod/assignment/type/online/all.php
mod/assignment/type/upload/assignment.class.php

index 0e5136f..b39efec 100644 (file)
     $strsubmitted = get_string("submitted", "assignment");
     $strgrade = get_string("grade");
 
-    $navlinks = array();
-    $navlinks[] = array('name' => $strassignments, 'link' => '', 'type' => 'activity');
-    $navigation = build_navigation($navlinks);
-
-    print_header_simple($strassignments, "", $navigation, "", "", true, "", navmenu($course));
-
+    $PAGE->navbar->add($strassignments);
+    $PAGE->set_title($strassignments);
+    echo $OUTPUT->header();
+    
     if (!$cms = get_coursemodules_in_course('assignment', $course->id, 'm.assignmenttype, m.timedue')) {
         notice(get_string('noassignments', 'assignment'), "../../course/view.php?id=$course->id");
         die;
index 3a7054d..d8dbd1f 100644 (file)
     $str->topic = get_string('topic');
     $str->week = get_string('week');
 
-    // build navigation
-    $navlinks = array();
-    $navlinks[] = array('name' => $str->assignments, 
-        'link' => "$CFG->wwwroot/mod/assignment/index.php?id=$id", 'type' => 'activity');
-    $navlinks[] = array('name' => $str->onlinetext, 'link' => '', 'type' => 'activity');
-    $navigation = build_navigation($navlinks);
-
+    $PAGE->navbar->add($str->assignments, new moodle_url($CFG->wwwroot.'/mod/assignment/index.php', array('id'=>$id)));
+    $PAGE->navbar->add($str->onlinetext);
 
     // get all the assignments in the course
     $assignments = get_all_instances_in_course('assignment',$course, $USER->id );
 // DISPLAY
 //===================
 
-    print_header_simple($str->assignments, "", $navigation, "", "", true, "", navmenu($course));
+    $PAGE->set_title($str->assignments);
+    echo $OUTPUT->header();
 
     foreach ($views as $view) {
         echo $OUTPUT->container_start('clearfix generalbox assignment');
index 49072f8..31951ba 100644 (file)
@@ -798,7 +798,7 @@ class assignment_upload extends assignment_base {
 
 
     function delete_file() {
-        global $CFG, $DB, $OUTPUT;
+        global $CFG, $DB, $OUTPUT, $PAGE;
 
         $file     = required_param('file', PARAM_FILE);
         $userid   = required_param('userid', PARAM_INT);
@@ -832,7 +832,8 @@ class assignment_upload extends assignment_base {
             if (empty($mode)) {
                 $this->view_header(get_string('delete'));
             } else {
-                print_header(get_string('delete'));
+                $PAGE->set_title(get_string('delete'));
+                echo $OUTPUT->header();
             }
             echo $OUTPUT->heading(get_string('delete'));
             echo $OUTPUT->confirm(get_string('confirmdeletefile', 'assignment', $file), new moodle_url('delete.php', $optionsyes), new moodle_url($urlreturn, $optionsreturn));
@@ -861,7 +862,8 @@ class assignment_upload extends assignment_base {
         if (empty($mode)) {
             $this->view_header(get_string('delete'));
         } else {
-            print_header(get_string('delete'));
+            $PAGE->set_title(get_string('delete'));
+            echo $OUTPUT->header();
         }
         echo $OUTPUT->notification(get_string('deletefilefailed', 'assignment'));
         echo $OUTPUT->continue_button($returnurl);