MDL-11517 reserved word MOD used in table alias in questions backup code
[moodle-pu.git] / blocks / participants / block_participants.php
blob16670424d44b2c0a20c67920d5323974367822bd
1 <?PHP //$Id$
3 class block_participants extends block_list {
4 function init() {
5 $this->title = get_string('people');
6 $this->version = 2004052600;
9 function get_content() {
11 global $CFG;
13 if (empty($this->instance)) {
14 $this->content = '';
15 return $this->content;
18 // the following 3 lines is need to pass _self_test();
19 if (empty($this->instance->pageid)) {
20 return '';
23 if (!$currentcontext = get_context_instance(CONTEXT_COURSE, $this->instance->pageid)) {
24 $this->content = '';
25 return $this->content;
28 if (!has_capability('moodle/course:viewparticipants', $currentcontext)) {
29 $this->content = '';
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);