mirror of
https://github.com/moodle/moodle.git
synced 2025-02-22 02:49:53 +01:00
* Block authors no longer need to set $this->content_type * If you want to make a "list" block, just derive from block_list instead of block_base * All switch() statements gone from library code * Overloaded method is_empty() added to block classes for convenience
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?PHP //$Id$
|
|
|
|
class block_activity_modules extends block_list {
|
|
function init() {
|
|
$this->title = get_string('activities');
|
|
$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;
|
|
}
|
|
}
|
|
|
|
?>
|