You are here

function apachesolr_panels_apachesolr_info_content_type_render in Apache Solr Panels 7

Same name and namespace in other branches
  1. 6.3 plugins/content_types/apachesolr_info.inc \apachesolr_panels_apachesolr_info_content_type_render()
  2. 6 plugins/content_types/apachesolr_info.inc \apachesolr_panels_apachesolr_info_content_type_render()

Execute the search and render results.

File

plugins/content_types/apachesolr_info.inc, line 31

Code

function apachesolr_panels_apachesolr_info_content_type_render($subtype, $conf, $panel_args, $context) {
  $query = apachesolr_current_query(variable_get('apachesolr_default_environment', 'default'));
  if ($query) {
    $searcher = $query
      ->getSearcher();
    $response = apachesolr_static_response_cache($searcher);
  }
  $search = apachesolr_panels_static_search_cache();
  if (empty($response) || empty($search)) {
    return;
  }
  $block = new stdClass();
  $block->module = 'apachesolr_panels';
  $block->delta = 'info';
  $block->title = '';
  $block->content = theme('apachesolr_panels_info', array(
    'response' => $response,
    'search' => $search,
  ));
  return $block;
}