mirror of
https://github.com/moodle/moodle.git
synced 2025-02-01 13:28:17 +01:00
3ef642d96a
* 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
37 lines
822 B
PHP
37 lines
822 B
PHP
<?PHP //$Id$
|
|
|
|
class block_recent_activity extends block_base {
|
|
function init() {
|
|
$this->title = get_string('recentactivity');
|
|
$this->version = 2004042900;
|
|
}
|
|
|
|
function get_content() {
|
|
|
|
if ($this->content !== NULL) {
|
|
return $this->content;
|
|
}
|
|
|
|
if (empty($this->instance)) {
|
|
$this->content = '';
|
|
return $this->content;
|
|
}
|
|
|
|
$this->content = new stdClass;
|
|
$this->content->text = '';
|
|
$this->content->footer = '';
|
|
|
|
$course = get_record('course', 'id', $this->instance->pageid);
|
|
|
|
// Slightly hacky way to do it but...
|
|
ob_start();
|
|
print_recent_activity($course);
|
|
$this->content->text = ob_get_contents();
|
|
ob_end_clean();
|
|
|
|
return $this->content;
|
|
}
|
|
}
|
|
|
|
?>
|