Skip to content

Commit

Permalink
Fix for bug 2705:
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
defacer committed Mar 9, 2005
1 parent 9697823 commit ef4ee34
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions blocks/search_forums/block_search_forums.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,31 @@
class block_search_forums extends block_base {
function init() {
$this->title = get_string('search', 'forum');
$this->version = 2004041000;
$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 = '';
$this->content->text = '';
return $this->content;
}

$course = get_record('course', 'id', $this->instance->pageid);

$this->content = new stdClass;
$this->content->text = forum_print_search_form($course, '', true, 'block');
$this->content->footer = '';
$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;
}
Expand Down

0 comments on commit ef4ee34

Please sign in to comment.