Files
moodle/blocks/search_forums/block_search_forums.php
T
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
941 B
PHP

<?PHP //$Id$
class block_search_forums extends block_base {
function init() {
$this->title = get_string('search', 'forum');
$this->content_type = BLOCK_TYPE_TEXT;
$this->version = 2004041000;
}
function get_content() {
global $USER, $CFG, $SESSION;
optional_variable($_GET['cal_m']);
optional_variable($_GET['cal_y']);
if($this->content !== NULL) {
return $this->content;
}
if (empty($this->instance)) {
$this->content = '';
return $this->content;
}
$course = get_record('course', 'id', $this->instance->pageid);
$this->content = new stdClass;
$this->content->text = '';
$this->content->footer = '';
$form = forum_print_search_form($course, '', true);
$this->content->text = '<div align="center">'.$form.'</div>';
return $this->content;
}
}
?>