You are here

function search_api_exclude_node_form_search_api_exclude_content_type_render in Search API exclude 7

File

plugins/content_types/node_form_search_api_exclude.inc, line 16

Code

function search_api_exclude_node_form_search_api_exclude_content_type_render($subtype, $conf, $panel_args, &$context) {
  $block = new stdClass();
  $block->module = t('node_form');
  $block->title = t('Search API exclude information');
  $block->delta = 'search_api_exclude-options';
  if (isset($context->form)) {
    if (!empty($context->form['search_api_exclude'])) {
      $block->content['search_api_exclude'] = $context->form['search_api_exclude'];
      if (isset($block->content['search_api_exclude']['#group'])) {
        unset($block->content['search_api_exclude']['#pre_render']);
        unset($block->content['search_api_exclude']['#theme_wrappers']);
      }

      // Set access to false on the original rather than removing so that
      // vertical tabs doesn't clone it. I think this is due to references.
      $context->form['search_api_exclude']['#access'] = FALSE;
    }
  }
  else {
    $block->content = t('Search API exclude information.');
  }
  return $block;
}