MDL-47146 core_grades: fix navigation bar in grades setup pages

Part of: MDL-46576
This commit is contained in:
Marina Glancy 2014-09-17 13:50:55 +08:00 committed by Adrian Greeve
parent 912d19908a
commit 513d2118dd
4 changed files with 19 additions and 13 deletions

View File

@ -46,6 +46,10 @@ require_login($course);
$context = context_course::instance($course->id);
require_capability('moodle/grade:manage', $context);
$PAGE->set_pagelayout('admin');
navigation_node::override_active_url(new moodle_url('/grade/edit/tree/index.php',
array('id'=>$course->id)));
// default return url
$gpr = new grade_plugin_return();
$returnurl = $gpr->get_return_url($CFG->wwwroot.'/grade/report/index.php?id='.$course->id);
@ -109,10 +113,8 @@ $strgrades = get_string('grades');
$strgraderreport = get_string('graderreport', 'grades');
$strcalculationedit = get_string('editcalculation', 'grades');
grade_build_nav(__FILE__, $strcalculationedit, array('courseid' => $courseid));
$PAGE->set_title($strgrades . ': ' . $strgraderreport);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
$PAGE->navbar->add($strcalculationedit);
print_grade_page_head($courseid, 'settings', null, $strcalculationedit, false, false, false);
$mform->display();
// Now show the gradetree with the idnumbers add/edit form

View File

@ -36,6 +36,8 @@ if ($id !== 0) {
}
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
navigation_node::override_active_url(new moodle_url('/grade/edit/tree/index.php',
array('id'=>$courseid)));
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('nocourseid');
@ -229,10 +231,8 @@ if ($mform->is_cancelled()) {
redirect($returnurl);
}
$return = false;
$buttons = false;
$shownavigation = false;
print_grade_page_head($courseid, 'settings', null, $heading, $return, $buttons, $shownavigation);
$PAGE->navbar->add($heading);
print_grade_page_head($courseid, 'settings', null, $heading, false, false, false);
$mform->display();

View File

@ -37,6 +37,8 @@ if ($id !== 0) {
}
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
navigation_node::override_active_url(new moodle_url('/grade/edit/tree/index.php',
array('id'=>$courseid)));
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('nocourseid');
@ -180,10 +182,8 @@ if ($mform->is_cancelled()) {
redirect($returnurl);
}
$return = false;
$buttons = false;
$shownavigation = false;
print_grade_page_head($courseid, 'settings', null, $heading, $return, $buttons, $shownavigation);
$PAGE->navbar->add($heading);
print_grade_page_head($courseid, 'settings', null, $heading, false, false, false);
$mform->display();

View File

@ -35,6 +35,9 @@ if ($id !== 0) {
$url->param('id', $id);
}
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
navigation_node::override_active_url(new moodle_url('/grade/edit/tree/index.php',
array('id'=>$courseid)));
if (!$course = $DB->get_record('course', array('id' => $courseid))) {
print_error('nocourseid');
@ -214,7 +217,8 @@ if ($data = $mform->get_data()) {
redirect($returnurl);
}
print_grade_page_head($courseid, 'settings', null, $heading);
$PAGE->navbar->add($heading);
print_grade_page_head($courseid, 'settings', null, $heading, false, false, false);
if (!grade_outcome::fetch_all_available($COURSE->id)) {
echo $OUTPUT->confirm(get_string('nooutcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/course.php?id='.$courseid, $returnurl);