Merge branch 'MDL-60880-master' of https://github.com/sammarshallou/moodle

This commit is contained in:
Damyon Wiese 2017-12-06 10:07:58 +08:00 committed by Jun Pataleta
commit 97812f14c1
14 changed files with 330 additions and 32 deletions

View file

@ -78,6 +78,12 @@ class block_globalsearch extends block_base {
'type' => 'text', 'size' => '15');
$this->content->text .= html_writer::empty_tag('input', $inputoptions);
// Context id.
if ($this->page->context && $this->page->context->contextlevel !== CONTEXT_SYSTEM) {
$this->content->text .= html_writer::empty_tag('input', ['type' => 'hidden',
'name' => 'context', 'value' => $this->page->context->id]);
}
// Search button.
$this->content->text .= html_writer::tag('button', get_string('search', 'search'),
array('id' => 'searchform_button', 'type' => 'submit', 'title' => 'globalsearch', 'class' => 'btn btn-secondary'));