<?php

/**
 * @file
 * OG Forum install
 */

/**
 * Implements hook_install().
 */
function og_forum_install() {

  // Add group audience to forum taxonomy terms.
  $vocabulary = taxonomy_vocabulary_load(variable_get('forum_nav_vocabulary', 0));
  og_create_field(OG_AUDIENCE_FIELD, 'taxonomy_term', $vocabulary->machine_name);

  // Add group audience and group visibility to topic.
  og_create_field(OG_AUDIENCE_FIELD, 'node', 'forum');
  og_create_field(OG_CONTENT_ACCESS_FIELD, 'node', 'forum');
}
