You are here

function drupal_commons_create_group in Drupal Commons 6.2

Same name and namespace in other branches
  1. 6 drupal_commons.profile \drupal_commons_create_group()

Create an initial group with a discussion

1 call to drupal_commons_create_group()
drupal_commons_cleanup in ./drupal_commons.profile
Various actions needed to clean up after the installation

File

./drupal_commons.profile, line 480

Code

function drupal_commons_create_group() {
  drupal_commons_include('node');

  // Create the group
  $group = _drupal_commons_default_group_node();
  node_save($group);

  // Check if discussion nodes were enabled
  if (in_array('commons_discussion', variable_get('commons_selected_features', array()))) {

    // Create the discussion
    $node = _drupal_commons_default_discussion_node();
    $node->og_groups = array(
      $group->nid => $group->nid,
    );
    node_save($node);
  }
}