lib MDL-19799 Updated print_header_simple and build_navigation to OUTPUT and PAGE equivalents

This commit is contained in:
samhemelryk 2009-09-08 01:39:12 +00:00
parent 3856ca5605
commit 96db467adb
4 changed files with 11 additions and 8 deletions

View File

@ -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:

View File

@ -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 .'/');
}
}

View File

@ -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)) {

View File

@ -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>';