mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-73645 grades: Update breadcrumb nodes
This commit is contained in:
parent
1060ee827c
commit
724578a008
10 changed files with 46 additions and 18 deletions
|
@ -30,7 +30,7 @@ $contextid = optional_param('id', SYSCONTEXTID, PARAM_INT);
|
|||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$edit = optional_param('edit', false, PARAM_BOOL); //are we editing?
|
||||
|
||||
$PAGE->set_url('/grade/edit/letter/index.php', array('id' => $contextid));
|
||||
$url = new moodle_url('/grade/edit/letter/index.php', array('id' => $contextid));
|
||||
|
||||
list($context, $course, $cm) = get_context_info_array($contextid);
|
||||
$contextid = null;//now we have a context object throw away the $contextid from the params
|
||||
|
@ -42,7 +42,11 @@ if (!$edit) {
|
|||
}
|
||||
} else {//else we're editing
|
||||
require_capability('moodle/grade:manageletters', $context);
|
||||
navigation_node::override_active_url($url);
|
||||
$url->param('edit', 1);
|
||||
$PAGE->navbar->add(get_string('editgradeletters', 'grades'), $url);
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
$returnurl = null;
|
||||
$editparam = null;
|
||||
|
|
|
@ -79,7 +79,6 @@ if ($id) {
|
|||
require_login($course);
|
||||
$context = context_course::instance($course->id);
|
||||
require_capability('moodle/grade:manage', $context);
|
||||
navigation_node::override_active_url(new moodle_url('/grade/edit/outcome/course.php', array('id'=>$courseid)));
|
||||
|
||||
$outcome_rec = new stdClass();
|
||||
$outcome_rec->standard = 0;
|
||||
|
@ -98,6 +97,10 @@ if ($id) {
|
|||
if (!$courseid) {
|
||||
require_once $CFG->libdir.'/adminlib.php';
|
||||
admin_externalpage_setup('outcomes');
|
||||
} else {
|
||||
navigation_node::override_active_url(new moodle_url('/grade/edit/outcome/course.php', ['id' => $courseid]));
|
||||
$PAGE->navbar->add(get_string('manageoutcomes', 'grades'),
|
||||
new moodle_url('/grade/edit/outcome/index.php', ['id' => $courseid]));
|
||||
}
|
||||
|
||||
// default return url
|
||||
|
@ -158,6 +161,8 @@ if ($mform->is_cancelled()) {
|
|||
redirect($returnurl);
|
||||
}
|
||||
|
||||
$PAGE->navbar->add($heading, $url);
|
||||
|
||||
print_grade_page_head($courseid ?: SITEID, 'outcome', 'edit', $heading, false, false, false);
|
||||
|
||||
if (!grade_scale::fetch_all_local($courseid) && !grade_scale::fetch_all_global()) {
|
||||
|
|
|
@ -32,7 +32,8 @@ $courseid = optional_param('courseid', 0, PARAM_INT);
|
|||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
$scope = optional_param('scope', 'custom', PARAM_ALPHA);
|
||||
|
||||
$PAGE->set_url('/grade/edit/outcome/import.php', array('courseid' => $courseid));
|
||||
$url = new moodle_url('/grade/edit/outcome/import.php', array('courseid' => $courseid));
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
|
||||
/// Make sure they can even access this course
|
||||
|
@ -46,6 +47,11 @@ if ($courseid) {
|
|||
if (empty($CFG->enableoutcomes)) {
|
||||
redirect('../../index.php?id='.$courseid);
|
||||
}
|
||||
navigation_node::override_active_url(new moodle_url('/grade/edit/outcome/course.php', ['id' => $courseid]));
|
||||
$PAGE->navbar->add(get_string('manageoutcomes', 'grades'),
|
||||
new moodle_url('/grade/edit/outcome/index.php', ['id' => $courseid]));
|
||||
$PAGE->navbar->add(get_string('importoutcomes', 'grades'),
|
||||
new moodle_url('/grade/edit/outcome/import.php', ['courseid' => $courseid]));
|
||||
|
||||
} else {
|
||||
require_once $CFG->libdir.'/adminlib.php';
|
||||
|
@ -55,8 +61,6 @@ if ($courseid) {
|
|||
|
||||
require_capability('moodle/grade:manageoutcomes', $context);
|
||||
|
||||
$navigation = grade_build_nav(__FILE__, get_string('outcomes', 'grades'), $courseid);
|
||||
|
||||
$upload_form = new import_outcomes_form();
|
||||
|
||||
if ($upload_form->is_cancelled()) {
|
||||
|
|
|
@ -29,7 +29,8 @@ require_once($CFG->libdir.'/gradelib.php');
|
|||
$courseid = optional_param('id', 0, PARAM_INT);
|
||||
$action = optional_param('action', '', PARAM_ALPHA);
|
||||
|
||||
$PAGE->set_url('/grade/edit/outcome/index.php', array('id' => $courseid));
|
||||
$url = new moodle_url('/grade/edit/outcome/index.php', ['id' => $courseid]);
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_pagelayout('admin');
|
||||
|
||||
/// Make sure they can even access this course
|
||||
|
@ -44,6 +45,7 @@ if ($courseid) {
|
|||
}
|
||||
// This page doesn't exist on the navigation so map it to another
|
||||
navigation_node::override_active_url(new moodle_url('/grade/edit/outcome/course.php', array('id'=>$courseid)));
|
||||
$PAGE->navbar->add(get_string('manageoutcomes', 'grades'), $url);
|
||||
} else {
|
||||
if (empty($CFG->enableoutcomes)) {
|
||||
redirect('../../../');
|
||||
|
@ -90,6 +92,7 @@ switch ($action) {
|
|||
|
||||
if(!$deleteconfirmed){
|
||||
$PAGE->set_title(get_string('outcomedelete', 'grades'));
|
||||
$PAGE->navbar->add(get_string('outcomedelete', 'grades'));
|
||||
echo $OUTPUT->header();
|
||||
$confirmurl = new moodle_url('index.php', array(
|
||||
'id' => $courseid, 'outcomeid' => $outcome->id,
|
||||
|
|
|
@ -144,6 +144,7 @@ if ($mform->is_cancelled()) {
|
|||
}
|
||||
|
||||
$heading = $id ? get_string('editscale', 'grades') : get_string('addscale', 'grades');
|
||||
$PAGE->navbar->add($heading);
|
||||
print_grade_page_head($COURSE->id, 'scale', null, $heading, false, false, false);
|
||||
|
||||
$mform->display();
|
||||
|
|
|
@ -81,7 +81,11 @@ switch ($action) {
|
|||
$deleteconfirmed = optional_param('deleteconfirmed', 0, PARAM_BOOL);
|
||||
|
||||
if (!$deleteconfirmed) {
|
||||
$strdeletescale = get_string('delete'). ' '. get_string('scale');
|
||||
if ($courseid) {
|
||||
$PAGE->navbar->add(get_string('scales'), new moodle_url('/grade/edit/scale/index.php',
|
||||
['id' => $courseid]));
|
||||
}
|
||||
$strdeletescale = get_string('deletescale', 'grades');
|
||||
$PAGE->navbar->add($strdeletescale);
|
||||
$PAGE->set_title($strdeletescale);
|
||||
$PAGE->set_heading($COURSE->fullname);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue