You are here

function heartbeat_activity_stream_configure_submit in Heartbeat 6.4

Callback function to configure a heartbeat stream

File

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

Code

function heartbeat_activity_stream_configure_submit($form, $form_state) {
  $type = $form_state['values']['access_type'];
  $settings = array(
    'block_items_max' => $form_state['values']['block_items_max'],
    'block_show_pager' => $form_state['values']['block_show_pager'],
    'page_items_max' => $form_state['values']['page_items_max'],
    'page_disabled' => $form_state['values']['page_disabled'],
    'page_show_pager' => $form_state['values']['page_show_pager'],
    'page_pager_ajax' => $form_state['values']['page_pager_ajax'],
    'num_load_max' => $form_state['values']['num_load_max'],
    'grouping_seconds' => $form_state['values']['grouping_seconds'],
    'skip_active_user' => $form_state['values']['skip_active_user'],
  );

  // populate the settings with the form state
  if (isset($form_state['values']['settings'])) {
    $settings += $form_state['values']['settings'];
  }
  $additions = array(
    'poll_messages' => $form_state['values']['poll_messages'],
    'messages_denied' => $form_state['values']['messages_denied'],
    'display_filters' => $form_state['values']['display_filters'],
    'display_block_filters' => $form_state['values']['display_block_filters'],
    'filters_cumul' => $form_state['values']['filters_cumul'],
    'filters' => $form_state['values']['filters'],
    'settings' => $settings,
  );
  heartbeat_stream_save($type, $additions);
  menu_rebuild();
}