block_settings_renderer.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // This file is part of Moodle - http://moodle.org/
  3. //
  4. // Moodle is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // Moodle is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * Settings block renderers
  18. *
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  20. */
  21. defined('MOODLE_INTERNAL') || die();
  22. require_once($CFG->dirroot . "/blocks/settings/renderer.php");
  23. class theme_bootstrap_block_settings_renderer extends block_settings_renderer {
  24. public function search_form(moodle_url $formtarget, $searchvalue) {
  25. $content = html_writer::start_tag('form',
  26. array(
  27. 'class' => 'adminsearchform',
  28. 'method' => 'get',
  29. 'action' => $formtarget,
  30. 'role' => 'search',
  31. )
  32. );
  33. $content .= html_writer::start_div('input-group');
  34. $content .= html_writer::empty_tag('input',
  35. array(
  36. 'id' => 'adminsearchquery',
  37. 'type' => 'text',
  38. 'name' => 'query',
  39. 'class' => 'form-control',
  40. 'placeholder' => s(get_string('searchinsettings', 'admin')),
  41. 'value' => s($searchvalue),
  42. )
  43. );
  44. $content .= html_writer::start_span('input-group-btn');
  45. $content .= html_writer::tag('button', s(get_string('go')), array('type' => 'button', 'class' => 'btn btn-default'));
  46. $content .= html_writer::end_span();
  47. $content .= html_writer::end_div();
  48. $content .= html_writer::end_tag('form');
  49. return $content;
  50. }
  51. }