Skip to content

Commit

Permalink
MDL-69158 block_blog_menu: format search form.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Jun 29, 2020
1 parent 4557b7f commit 71d4cc2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions blocks/blog_menu/block_blog_menu.php
Expand Up @@ -99,10 +99,14 @@ function get_content() {
// Prepare the footer for this block
if (has_capability('moodle/blog:search', context_system::instance())) {
// Full-text search field
$form = html_writer::tag('label', get_string('search', 'admin'), array('for'=>'blogsearchquery', 'class'=>'accesshide'));
$form .= html_writer::empty_tag('input', array('id'=>'blogsearchquery', 'type'=>'text', 'name'=>'search'));
$form .= html_writer::empty_tag('input', array('type'=>'submit', 'value'=>get_string('search')));
$this->content->footer = html_writer::tag('form', html_writer::tag('div', $form), array('class'=>'blogsearchform', 'method'=>'get', 'action'=>new moodle_url('/blog/index.php')));
$form = html_writer::tag('label', get_string('search', 'admin'), array('for' => 'blogsearchquery',
'class' => 'accesshide'));
$form .= html_writer::empty_tag('input', array('id' => 'blogsearchquery', 'class' => 'form-control mr-1',
'type' => 'text', 'name' => 'search'));
$form .= html_writer::empty_tag('input', array('type' => 'submit', 'class' => 'btn btn-secondary',
'value' => get_string('search')));
$this->content->footer = html_writer::tag('form', html_writer::tag('div', $form), array(
'class' => 'blogsearchform form-inline', 'method' => 'get', 'action' => new moodle_url('/blog/index.php')));
} else {
// No footer to display
$this->content->footer = '';
Expand Down

0 comments on commit 71d4cc2

Please sign in to comment.