You are here

function drupal_commons_config_ur in Drupal Commons 6

Same name and namespace in other branches
  1. 6.2 drupal_commons.profile \drupal_commons_config_ur()

Configure user_relationships

1 string reference to 'drupal_commons_config_ur'
drupal_commons_profile_tasks in ./drupal_commons.profile
Perform any final installation tasks for this profile.

File

./drupal_commons.profile, line 336

Code

function drupal_commons_config_ur() {

  // Add initial relationship type 'Friend'
  $relationship = new stdClass();
  $relationship->name = st('follower');
  $relationship->plural_name = st('users you follow');
  $relationship->requires_approval = 0;
  $relationship->expires_val = 0;
  $relationship->is_oneway = 1;
  $relationship->is_reciprocal = 1;
  $type = 'insert';

  // Save relationship
  drupal_write_record('user_relationship_types', $relationship);

  // Alert other modules about the new relationship
  $hook = 'user_relationships_type';
  foreach (module_implements($hook) as $module) {
    $function = $module . '_' . $hook;
    $function($type, $relationship);
  }
}