<?php
/**
 * @file
 * diy_guidebook.features.inc
 */

/**
 * Implements hook_ctools_plugin_api().
 */
function diy_guidebook_ctools_plugin_api($module = NULL, $api = NULL) {
  if ($module == "context" && $api == "context") {
    return array("version" => "3");
  }
  if ($module == "field_group" && $api == "field_group") {
    return array("version" => "1");
  }
}

/**
 * Implements hook_views_api().
 */
function diy_guidebook_views_api($module = NULL, $api = NULL) {
  return array("api" => "3.0");
}

/**
 * Implements hook_node_info().
 */
function diy_guidebook_node_info() {
  $items = array(
    'topic' => array(
      'name' => t('Thema'),
      'base' => 'node_content',
      'description' => '',
      'has_title' => '1',
      'title_label' => t('Titel'),
      'help' => '',
    ),
  );
  return $items;
}

/**
 * Implements hook_default_search_api_index().
 */
function diy_guidebook_default_search_api_index() {
  $items = array();
  $items['guidebook'] = entity_import('search_api_index', '{
    "name" : "Guidebook",
    "machine_name" : "guidebook",
    "description" : null,
    "server" : "local_solr_server",
    "item_type" : "node",
    "options" : {
      "index_directly" : 1,
      "cron_limit" : "50",
      "fields" : {
        "nid" : { "type" : "integer" },
        "type" : { "type" : "string" },
        "title" : { "type" : "text" },
        "status" : { "type" : "integer" },
        "created" : { "type" : "date" },
        "diy_search_domain_access" : { "type" : "list\\u003Cinteger\\u003E" },
        "field_news_tags" : { "type" : "list\\u003Cinteger\\u003E", "entity_type" : "taxonomy_term" },
        "field_channel_footer_title" : { "type" : "text" },
        "field_channel_header_title" : { "type" : "text" },
        "field_guidebook_taxonomy" : { "type" : "list\\u003Cinteger\\u003E", "entity_type" : "taxonomy_term" },
        "field_topic_content" : {
          "type" : "list\\u003Cinteger\\u003E",
          "entity_type" : "field_collection_item"
        },
        "search_api_language" : { "type" : "string" },
        "field_channel_footer:value" : { "type" : "text" },
        "field_topic_content:field_channel_title" : { "type" : "list\\u003Ctext\\u003E" },
        "field_topic_content:field_how_to_title" : { "type" : "list\\u003Ctext\\u003E" },
        "field_topic_content:field_navigator_block_s_text" : { "type" : "list\\u003Ctext\\u003E" },
        "field_topic_content:field_navigator_block_s_title" : { "type" : "list\\u003Ctext\\u003E" }
      },
      "data_alter_callbacks" : {
        "search_api_ranges_alter" : { "status" : 0, "weight" : "-50", "settings" : { "fields" : [] } },
        "search_api_alter_bundle_filter" : {
          "status" : 1,
          "weight" : "-10",
          "settings" : { "default" : "0", "bundles" : { "topic" : "topic" } }
        },
        "search_api_alter_node_access" : { "status" : 0, "weight" : "0", "settings" : [] },
        "search_api_alter_node_status" : { "status" : 1, "weight" : "0", "settings" : [] },
        "search_api_alter_language_control" : {
          "status" : 0,
          "weight" : "0",
          "settings" : { "lang_field" : "", "languages" : [] }
        },
        "search_api_alter_add_hierarchy" : {
          "status" : 1,
          "weight" : "0",
          "settings" : { "fields" : {
              "field_guidebook_taxonomy:parent" : "field_guidebook_taxonomy:parent",
              "field_guidebook_taxonomy:parents_all" : "field_guidebook_taxonomy:parents_all"
            }
          }
        },
        "search_api_alter_add_url" : { "status" : 0, "weight" : "0", "settings" : [] },
        "search_api_alter_add_aggregation" : { "status" : 0, "weight" : "0", "settings" : [] },
        "search_api_alter_add_viewed_entity" : { "status" : 0, "weight" : "0", "settings" : { "mode" : "full" } }
      },
      "processors" : {
        "search_api_case_ignore" : {
          "status" : 1,
          "weight" : "0",
          "settings" : { "fields" : {
              "title" : true,
              "field_channel_footer_title" : true,
              "field_channel_header_title" : true,
              "field_channel_header:value" : true,
              "field_channel_footer:value" : true,
              "field_topic_content:field_channel_title" : true,
              "field_topic_content:field_how_to_title" : true,
              "field_topic_content:field_navigator_block_s_text" : true,
              "field_topic_content:field_navigator_block_s_title" : true
            }
          }
        },
        "search_api_html_filter" : {
          "status" : 0,
          "weight" : "10",
          "settings" : {
            "fields" : {
              "title" : true,
              "field_channel_footer_title" : true,
              "field_channel_header_title" : true,
              "field_channel_header:value" : true,
              "field_channel_footer:value" : true,
              "field_topic_content:field_channel_title" : true,
              "field_topic_content:field_how_to_title" : true,
              "field_topic_content:field_navigator_block_s_text" : true,
              "field_topic_content:field_navigator_block_s_title" : true
            },
            "title" : 0,
            "alt" : 1,
            "tags" : "h1 = 5\\r\\nh2 = 3\\r\\nh3 = 2\\r\\nstrong = 2\\r\\nb = 2\\r\\nem = 1.5\\r\\nu = 1.5"
          }
        },
        "search_api_transliteration" : {
          "status" : 0,
          "weight" : "15",
          "settings" : { "fields" : {
              "title" : true,
              "field_channel_footer_title" : true,
              "field_channel_header_title" : true,
              "field_channel_header:value" : true,
              "field_channel_footer:value" : true,
              "field_topic_content:field_channel_title" : true,
              "field_topic_content:field_how_to_title" : true,
              "field_topic_content:field_navigator_block_s_text" : true,
              "field_topic_content:field_navigator_block_s_title" : true
            }
          }
        },
        "search_api_tokenizer" : {
          "status" : 0,
          "weight" : "20",
          "settings" : {
            "fields" : {
              "title" : true,
              "field_channel_footer_title" : true,
              "field_channel_header_title" : true,
              "field_channel_header:value" : true,
              "field_channel_footer:value" : true,
              "field_topic_content:field_channel_title" : true,
              "field_topic_content:field_how_to_title" : true,
              "field_topic_content:field_navigator_block_s_text" : true,
              "field_topic_content:field_navigator_block_s_title" : true
            },
            "spaces" : "[^[:alnum:]]",
            "ignorable" : "[\\u0027]"
          }
        },
        "search_api_stopwords" : {
          "status" : 0,
          "weight" : "30",
          "settings" : {
            "fields" : {
              "title" : true,
              "field_channel_footer_title" : true,
              "field_channel_header_title" : true,
              "field_channel_header:value" : true,
              "field_channel_footer:value" : true,
              "field_topic_content:field_channel_title" : true,
              "field_topic_content:field_how_to_title" : true,
              "field_topic_content:field_navigator_block_s_text" : true,
              "field_topic_content:field_navigator_block_s_title" : true
            },
            "file" : "",
            "stopwords" : "but\\r\\ndid\\r\\nthe this that those\\r\\netc"
          }
        }
      }
    },
    "enabled" : "1",
    "read_only" : "0",
    "rdf_mapping" : []
  }');
  return $items;
}
