Merged from MOODLE_15_STABLE - Enable reset password functinoality for LDAP and other...
[moodle.git] / blocks / participants / block_participants.php
CommitLineData
0f3fe4b6 1<?PHP //$Id$
2
3ef642d9 3class block_participants extends block_list {
9b4b78fd 4 function init() {
0f3fe4b6 5 $this->title = get_string('people');
89adb174 6 $this->version = 2004052600;
0f3fe4b6 7 }
8
9 function get_content() {
10 global $USER, $CFG;
11
675dbdd9 12 if ($this->content !== NULL) {
13 return $this->content;
14 }
9b4b78fd 15 if (empty($this->instance)) {
675dbdd9 16 $this->content = '';
0f3fe4b6 17 return $this->content;
18 }
19
9b4b78fd 20 $this->content = new stdClass;
0f3fe4b6 21 $this->content->items = array();
22 $this->content->icons = array();
23 $this->content->footer = '';
24
0f3fe4b6 25
84bb3c12 26 if ($this->instance->pageid != SITEID ||
27 $CFG->showsiteparticipantslist > 1 ||
28 ($CFG->showsiteparticipantslist == 1 && isteacherinanycourse()) ||
29 isteacher(SITEID)) {
9b4b78fd 30
84bb3c12 31 $this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'.
32 $CFG->wwwroot.'/user/index.php?id='.$this->instance->pageid.'">'.get_string('participants').'</a>';
33 $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="" />';
0f3fe4b6 34
0f3fe4b6 35 }
36
0f3fe4b6 37
38 return $this->content;
39 }
40}
41
42?>