]> git.mjollnir.org Git - moodle.git/commitdiff
navigation MDL-14632 Added Participants item to front page branch in settings block
authorsamhemelryk <samhemelryk>
Wed, 9 Sep 2009 04:21:20 +0000 (04:21 +0000)
committersamhemelryk <samhemelryk>
Wed, 9 Sep 2009 04:21:20 +0000 (04:21 +0000)
lib/navigationlib.php

index 7a8549997a5be103ae4e08a70c442b58e24c07c0..3d4686248f63e141d22ba5db593bc16edf0cfc71 100644 (file)
@@ -2819,7 +2819,8 @@ class settings_navigation extends navigation_node {
     }
 
     /**
-     * 
+     * This function loads all of the front page settings into the settings navigation.
+     * This function is called when the user is on the front page, or $COURSE==$SITE
      */
     protected function load_front_page_settings() {
         global $CFG, $USER, $OUTPUT, $SITE;
@@ -2849,6 +2850,12 @@ class settings_navigation extends navigation_node {
             $url = new moodle_url($CFG->wwwroot.'/admin/settings.php', array('section'=>'frontpagesettings'));
             $this->get($frontpage)->add(get_string('settings'), $url, self::TYPE_SETTING, null, null, $OUTPUT->old_icon_url('i/settings'));
         }
+
+        //Participants
+        if (has_capability('moodle/site:viewparticipants', $course->context)) {
+            $url = new moodle_url($CFG->wwwroot.'/user/index.php?contextid='.$course->context->id);
+            $this->get($frontpage)->add(get_string('participants'), $url, self::TYPE_SETTING, null, null, $OUTPUT->old_icon_url('i/users'));
+        }
     }