You are here

function heartbeat_block_configure in Heartbeat 7

Implements hook_block_configure().

File

./heartbeat.module, line 384
Module file for heartbeat activity. Basic hook implementations and helper functions will be found here.

Code

function heartbeat_block_configure($delta = '') {
  if ($delta == 'heartbeat_active_users') {
    $info = entity_get_info('user');
    $options = array(
      'default' => t('default'),
    ) + drupal_map_assoc(array_keys($info['view modes']));
    $form = array(
      'view_mode' => array(
        '#type' => 'select',
        '#title' => t('Select view mode to render the users.'),
        '#default_value' => variable_get('heartbeat_active_users', 'default'),
        '#options' => $options,
      ),
    );
  }
  else {
    $stream = heartbeat_stream_config_load($delta);
    $form = array(
      'items' => array(
        '#type' => 'checkbox',
        '#title' => t('Show activity for the displayed user on the user profile page'),
        '#description' => t('By default heartbeat will show activity in relation to the
        currently logged in user.  With this setting enabled and only on the user profile page,
        the messages will be shown in relation to the user profile.'),
        '#default_value' => variable_get('heartbeat_show_user_profile_messages_' . drupal_strtolower($stream->class), 0),
      ),
    );
    if (module_exists('heartbeat_og')) {
      $form['exclude_og'] = array(
        '#type' => 'checkbox',
        '#title' => t('Exclude messages within Organic Group context.'),
        '#default_value' => variable_get('exclude_og_' . drupal_strtolower($stream->class), 0),
      );
    }
  }
  return $form;
}