3 class block_search_forums
extends block_base
{
5 $this->title
= get_string('blocktitle', 'block_search_forums');
6 $this->version
= 2007101509;
9 function get_content() {
12 if($this->content
!== NULL) {
13 return $this->content
;
16 $this->content
= new stdClass
;
17 $this->content
->footer
= '';
19 if (empty($this->instance
)) {
20 $this->content
->text
= '';
21 return $this->content
;
24 $advancedsearch = get_string('advancedsearch', 'block_search_forums');
26 $search = get_string('search');
28 //Accessibility: replaced <input value=" />" type="submit"> with configurable text/'silent' character.
29 // Theme config, $CFG->block_search_button = get_arrow_right() .'<span class="accesshide">'.get_string('search').'</span>';
30 $button = (isset($CFG->block_search_button
)) ?
$CFG->block_search_button
: get_string('go');
32 $this->content
->text
= '<div class="searchform">';
33 $this->content
->text
.= '<form action="'.$CFG->wwwroot
.'/mod/forum/search.php" style="display:inline"><fieldset class="invisiblefieldset">';
34 $this->content
->text
.= '<input name="id" type="hidden" value="'.$this->instance
->pageid
.'" />'; // course
35 $this->content
->text
.= '<label class="accesshide" for="searchform_search">'.$search.'</label>'.
36 '<input id="searchform_search" name="search" type="text" size="16" />';
37 $this->content
->text
.= '<button id="searchform_button" type="submit" title="'.$search.'">'.$button.'</button><br />';
38 $this->content
->text
.= '<a href="'.$CFG->wwwroot
.'/mod/forum/search.php?id='.$this->instance
->pageid
.'">'.$advancedsearch.'</a>';
39 $this->content
->text
.= helpbutton('search', $advancedsearch, 'moodle', true, false, '', true);
40 $this->content
->text
.= '</fieldset></form></div>';
42 return $this->content
;
45 function applicable_formats() {
46 return array('site' => true, 'course' => true);