Files
moodle/blocks/search_forums/block_search_forums.php
T
nfreear 57100a9098 Fixes bug MDL-6360 "Resizable image in breadcrumb trail..."
- files block_search_forums.php, calendar/lib.php, lang/en_utf8/access.php, weblib.php, theme/standard/config.php, styles_color.css
2006-09-19 11:36:21 +00:00

52 lines
2.0 KiB
PHP

<?PHP //$Id$
require_once(dirname(dirname(dirname(__FILE__))).'/config.php');
require_once($CFG->dirroot.'/mod/forum/lib.php');
class block_search_forums extends block_base {
function init() {
$this->title = get_string('blocktitle', 'block_search_forums');
$this->version = 2005030900;
}
function get_content() {
global $CFG, $THEME;
if($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->footer = '';
if (empty($this->instance)) {
$this->content->text = '';
return $this->content;
}
$advancedsearch = get_string('advancedsearch', 'block_search_forums');
//Accessibility: replaced <input value=">" type="submit"> with configurable text/'silent' character.
check_theme_arrows();
// Theme config, $CFG->block_search_button = $THEME->rarrow .'<span class="accesshide">'.get_string('search').'</span>';
$button = (isset($CFG->block_search_button)) ? $CFG->block_search_button : get_string('go');
$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="id" type="hidden" value="'.$this->instance->pageid.'" />'; // course
$this->content->text .= '<input name="search" type="text" size="16" />';
$this->content->text .= '<button type="submit" title="'.get_string('search').'">'.$button.'</button><br />';
$this->content->text .= '<a href="'.$CFG->wwwroot.'/mod/forum/search.php?id='.$this->instance->pageid.'">'.$advancedsearch.'</a>';
$this->content->text .= helpbutton('search', $advancedsearch, 'moodle', true, false, '', true);
$this->content->text .= '</form></div>';
return $this->content;
}
function applicable_formats() {
return array('site' => true, 'course' => true);
}
}
?>