|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 require_once($CFG->dirroot.'/course/lib.php'); 00004 00005 class block_recent_activity extends block_base { 00006 function init() { 00007 $this->title = get_string('pluginname', 'block_recent_activity'); 00008 } 00009 00010 function get_content() { 00011 if ($this->content !== NULL) { 00012 return $this->content; 00013 } 00014 00015 if (empty($this->instance)) { 00016 $this->content = ''; 00017 return $this->content; 00018 } 00019 00020 $this->content = new stdClass; 00021 $this->content->text = ''; 00022 $this->content->footer = ''; 00023 00024 // Slightly hacky way to do it but... 00025 ob_start(); 00026 print_recent_activity($this->page->course); 00027 $this->content->text = ob_get_contents(); 00028 ob_end_clean(); 00029 00030 return $this->content; 00031 } 00032 00033 function applicable_formats() { 00034 return array('all' => true, 'my' => false, 'tag' => false); 00035 } 00036 } 00037