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