course MDL-19794 Upgraded print_header and build_navigation calls to use PAGE and OUTPUT equivilants

This commit is contained in:
samhemelryk
2009-09-03 08:47:24 +00:00
parent f716d0dd3d
commit 0a122046bc
25 changed files with 181 additions and 162 deletions
+10 -15
View File
@@ -118,30 +118,25 @@
$straddnewcourse = get_string("addnewcourse");
$stradministration = get_string("administration");
$strcategories = get_string("categories");
$navlinks = array();
if (!empty($course)) {
$navlinks[] = array('name' => $streditcoursesettings,
'link' => null,
'type' => 'misc');
$PAGE->navbar->add($streditcoursesettings);
$title = $streditcoursesettings;
$fullname = $course->fullname;
} else {
$navlinks[] = array('name' => $stradministration,
'link' => "$CFG->wwwroot/$CFG->admin/index.php",
'type' => 'misc');
$navlinks[] = array('name' => $strcategories,
'link' => 'index.php',
'type' => 'misc');
$navlinks[] = array('name' => $straddnewcourse,
'link' => null,
'type' => 'misc');
$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
$PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/index.php'));
$PAGE->navbar->add($straddnewcourse);
$title = "$site->shortname: $straddnewcourse";
$fullname = $site->fullname;
}
$navigation = build_navigation($navlinks);
print_header($title, $fullname, $navigation, $editform->focus());
$PAGE->set_title($title);
$PAGE->set_heading($fullname);
$PAGE->set_focuscontrol($editform->focus());
echo $OUTPUT->header();
echo $OUTPUT->heading($streditcoursesettings);
$editform->display();