Skip to content

Commit

Permalink
lib MDL-19799 Updated print_header_simple and build_navigation to OUT…
Browse files Browse the repository at this point in the history
…PUT and PAGE equivalents
  • Loading branch information
samhemelryk committed Sep 8, 2009
1 parent 3856ca5 commit 96db467
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions admin/roles/tabs.php
Expand Up @@ -111,8 +111,9 @@
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:
Expand Down
8 changes: 4 additions & 4 deletions lib/moodlelib.php
Expand Up @@ -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 .'/');
}
}
Expand All @@ -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
Expand All @@ -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 {
Expand All @@ -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 .'/');
}
}
Expand Down
2 changes: 1 addition & 1 deletion my/index.php
Expand Up @@ -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)) {
Expand Down
4 changes: 3 additions & 1 deletion webservice/amf/testclient/index.php
Expand Up @@ -17,7 +17,9 @@
$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>';
Expand Down

0 comments on commit 96db467

Please sign in to comment.