$course = $DB->get_record('course', array('id'=>$course), '*', MUST_EXIST);
require_login($course);
+ // There is no page for this in the navigation. The closest we'll have is the course section.
+ // If the course section isn't displayed on the navigation this will fall back to the course which
+ // will be the closest match we have.
+ navigation_node::override_active_url(course_get_url($course, $section));
+
list($module, $context, $cw) = can_add_moduleinfo($course, $add, $section);
$cm = null;
} else {
$pageheading = get_string('addinganew', 'moodle', $fullmodulename);
}
+ $navbaraddition = $pageheading;
} else if (!empty($update)) {
} else {
$pageheading = get_string('updatinga', 'moodle', $fullmodulename);
}
+ $navbaraddition = null;
} else {
require_login();
$PAGE->set_heading($course->fullname);
$PAGE->set_title($streditinga);
$PAGE->set_cacheable(false);
+
+ if (isset($navbaraddition)) {
+ $PAGE->navbar->add($navbaraddition);
+ }
+
echo $OUTPUT->header();
if (get_string_manager()->string_exists('modulename_help', $module->name)) {