3 class block_activity_modules
extends block_list
{
5 $this->title
= get_string('activities');
6 $this->version
= 2007101509;
9 function get_content() {
12 if($this->content
!== NULL) {
13 return $this->content
;
16 $this->content
= new stdClass
;
17 $this->content
->items
= array();
18 $this->content
->icons
= array();
19 $this->content
->footer
= '';
21 if ($COURSE->id
== $this->instance
->pageid
) {
24 $course = get_record('course', 'id', $this->instance
->pageid
);
27 require_once($CFG->dirroot
.'/course/lib.php');
29 $modinfo = get_fast_modinfo($course);
30 $modfullnames = array();
32 foreach($modinfo->cms
as $cm) {
33 if (!$cm->uservisible
) {
36 $modfullnames[$cm->modname
] = $cm->modplural
;
39 asort($modfullnames, SORT_LOCALE_STRING
);
41 foreach ($modfullnames as $modname => $modfullname) {
42 if ($modname != 'label') {
43 $this->content
->items
[] = '<a href="'.$CFG->wwwroot
.'/mod/'.$modname.'/index.php?id='.$this->instance
->pageid
.'">'.$modfullname.'</a>';
44 $this->content
->icons
[] = '<img src="'.$CFG->modpixpath
.'/'.$modname.'/icon.gif" class="icon" alt="" />';
48 return $this->content
;
51 function applicable_formats() {
52 return array('all' => true, 'mod' => false, 'my' => false, 'admin' => false,