You are here

function heartbeat_messages_access_types in Heartbeat 6.4

Menu callback to show a page with heartbeat access types Shows the several composed streams.

1 string reference to 'heartbeat_messages_access_types'
heartbeat_menu in ./heartbeat.module
Implementation of hook_menu().

File

./heartbeat.admin.inc, line 378
Admnistration tasks for heartbeat.

Code

function heartbeat_messages_access_types($form_state = array()) {

  // Import default data (filters)
  heartbeat_default_data();
  $types = variable_get('heartbeat_access_types', array());
  $default_stream_data = array(
    'privateheartbeat' => array(
      'profile' => 1,
    ),
    'publicheartbeat' => array(
      'profile' => 0,
    ),
  );
  $stream_data = variable_get('heartbeat_stream_data', $default_stream_data);
  $form = array();
  $form['#prefix'] = '<p>' . t('Visiting this page will check for new heartbeat streams.
    If you want to add a stream, just implement the hook
    <strong><em>hook_heartbeat_register_access_types</em></strong>.') . '</p>';
  $form['streams'] = array(
    '#type' => 'fieldset',
    '#title' => t('Streams'),
    '#collapsible' => FALSE,
    '#tree' => TRUE,
    '#theme' => 'heartbeat_stream_overview',
    '#weight' => 4,
    '#parameters' => array(
      'types' => $types,
    ),
  );
  $form['streams']['#description'] = '<p>' . t('You can select each stream to be set as profile page. This
    will create a menu entry to see the messages as displayed user and not the currently
    logged-in user. The menu tab will be available at http://yoursite.com/user/%user/%heartbeatstream.<br />
    Note that it often has very little purpose to use streams on profile page when the
    query does not target the actor. E.g. PublicHeartbeat.') . '</p>';
  foreach (array_keys($types) as $key) {
    $form['streams'][$key] = array(
      '#type' => 'checkbox',
      '#default_value' => isset($stream_data[$key]) ? $stream_data[$key]['profile'] : 0,
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
    '#weight' => 5,
  );
  return $form;
}