You are here

function globallink_node_type_insert in GlobalLink Connect for Drupal 7.5

Same name and namespace in other branches
  1. 7.7 globallink.module \globallink_node_type_insert()
  2. 7.6 globallink.module \globallink_node_type_insert()

Implements hook_node_type_insert().

File

./globallink.module, line 591
GlobalLink translation module.

Code

function globallink_node_type_insert($info) {
  if (!globallink_translation_supported($info->type)) {
    return;
  }
  db_insert('globallink_field_config')
    ->fields(array(
    'content_type' => $info->type,
    'entity_type' => 'node',
    'bundle' => $info->type,
    'field_name' => 'title',
    'field_type' => 'text',
    'field_label' => 'Title',
    'translatable' => 1,
  ))
    ->execute();
  db_insert('globallink_field_config')
    ->fields(array(
    'content_type' => $info->type,
    'entity_type' => 'node',
    'bundle' => $info->type,
    'field_name' => 'body',
    'field_type' => 'text_with_summary',
    'field_label' => 'Body',
    'translatable' => 1,
  ))
    ->execute();
  $metatag_module_exists = module_exists("metatag");
  if ($metatag_module_exists) {
    db_insert('globallink_field_config')
      ->fields(array(
      'content_type' => $info->type,
      'entity_type' => 'node',
      'bundle' => $info->type,
      'field_name' => 'metatags',
      'field_type' => 'text',
      'field_label' => 'Meta tags',
      'translatable' => 1,
    ))
      ->execute();
  }
}