lesson MDL-19812 Updated print_header and build_navigation to OUTPUT and PAGE equivalents
authorsamhemelryk <samhemelryk>
Mon, 7 Sep 2009 06:28:37 +0000 (06:28 +0000)
committersamhemelryk <samhemelryk>
Mon, 7 Sep 2009 06:28:37 +0000 (06:28 +0000)
mod/lesson/import.php
mod/lesson/importppt.php
mod/lesson/index.php
mod/lesson/locallib.php
mod/lesson/mediafile.php

index 8dc26d8..1358e8e 100644 (file)
     $strimportquestions = get_string("importquestions", "lesson");
     $strlessons = get_string("modulenameplural", "lesson");
 
-    $navigation = build_navigation($strimportquestions, $cm);
-    print_header_simple("$strimportquestions", " $strimportquestions", $navigation);
+    $PAGE->navbar->add($strimportquestions);
+    $PAGE->set_title($strimportquestions);
+    $PAGE->set_heading($strimportquestions);
+    echo $OUTPUT->header();
 
     if ($form = data_submitted()) {   /// Filename
 
index 1e885e3..2a92304 100644 (file)
     $strimportppt = get_string("importppt", "lesson");
     $strlessons = get_string("modulenameplural", "lesson");
 
-    $navigation = build_navigation($strimportppt, $cm);
-    print_header_simple("$strimportppt", " $strimportppt", $navigation);
+    $PAGE->navbar->add($strimportppt);
+    $PAGE->set_title($strimportppt);
+    $PAGE->set_heading($strimportppt);
+    echo $OUTPUT->header();
 
     if ($form = data_submitted()) {   /// Filename
 
index f81bf85..f707ae3 100644 (file)
 
 
 /// Print the header
-    $navlinks = array();
-    $navlinks[] = array('name' => $strlessons, 'link' => '', 'type' => 'activity');
-
-    $navigation = build_navigation($navlinks);
-
-    print_header("$course->shortname: $strlessons", $course->fullname, $navigation, "", "", true, "", navmenu($course));
+    $PAGE->navbar->add($strlessons);
+    $PAGE->set_title("$course->shortname: $strlessons");
+    $PAGE->set_heading($course->fullname);
+    echo $OUTPUT->header();
 
 /// Get all the appropriate data
 
index f88658a..f02fb2b 100644 (file)
@@ -260,8 +260,10 @@ function lesson_print_header($cm, $course, $lesson, $currenttab = '', $extraedit
     }
 
 /// Header setup
-    $navigation = build_navigation(array(), $cm);
-    print_header($title, $course->fullname, $navigation, '', '', true, $buttons, navmenu($course, $cm));
+    $PAGE->set_title($title);
+    $PAGE->set_heading($course->fullname);
+    $PAGE->set_button($buttons);
+    echo $OUTPUT->header();
 
     if (has_capability('mod/lesson:manage', $context)) {
         print_heading_with_help($activityname, 'overview', 'lesson');
index b7516c8..af39fdf 100644 (file)
     $mimetype = mimeinfo("type", $lesson->mediafile);
 
     if (!is_url($lesson->mediafile) and !in_array($mimetype, array('text/plain', 'text/html'))) {
-        print_header($course->shortname);
+        $PAGE->set_title($course->shortname);
+        echo $OUTPUT->header();
     }
 
     if ($printclose) {  // this is for framesets
         if ($lesson->mediaclose) {
-            print_header($course->shortname);
+            $PAGE->set_title($course->shortname);
+            echo $OUTPUT->header();
             echo '<div class="lessonmediafilecontrol">
                 <form>
                 <div>