moodle/blocks/search_forums/block_search_forums.php
defacer ef4ee34938 Fix for bug 2705:
Decoupling from the beast that is /mod/forum/lib.php, it was a pity to
include 100+ KB of code so that we could reuse 7-8 lines.

This block also wasn't including that library itself, so after Martin
removed that dependency from courses it was broken as well.
2005-03-09 20:38:53 +00:00

36 lines
1.2 KiB
PHP

<?PHP //$Id$
class block_search_forums extends block_base {
function init() {
$this->title = get_string('search', 'forum');
$this->version = 2005030900;
}
function get_content() {
global $CFG;
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->footer = '';
if (empty($this->instance)) {
$this->content->text = '';
return $this->content;
}
$this->content->text = '<div class="searchform">';
$this->content->text .= '<form name="search" action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline">';
$this->content->text .= '<input name="search" type="text" size="18" value="" alt="search" /> ';
$this->content->text .= '<input value="'.get_string('searchforums', 'forum').'" type="submit" />';
$this->content->text .= helpbutton('search', get_string('search'), 'moodle', true, false, '', true);
$this->content->text .= '<input name="id" type="hidden" value="'.$this->instance->pageid.'" />';
$this->content->text .= '</form></div>';
return $this->content;
}
}
?>