Skip to content

Commit

Permalink
Merge branch 'wip-MDL-38146-master' of git://github.com/marinaglancy/…
Browse files Browse the repository at this point in the history
…moodle
  • Loading branch information
stronk7 committed Feb 25, 2013
2 parents 8615b48 + f0b137c commit 2a80528
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions course/editcategory.php
Expand Up @@ -131,25 +131,9 @@
redirect('manage.php?id='.$newcategory->id);
}

// Unfortunately the navigation never generates correctly for this page because technically this page doesn't actually
// exist on the navigation; you get here through the course management page.
// First up we'll try to make the course management page active seeing as that is where the user thinks they are.
// The big prolem here is that the course management page is a common page for both editing users and common users and
// is only added to the admin tree if the user has permission to edit at the system level.
$node = $PAGE->settingsnav->get('root');
if ($node) {
$node = $node->get('courses');
if ($node) {
$node = $node->get('coursemgmt');
}
}
if ($node) {
// The course management page exists so make that active.
$node->make_active();
} else {
// Failing that we'll override the URL, not as accurate and chances are things
// won't be 100% correct all the time but should work most times.
// A common reason to arrive here is having the management capability within only a particular category (not at system level).
// Page "Add new category" (with "Top" as a parent) does not exist in navigation.
// We pretend we are on course management page.
if (empty($id) && empty($parent)) {
navigation_node::override_active_url(new moodle_url('/course/manage.php'));
}

Expand Down

0 comments on commit 2a80528

Please sign in to comment.