search-block-form.tpl.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * @file
  4. * Displays the search form block.
  5. *
  6. * Available variables:
  7. * - $search_form: The complete search form ready for print.
  8. * - $search: Associative array of search elements. Can be used to print each
  9. * form element separately.
  10. *
  11. * Default elements within $search:
  12. * - $search['search_block_form']: Text input area wrapped in a div.
  13. * - $search['actions']: Rendered form buttons.
  14. * - $search['hidden']: Hidden form elements. Used to validate forms when
  15. * submitted.
  16. *
  17. * Modules can add to the search form, so it is recommended to check for their
  18. * existence before printing. The default keys will always exist. To check for
  19. * a module-provided field, use code like this:
  20. * @code
  21. * <?php if (isset($search['extra_field'])): ?>
  22. * <div class="extra-field">
  23. * <?php print $search['extra_field']; ?>
  24. * </div>
  25. * <?php endif; ?>
  26. * @endcode
  27. *
  28. * @see template_preprocess_search_block_form()
  29. */
  30. ?>
  31. <div class="container-inline">
  32. <?php if (empty($variables['form']['#block']->subject)): ?>
  33. <h2 class="element-invisible"><?php print t('Search form'); ?></h2>
  34. <?php endif; ?>
  35. <?php print $search_form; ?>
  36. </div>