You are here

function parser_common_syndication_install in FeedAPI 6

Same name and namespace in other branches
  1. 5 parser_common_syndication/parser_common_syndication.install \parser_common_syndication_install()

Implementation of hook_install().

File

parser_common_syndication/parser_common_syndication.install, line 34
Adds it to the content-type configuration

Code

function parser_common_syndication_install() {
  drupal_install_schema('parser_common_syndication');

  // Set the parser of defaultly shipped processors if it's not done previously.
  $default_processors = array(
    'feed',
  );
  $set_common = array(
    "parsers" => array(
      "parser_common_syndication" => array(
        "enabled" => TRUE,
        "weight" => 0,
      ),
    ),
  );
  foreach ($default_processors as $processor) {
    $settings = variable_get('feedapi_settings_' . $processor, FALSE);
    if (!isset($settings['parsers'])) {
      $settings = is_array($settings) ? array_merge($settings, $set_common) : $set_common;
      variable_set('feedapi_settings_' . $processor, $settings);
    }
  }
}