From 96db467adbcc238d5a2e6df247ed05e054bdeb70 Mon Sep 17 00:00:00 2001
From: samhemelryk <samhemelryk>
Date: Tue, 8 Sep 2009 01:39:12 +0000
Subject: [PATCH] lib MDL-19799 Updated print_header_simple and
 build_navigation to OUTPUT and PAGE equivalents

---
 admin/roles/tabs.php                | 5 +++--
 lib/moodlelib.php                   | 8 ++++----
 my/index.php                        | 2 +-
 webservice/amf/testclient/index.php | 4 +++-
 4 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/admin/roles/tabs.php b/admin/roles/tabs.php
index c77f1081b18..5bb49ec1fcc 100755
--- a/admin/roles/tabs.php
+++ b/admin/roles/tabs.php
@@ -111,8 +111,9 @@ if ($currenttab != 'update') {
             if (empty($title)) {
                 $title = get_string("editinga", "moodle", $fullmodulename);
             }
-            print_header_simple($title, '', '', '', '', false);
-
+            $PAGE->set_title($title);
+            $PAGE->set_cacheable(false);
+            echo $OUTPUT->header();
             break;
 
         case CONTEXT_BLOCK:
diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index 5dece66877d..edf5400bbcc 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -2147,7 +2147,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
             //
             if ( !($COURSE->visible && course_parent_visible($COURSE)) &&
                    !has_capability('moodle/course:viewhiddencourses', $COURSE->context)) {
-                print_header_simple();
+                echo $OUTPUT->header();
                 notice(get_string('coursehidden'), $CFG->wwwroot .'/');
             }
         }
@@ -2174,7 +2174,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
 
                 case 1:    /// Guests always allowed
                     if (!has_capability('moodle/course:view', $COURSE->context)) {    // Prohibited by capability
-                        print_header_simple();
+                        echo $OUTPUT->header();
                         notice(get_string('guestsnotallowed', '', format_string($COURSE->fullname)), get_login_url());
                     }
                     if (!empty($cm) and !$cm->visible) { // Not allowed to see module, send to course page
@@ -2198,7 +2198,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
                 default:    /// Guests not allowed
                     $strloggedinasguest = get_string('loggedinasguest');
                     $PAGE->navbar->add($strloggedinasguest);
-                    print_header_simple();
+                    echo $OUTPUT->header();
                     if (empty($USER->access['rsw'][$COURSE->context->path])) {  // Normal guest
                         notice(get_string('guestsnotallowed', '', format_string($COURSE->fullname)), get_login_url());
                     } else {
@@ -2216,7 +2216,7 @@ function require_login($courseorid=0, $autologinguest=true, $cm=null, $setwantsu
             if (session_is_loggedinas()) {   // Make sure the REAL person can also access this course
                 $realuser = session_get_realuser();
                 if (!has_capability('moodle/course:view', $COURSE->context, $realuser->id)) {
-                    print_header_simple();
+                    echo $OUTPUT->header();
                     notice(get_string('studentnotallowed', '', fullname($USER, true)), $CFG->wwwroot .'/');
                 }
             }
diff --git a/my/index.php b/my/index.php
index 282b3a03dd7..43641c909b9 100644
--- a/my/index.php
+++ b/my/index.php
@@ -42,7 +42,7 @@
     $button = $OUTPUT->button($form);
 
     $header = $SITE->shortname . ': ' . $strmymoodle;
-    $navigation = build_navigation($strmymoodle);
+    $PAGE->navbar->add($strmymoodle);
     $loggedinas = user_login_string();
 
     if (empty($CFG->langmenu)) {
diff --git a/webservice/amf/testclient/index.php b/webservice/amf/testclient/index.php
index 1bcf6c78f0f..c14d0fdd9aa 100644
--- a/webservice/amf/testclient/index.php
+++ b/webservice/amf/testclient/index.php
@@ -17,7 +17,9 @@ $PAGE->requires->js('lib/ufo.js')->in_head();
 $PAGE->requires->data_for_js('FO', $args);
 $PAGE->requires->js_function_call('create_UFO_object', Array('moodletestclient'));
 
-print_header_simple('Test Client', 'Test Client');
+$PAGE->set_title('Test Client');
+$PAGE->set_heading('Test Client');
+echo $OUTPUT->header();
 echo '<div id="moodletestclient">
       <p>You need to install Flash 9.0</p>
     </div>';