2004-04-18 23:20:53 +00:00
|
|
|
<?PHP //$Id$
|
|
|
|
|
2004-11-23 18:53:34 +00:00
|
|
|
class block_recent_activity 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('recentactivity');
|
2004-04-29 10:29:23 +00:00
|
|
|
$this->version = 2004042900;
|
2004-04-18 23:20:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function get_content() {
|
|
|
|
|
2004-08-11 09:00:53 +00:00
|
|
|
if ($this->content !== NULL) {
|
|
|
|
return $this->content;
|
|
|
|
}
|
|
|
|
|
2004-10-19 21:04:28 +00:00
|
|
|
if (empty($this->instance)) {
|
2004-08-11 09:00:53 +00:00
|
|
|
$this->content = '';
|
2004-04-18 23:20:53 +00:00
|
|
|
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->text = '';
|
|
|
|
$this->content->footer = '';
|
|
|
|
|
2004-10-19 21:04:28 +00:00
|
|
|
$course = get_record('course', 'id', $this->instance->pageid);
|
|
|
|
|
2004-04-29 10:29:23 +00:00
|
|
|
// Slightly hacky way to do it but...
|
|
|
|
ob_start();
|
2004-10-19 21:04:28 +00:00
|
|
|
print_recent_activity($course);
|
2004-04-29 10:29:23 +00:00
|
|
|
$this->content->text = ob_get_contents();
|
|
|
|
ob_end_clean();
|
2004-04-18 23:20:53 +00:00
|
|
|
|
|
|
|
return $this->content;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|