MDL-24625 Dropped $CFG->block_search_text and $CFG->block_search_button
[moodle.git] / blocks / search_forums / block_search_forums.php
1 <?php
3 class block_search_forums extends block_base {
4     function init() {
5         $this->title = get_string('pluginname', 'block_search_forums');
6     }
8     function get_content() {
9         global $CFG, $OUTPUT;
11         if($this->content !== NULL) {
12             return $this->content;
13         }
15         $this->content = new stdClass;
16         $this->content->footer = '';
18         if (empty($this->instance)) {
19             $this->content->text   = '';
20             return $this->content;
21         }
23         $advancedsearch = get_string('advancedsearch', 'block_search_forums');
25         $strsearch  = get_string('search');
26         $strgo      = get_string('go');
28         $this->content->text  = '<div class="searchform">';
29         $this->content->text .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline"><fieldset class="invisiblefieldset">';
30         $this->content->text .= '<input name="id" type="hidden" value="'.$this->page->course->id.'" />';  // course
31         $this->content->text .= '<label class="accesshide" for="searchform_search">'.$strsearch.'</label>'.
32                                 '<input id="searchform_search" name="search" type="text" size="16" />';
33         $this->content->text .= '<button id="searchform_button" type="submit" title="'.$strsearch.'">'.$strgo.'</button><br />';
34         $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/forum/search.php?id='.$this->page->course->id.'">'.$advancedsearch.'</a>';
35         $this->content->text .= $OUTPUT->help_icon('search');
36         $this->content->text .= '</fieldset></form></div>';
38         return $this->content;
39     }
41     function applicable_formats() {
42         return array('site' => true, 'course' => true);
43     }
44 }