MDL-23842 cohort UI now linked from course category settings block too
authorPetr Skoda <skodak@moodle.org>
Tue, 17 Aug 2010 13:05:33 +0000 (13:05 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 17 Aug 2010 13:05:33 +0000 (13:05 +0000)
cohort/index.php
lib/navigationlib.php

index e08985b..0f7d2fa 100644 (file)
@@ -53,7 +53,8 @@ if (!$manager) {
 
 $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);
index 9fbdf69..6432996 100644 (file)
@@ -3439,6 +3439,12 @@ class settings_navigation extends navigation_node {
             $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));