You are here

function facetapi_get_realm_info in Facet API 7

Same name and namespace in other branches
  1. 6.3 facetapi.module \facetapi_get_realm_info()
  2. 7.2 facetapi.module \facetapi_get_realm_info()

Returns all defined realm definitions.

Return value

array An array of realm definitions. Each definition is an array keyed by the machine readable name of the realm. See the return value of the facetapi_realm_load() function for the structure of the definitions.

5 calls to facetapi_get_realm_info()
facetapi_get_delta_map in ./facetapi.block.inc
Returns a cached delta map of hashes to names.
facetapi_i18n_string_list in ./facetapi.module
Implements hook_i18n_string_list().
facetapi_menu in ./facetapi.module
Implements hook_menu().
facetapi_realm_load in ./facetapi.module
Returns a realm definition.
facetapi_set_facet_status in ./facetapi.module
Enables or disables a facet for this page load only.

File

./facetapi.module, line 624
An abstracted facet API that can be used by various search backends.

Code

function facetapi_get_realm_info() {
  $realm_info =& drupal_static(__FUNCTION__);
  if (NULL === $realm_info) {
    $realm_info = module_invoke_all('facetapi_realm_info');
    foreach ($realm_info as $realm_name => $realm) {
      $realm_info[$realm_name] += array(
        'name' => $realm_name,
        'label' => $realm_name,
        'description' => '',
        'default widget' => '',
        'settings callback' => FALSE,
        'element type' => 'links',
        'sortable' => TRUE,
        'weight' => 0,
      );
    }
    drupal_alter('facetapi_realm_info', $realm_info);
    uasort($realm_info, 'drupal_sort_weight');
  }
  return $realm_info;
}