moodle/blocks/activity_modules/block_activity_modules.php
defacer e89d741af3 New naming conventions for class names to bring them in line with the
rest of Moodle. The convention for blocks is now:

class block_something extends block_base { ... }

HOWTO updated accordingly, plus some more minor polishing. More to come.
2004-11-23 18:53:34 +00:00

39 lines
1.1 KiB
PHP

<?PHP //$Id$
class block_activity_modules extends block_base {
function init() {
$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;
}
$this->content = new stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
if ($modnamesused) {
foreach ($modnamesused as $modname => $modfullname) {
if ($modname != 'label') {
$this->content->items[] = '<a href="'.$CFG->wwwroot.'/mod/'.$modname.'/index.php?id='.$this->instance->pageid.'">'.$modnamesplural[$modname].'</a>';
$this->content->icons[] = '<img src="'.$CFG->modpixpath.'/'.$modname.'/icon.gif" height="16" width="16" alt="" />';
}
}
}
return $this->content;
}
}
?>