You are here

function panopoly_search_facet_content_type_render in Panopoly Search 7

1 string reference to 'panopoly_search_facet_content_type_render'
facet.inc in plugins/content_types/facet/facet.inc

File

plugins/content_types/facet/facet.inc, line 62

Code

function panopoly_search_facet_content_type_render($subtype, $conf, $args, $context) {

  // Assemble some important information
  $builds =& drupal_static(__FUNCTION__, array());
  $parsed =& drupal_static('facetapi_parsed_deltas', array());
  $delta = $conf['delta'];
  facetapi_check_block_visibility($delta);

  /* this is needed to call to build the parsed information */
  list($searcher, $realm_name, $facet_name) = $parsed[$delta];

  // Builds and caches the entire realm per searcher / realm combination.
  $group = $searcher . ':' . $realm_name;
  if (!isset($builds[$group])) {
    $builds[$group] = facetapi_build_realm($searcher, $realm_name);
  }

  // Returns the individual pane
  if (isset($builds[$group][$facet_name])) {
    $variables = array(
      'title' => $builds[$group][$facet_name]['#title'],
      'facet' => $builds[$group][$facet_name],
    );
    $pane = new stdClass();
    $pane->title = theme('facetapi_title', $variables);
    $pane->content = $builds[$group][$facet_name];
    return $pane;
  }
}