You are here

function _apachesolr_search_browse_form in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr_search.admin.inc \_apachesolr_search_browse_form()
  2. 7 apachesolr_search.admin.inc \_apachesolr_search_browse_form()

Helper function for empty search configuration.

1 call to _apachesolr_search_browse_form()
apachesolr_search_page_settings_form in ./apachesolr_search.admin.inc
Menu callback/form-builder for the form to create or edit a search page.

File

./apachesolr_search.admin.inc, line 11
Administrative settings for searching.

Code

function _apachesolr_search_browse_form($default_value) {
  $description = t('This is what is shown when the user enters an empty search, or removes all filters from an active search.') . ' ';
  if (!module_exists('facetapi')) {
    $description .= t('<strong>Facets will not be shown until you enable Facet API module.</strong>');
  }
  else {
    $description .= t('Remember to configure the facets on the <a href="!facetslink">search environment page</a> and assign blocks to regions on the <a href="!blocklink">block settings page</a>', array(
      '!facetslink' => url('admin/config/search/apachesolr/settings/'),
      '!blocklink' => url('admin/structure/block'),
    ));
  }
  return array(
    '#type' => 'radios',
    '#title' => t('Behavior on empty search'),
    '#options' => array(
      'none' => t("Show search box"),
      'browse' => t("Show enabled facets' blocks under the search box"),
      'blocks' => t("Show enabled facets' blocks in their configured regions"),
      'results' => t("Show enabled facets' blocks in their configured regions and first page of all available results"),
    ),
    '#default_value' => $default_value,
    '#description' => $description,
  );
}