You are here

function friendlist_activity_form_alter in Heartbeat 6.4

Same name and namespace in other branches
  1. 6.3 modules/friendlist_activity/friendlist_activity.module \friendlist_activity_form_alter()

Implementation of hook_form_alter().

File

modules/friendlist_activity/friendlist_activity.module, line 80

Code

function friendlist_activity_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'heartbeat_admin_settings') {

    // heartbeat_relations_api
    $form['heartbeat_relations'] = array(
      '#type' => 'fieldset',
      '#weight' => 0,
      '#title' => t('Heartbeat relation settings'),
      '#collapsible' => TRUE,
      '#collapsed' => FALSE,
    );
    $options = array(
      'none' => t('None'),
    );
    if (module_exists('friendlist_api')) {
      $options['friendlist_api'] = t('Friendlist API');
    }
    if (module_exists('user_relationships_api')) {
      $options['user_relationships_api'] = t('User Relationships');
    }
    if (module_exists('flag_friend')) {
      $options['flag_friend_api'] = t('Flag friend');
    }
    $form['heartbeat_relations']['heartbeat_relations_api'] = array(
      '#title' => t('User relation API to define heartbeat relations'),
      '#type' => 'select',
      '#options' => $options,
      '#default_value' => variable_get('heartbeat_relations_api', 'none'),
    );
  }
}