1
0
mirror of https://github.com/moodle/moodle.git synced 2025-03-08 17:59:55 +01:00
moodle/blocks/recent_activity/block_recent_activity.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

38 lines
869 B
PHP

<?PHP //$Id$
class block_recent_activity extends block_base {
function init() {
$this->title = get_string('recentactivity');
$this->content_type = BLOCK_TYPE_TEXT;
$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;
}
}
?>