2004-04-18 23:20:53 +00:00
|
|
|
<?PHP //$Id$
|
|
|
|
|
2004-11-23 18:53:34 +00:00
|
|
|
class block_activity_modules extends block_base {
|
2004-10-19 21:04:28 +00:00
|
|
|
function init() {
|
2004-04-18 23:20:53 +00:00
|
|
|
$this->title = get_string('activities');
|
|
|
|
$this->content_type = BLOCK_TYPE_LIST;
|
|
|
|
$this->version = 2004041000;
|
|
|
|
}
|
|
|
|
|
|
|
|
function get_content() {
|
|
|
|
global $USER, $CFG;
|
|
|
|
|
|
|
|
// This is really NOT pretty, but let's do it simple for now...
|
|
|
|
global $modnamesused, $modnamesplural;
|
|
|
|
|
|
|
|
if($this->content !== NULL) {
|
|
|
|
return $this->content;
|
|
|
|
}
|
|
|
|
|
2004-10-19 21:04:28 +00:00
|
|
|
$this->content = new stdClass;
|
2004-04-18 23:20:53 +00:00
|
|
|
$this->content->items = array();
|
|
|
|
$this->content->icons = array();
|
|
|
|
$this->content->footer = '';
|
|
|
|
|
|
|
|
if ($modnamesused) {
|
|
|
|
foreach ($modnamesused as $modname => $modfullname) {
|
|
|
|
if ($modname != 'label') {
|
2004-10-19 21:04:28 +00:00
|
|
|
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$this->instance->pageid.'">'.$modnamesplural[$modname].'</a>';
|
2004-09-12 21:55:34 +00:00
|
|
|
$this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$modname.'/icon.gif" height="16" width="16" alt="" />';
|
2004-04-18 23:20:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|