3 class block_participants
extends block_list
{
5 $this->title
= get_string('people');
6 $this->version
= 2004052600;
9 function get_content() {
13 if (empty($this->instance
)) {
15 return $this->content
;
18 // the following 3 lines is need to pass _self_test();
19 if (empty($this->instance
->pageid
)) {
23 if (!$currentcontext = get_context_instance(CONTEXT_COURSE
, $this->instance
->pageid
)) {
25 return $this->content
;
28 if (!has_capability('moodle/course:viewparticipants', $currentcontext)) {
30 return $this->content
;
33 $this->content
= new object();
34 $this->content
->items
= array();
35 $this->content
->icons
= array();
36 $this->content
->footer
= '';
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="" />';
42 return $this->content
;
45 // my moodle can only have SITEID and it's redundant here, so take it away
46 function applicable_formats() {
47 return array('all' => true, 'my' => false, 'tag' => false);