From 3856ca5605a506d061eb1c75a2c907cc91f5aa47 Mon Sep 17 00:00:00 2001 From: samhemelryk Date: Tue, 8 Sep 2009 01:33:56 +0000 Subject: [PATCH] course MDL-19794 Updated print_header_simple and build_navigation to OUTPUT and PAGE equivalents --- course/editsection.php | 6 ++++-- course/enrol.php | 6 +++--- course/loginas.php | 5 +++-- course/mod.php | 5 +++-- course/modedit.php | 15 +++++++-------- course/resources.php | 4 ++-- 6 files changed, 22 insertions(+), 19 deletions(-) diff --git a/course/editsection.php b/course/editsection.php index 50c0bb8632..f3c32a65f6 100644 --- a/course/editsection.php +++ b/course/editsection.php @@ -50,8 +50,10 @@ $strsummaryof = get_string('summaryof', '', " $sectionname $section->section"); } - print_header_simple($stredit, '', build_navigation(array(array('name' => $stredit, 'link' => null, 'type' => 'misc'))), 'theform.summary' ); - + $PAGE->set_title($stredit); + $PAGE->navbar->add($stredit); + $PAGE->set_focuscontrol('theform.summary'); + echo $OUTPUT->header(); print_heading_with_help($strsummaryof, 'summaries'); $mform->display(); echo $OUTPUT->footer(); diff --git a/course/enrol.php b/course/enrol.php index 6dc1414b6d..24ce7fe9cf 100644 --- a/course/enrol.php +++ b/course/enrol.php @@ -50,13 +50,13 @@ /// Check if the course is a meta course (bug 5734) if ($course->metacourse) { - print_header_simple(); + echo $OUTPUT->header(); notice(get_string('coursenotaccessible'), "$CFG->wwwroot/index.php"); } /// Users can't enroll to site course if ($course->id == SITEID) { - print_header_simple(); + echo $OUTPUT->header(); notice(get_string('enrollfirst'), "$CFG->wwwroot/index.php"); } @@ -76,7 +76,7 @@ /// Check if the course is enrollable if (!method_exists($enrol, 'print_entry')) { - print_header_simple(); + echo $OUTPUT->header(); notice(get_string('enrolmentnointernal'), "$CFG->wwwroot/index.php"); } diff --git a/course/loginas.php b/course/loginas.php index 5404f5bca6..eb1263dad8 100644 --- a/course/loginas.php +++ b/course/loginas.php @@ -69,8 +69,9 @@ $strloginas = get_string('loginas'); $strloggedinas = get_string('loggedinas', '', $newfullname); - print_header_simple($strloggedinas, '', build_navigation(array(array('name'=>$strloggedinas, 'link'=>'','type'=>'misc'))), - '', '', true, ' ', navmenu($course)); + $PAGE->set_title($strloggedinas); + $PAGE->navbar->add($strloggedinas); + echo $OUTPUT->header(); notice($strloggedinas, "$CFG->wwwroot/course/view.php?id=$course->id"); diff --git a/course/mod.php b/course/mod.php index 5a4c73a657..a47e704e5c 100644 --- a/course/mod.php +++ b/course/mod.php @@ -64,8 +64,9 @@ $strdeletecheckfull = get_string('deletecheckfull', '', "$fullmodulename '$cm->name'"); $PAGE->set_pagetype('mod-' . $cm->modname . '-delete'); - - print_header_simple($strdeletecheck, '', build_navigation(array(array('name'=>$strdeletecheck, 'link'=>'', 'type'=>'misc')))); + $PAGE->set_title($strdeletecheck); + $PAGE->navbar->add($strdeletecheck); + echo $OUTPUT->header(); // print_simple_box_start('center', '60%', '#FFAAAA', 20, 'noticebox'); echo $OUTPUT->box_start('noticebox'); diff --git a/course/modedit.php b/course/modedit.php index edc42c2899..72df5fc58f 100644 --- a/course/modedit.php +++ b/course/modedit.php @@ -582,16 +582,15 @@ $streditinga = get_string('editinga', 'moodle', $fullmodulename); $strmodulenameplural = get_string('modulenameplural', $module->name); - $navlinks = array(); - $navlinks[] = array('name' => $strmodulenameplural, 'link' => "$CFG->wwwroot/mod/$module->name/index.php?id=$course->id", 'type' => 'activity'); + $PAGE->navbar->add($strmodulenameplural, new moodle_url($CFG->wwwroot.'/mod/'.$module->name.'/index.php', array('id'=>$course->id))); if ($navlinksinstancename) { - $navlinks[] = $navlinksinstancename; + $PAGE->navbar->add($navlinksinstancename); } - $navlinks[] = array('name' => $streditinga, 'link' => '', 'type' => 'title'); - - $navigation = build_navigation($navlinks); - - print_header_simple($streditinga, '', $navigation, $mform->focus(), "", false); + $PAGE->navbar->add($streditinga); + $PAGE->set_title($streditinga); + $PAGE->set_focuscontrol($mform->focus()); + $PAGE->set_cacheable(false); + echo $OUTPUT->header(); if (!empty($cm->id)) { $context = get_context_instance(CONTEXT_MODULE, $cm->id); diff --git a/course/resources.php b/course/resources.php index 4c64b44fab..e1fb68a0fc 100644 --- a/course/resources.php +++ b/course/resources.php @@ -61,8 +61,8 @@ $strlastmodified = get_string('lastmodified'); $PAGE->set_url('course/resources.php', array('id' => $course->id)); $PAGE->set_title($course->shortname.': '.$strresources); $PAGE->set_heading($course->fullname); -$navlinks = array(array('name' => $strresources, 'link' => '', 'type' => 'activityinstance')); -echo $OUTPUT->header(build_navigation($navlinks), navmenu($course)); +$PAGE->navbar->add($strresources); +echo $OUTPUT->header(); $modinfo = get_fast_modinfo($course); $cms = array(); -- 2.39.5