You are here

function search_api_page_search_box_content_type_render in Search API Pages 7

Renders the custom content type.

1 string reference to 'search_api_page_search_box_content_type_render'
search_api_page_search_box.inc in plugins/content_types/search_api_page_search_box.inc

File

plugins/content_types/search_api_page_search_box.inc, line 24

Code

function search_api_page_search_box_content_type_render($subtype, $conf, $panel_args, $contexts) {
  $page = search_api_page_load($conf['page']);
  if ($page && $page->enabled && search_api_page_access($conf['page'])) {
    $keys = NULL;
    if (!empty($conf['keys'])) {
      $keys = ctools_context_keyword_substitute($conf['keys'], array(), $contexts);
    }
    $block = new stdClass();
    $block->module = 'search_api_page';
    $block->delta = 'result';
    $block->subject = t($page->name);
    $block->content = drupal_get_form('search_api_page_search_form_' . $page->machine_name, $page, $keys, TRUE);
    $block->content['#contextual_links']['search_api_page'] = array(
      'admin/config/search/search_api/page',
      array(
        $page->machine_name,
      ),
    );
    return $block;
  }
  return NULL;
}