You are here

function apachesolr_has_searched in Apache Solr Search 8

Same name and namespace in other branches
  1. 5.2 apachesolr.module \apachesolr_has_searched()
  2. 5 apachesolr.module \apachesolr_has_searched()
  3. 6.3 apachesolr.module \apachesolr_has_searched()
  4. 6 apachesolr.module \apachesolr_has_searched()
  5. 6.2 apachesolr.module \apachesolr_has_searched()
  6. 7 apachesolr.module \apachesolr_has_searched()

Semaphore that indicates whether a search has been done. Blocks use this later to decide whether they should load or not.

Parameters

$searched: A boolean indicating whether a search has been executed.

Return value

TRUE if a search has been executed. FALSE otherwise.

6 calls to apachesolr_has_searched()
ApacheSolrFacetapiAdapter::searchExecuted in plugins/facetapi/adapter.inc
Returns a boolean flagging whether $this->_searcher executed a search.
apachesolr_search_block_view in ./apachesolr_search.module
Implements hook_block_view().
apachesolr_search_custom_page_search_form in ./apachesolr_search.pages.inc
Search for placed on user defined search pages.
apachesolr_search_get_search_suggestions in ./apachesolr_search.module
Retrieve all of the suggestions that were given after a certain search
apachesolr_search_run in ./apachesolr_search.module
Execute a search results based on keyword, filter, and sort strings.

... See full list

File

./apachesolr.module, line 1087
Integration with the Apache Solr search application.

Code

function apachesolr_has_searched($env_id, $searched = NULL) {
  $_searched =& drupal_static(__FUNCTION__, FALSE);
  if (is_bool($searched)) {
    $_searched[$env_id] = $searched;
  }

  // Return false if the search environment is not available in our array
  if (!isset($_searched[$env_id])) {
    return FALSE;
  }
  return $_searched[$env_id];
}