|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 class block_search_forums extends block_base { 00004 function init() { 00005 $this->title = get_string('pluginname', 'block_search_forums'); 00006 } 00007 00008 function get_content() { 00009 global $CFG, $OUTPUT; 00010 00011 if($this->content !== NULL) { 00012 return $this->content; 00013 } 00014 00015 $this->content = new stdClass; 00016 $this->content->footer = ''; 00017 00018 if (empty($this->instance)) { 00019 $this->content->text = ''; 00020 return $this->content; 00021 } 00022 00023 $advancedsearch = get_string('advancedsearch', 'block_search_forums'); 00024 00025 $strsearch = get_string('search'); 00026 $strgo = get_string('go'); 00027 00028 $this->content->text = '<div class="searchform">'; 00029 $this->content->text .= '<form action="'.$CFG->wwwroot.'/mod/forum/search.php" style="display:inline"><fieldset class="invisiblefieldset">'; 00030 $this->content->text .= '<input name="id" type="hidden" value="'.$this->page->course->id.'" />'; // course 00031 $this->content->text .= '<label class="accesshide" for="searchform_search">'.$strsearch.'</label>'. 00032 '<input id="searchform_search" name="search" type="text" size="16" />'; 00033 $this->content->text .= '<button id="searchform_button" type="submit" title="'.$strsearch.'">'.$strgo.'</button><br />'; 00034 $this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/forum/search.php?id='.$this->page->course->id.'">'.$advancedsearch.'</a>'; 00035 $this->content->text .= $OUTPUT->help_icon('search'); 00036 $this->content->text .= '</fieldset></form></div>'; 00037 00038 return $this->content; 00039 } 00040 00041 function applicable_formats() { 00042 return array('site' => true, 'course' => true); 00043 } 00044 } 00045 00046