4ca6cfbf |
1 | <?php |
0f3fe4b6 |
2 | |
e89d741a |
3 | class block_recent_activity extends block_base { |
9b4b78fd |
4 | function init() { |
c141a69b |
5 | $this->title = get_string('plguinname', 'block_recentactivity'); |
433c242f |
6 | $this->version = 2007101509; |
0f3fe4b6 |
7 | } |
8 | |
9 | function get_content() { |
675dbdd9 |
10 | if ($this->content !== NULL) { |
11 | return $this->content; |
12 | } |
13 | |
9b4b78fd |
14 | if (empty($this->instance)) { |
675dbdd9 |
15 | $this->content = ''; |
0f3fe4b6 |
16 | return $this->content; |
17 | } |
18 | |
9b4b78fd |
19 | $this->content = new stdClass; |
0f3fe4b6 |
20 | $this->content->text = ''; |
21 | $this->content->footer = ''; |
22 | |
7a8bcd59 |
23 | // Slightly hacky way to do it but... |
24 | ob_start(); |
cb640229 |
25 | print_recent_activity($this->page->course); |
7a8bcd59 |
26 | $this->content->text = ob_get_contents(); |
27 | ob_end_clean(); |
0f3fe4b6 |
28 | |
29 | return $this->content; |
30 | } |
0f3fe4b6 |
31 | |
347d7d27 |
32 | function applicable_formats() { |
9591bc3c |
33 | return array('all' => true, 'my' => false, 'tag' => false); |
347d7d27 |
34 | } |
35 | } |
4ca6cfbf |
36 | |