Skip to content

Commit

Permalink
MDL-25954 fix cohort navigation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jul 9, 2011
1 parent f6f6138 commit 21c8d60
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 7 additions & 2 deletions cohort/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@

if ($context->contextlevel == CONTEXT_COURSECAT) {
$category = $DB->get_record('course_categories', array('id'=>$context->instanceid), '*', MUST_EXIST);
$PAGE->navbar->add($category->name, new moodle_url('/course/index.php', array('categoryedit'=>'1')));
navigation_node::override_active_url(new moodle_url('/cohort/index.php', array('contextid'=>$cohort->contextid)));
$PAGE->set_pagelayout('report');

} else {
navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
$PAGE->set_pagelayout('admin');
}
$PAGE->navbar->add(get_string('cohorts', 'cohort'), new moodle_url('/cohort/', array('contextid'=>$context->id)));
$PAGE->navbar->add(get_string('assign', 'cohort'));

$PAGE->set_title(get_string('cohort:assign', 'cohort'));
$PAGE->set_heading($COURSE->fullname);

Expand Down
8 changes: 6 additions & 2 deletions cohort/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@

if ($context->contextlevel == CONTEXT_COURSECAT) {
$category = $DB->get_record('course_categories', array('id'=>$context->instanceid), '*', MUST_EXIST);
$PAGE->navbar->add($category->name, new moodle_url('/course/index.php', array('categoryedit'=>'1')));
navigation_node::override_active_url(new moodle_url('/cohort/index.php', array('contextid'=>$cohort->contextid)));
$PAGE->set_pagelayout('report');

} else {
navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
$PAGE->set_pagelayout('admin');
}
$PAGE->navbar->add(get_string('cohorts', 'cohort'), new moodle_url('/cohort/', array('contextid'=>$context->id)));

if ($delete and $cohort->id) {
$PAGE->url->param('delete', 1);
Expand Down
2 changes: 0 additions & 2 deletions cohort/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
$PAGE->set_url('/cohort/index.php', array('contextid'=>$context->id));
$PAGE->set_title($strcohorts);
$PAGE->set_heading($COURSE->fullname);
$PAGE->navbar->add($category->name, new moodle_url('/course/index.php', array('categoryedit'=>'1')));
$PAGE->navbar->add($strcohorts);
} else {
admin_externalpage_setup('cohorts', '', null, '', array('pagelayout'=>'report'));
}
Expand Down

0 comments on commit 21c8d60

Please sign in to comment.