You are here

function apachesolr_check_facetapi in Apache Solr Search 8

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

Check to see if the facetapi module is installed, and if not put up a message.

Only call this function if the user is already in a position for this to be useful.

1 call to apachesolr_check_facetapi()
apachesolr_settings in ./apachesolr.admin.inc
Form builder for general settings used as a menu callback.

File

./apachesolr.admin.inc, line 322
Administrative pages for the Apache Solr framework.

Code

function apachesolr_check_facetapi() {
  if (!module_exists('facetapi')) {
    $filename = db_query_range("SELECT filename FROM {system} WHERE type = 'module' AND name = 'facetapi'", 0, 1)
      ->fetchField();
    if ($filename && file_exists($filename)) {
      drupal_set_message(t('If you <a href="@modules">enable the facetapi module</a>, Apache Solr Search will provide you with configurable facets.', array(
        '@modules' => url('admin/modules'),
      )));
    }
    else {
      drupal_set_message(t('If you install the facetapi module from !href, Apache Solr Search will provide you with configurable facets.', array(
        '!href' => url('http://drupal.org/project/facetapi'),
      )));
    }
  }
}