Skip to content

Commit

Permalink
MDL-23842 cohort UI now linked from course category settings block too
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 17, 2010
1 parent 59b0f79 commit 3f873af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cohort/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@

$strcohorts = get_string('cohorts', 'cohort');

if ($category) {
if ($category) {
$PAGE->set_pagelayout('admin');
$PAGE->set_context($context);
$PAGE->set_url('/cohort/index.php', array('contextid'=>$context->id));
$PAGE->set_title($strcohorts);
Expand Down
6 changes: 6 additions & 0 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,12 @@ protected function load_category_settings() {
$url = new moodle_url('/'.$CFG->admin.'/roles/check.php', array('contextid'=>$this->context->id));
$categorynode->add(get_string('checkpermissions', 'role'), $url, self::TYPE_SETTING);
}

// Cohorts
if (has_capability('moodle/cohort:manage', $this->context) or has_capability('moodle/cohort:view', $this->context)) {
$categorynode->add(get_string('cohorts', 'cohort'), new moodle_url('/cohort/index.php', array('contextid' => $this->context->id)));
}

// Manage filters
if (has_capability('moodle/filter:manage', $this->context) && count(filter_get_available_in_context($this->context))>0) {
$url = new moodle_url('/filter/manage.php', array('contextid'=>$this->context->id));
Expand Down

0 comments on commit 3f873af

Please sign in to comment.