MDL-11538: lib/olson - bugfix, olson time-zone import doesn't deal with rule changes...
[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() {
224aa44a 10
11 global $CFG;
12
13 if (empty($this->instance)) {
14 $this->content = '';
15 return $this->content;
16 }
17
61240489 18 // the following 3 lines is need to pass _self_test();
19 if (empty($this->instance->pageid)) {
224aa44a 20 return '';
61240489 21 }
0f3fe4b6 22
224aa44a 23 if (!$currentcontext = get_context_instance(CONTEXT_COURSE, $this->instance->pageid)) {
24 $this->content = '';
675dbdd9 25 return $this->content;
26 }
224aa44a 27
28 if (!has_capability('moodle/course:viewparticipants', $currentcontext)) {
675dbdd9 29 $this->content = '';
0f3fe4b6 30 return $this->content;
31 }
32
224aa44a 33 $this->content = new object();
0f3fe4b6 34 $this->content->items = array();
35 $this->content->icons = array();
36 $this->content->footer = '';
37
224aa44a 38 $this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'.
39 $CFG->wwwroot.'/user/index.php?contextid='.$currentcontext->id.'">'.get_string('participants').'</a>';
40 $this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/users.gif" class="icon" alt="" />';
0f3fe4b6 41
42 return $this->content;
43 }
224aa44a 44
0d6b9d4f 45 // my moodle can only have SITEID and it's redundant here, so take it away
46 function applicable_formats() {
9591bc3c 47 return array('all' => true, 'my' => false, 'tag' => false);
0d6b9d4f 48 }
52788321 49
0f3fe4b6 50}
51
9591bc3c 52?>