You are here

function heartbeat_logs_admin_settings in Heartbeat 6.3

Function to maintain and administer specific settings

Return value

settingsform

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

File

./heartbeat.admin.inc, line 594

Code

function heartbeat_logs_admin_settings() {
  $form['hb_fields'] = array(
    '#type' => 'fieldset',
    '#weight' => -5,
    '#title' => t('Heartbeat log settings'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $value = variable_get('heartbeat_activity_no_duplicate_seconds', 172800);
  $form['hb_fields']['heartbeat_activity_no_duplicate_seconds'] = array(
    '#title' => t('Total timespan to show in heartbeat views'),
    '#type' => 'textfield',
    '#size' => 40,
    '#default_value' => $value,
    '#description' => t('Currently set ') . _heartbeat_activity_get_time($value) . '.<br />' . t('You can set this to your needs. For example 36000 is 10h, 172800 is 24h'),
    '#prefix' => '<div id="heartbeat-tabs">',
    '#suffix' => '</div>',
    '#ahah' => array(
      'path' => 'heartbeat/ahah/heartbeat_activity_no_duplicate_seconds',
      'wrapper' => 'heartbeat-tabs',
      'event' => 'change',
      'method' => 'replace',
      'effect' => 'fade',
    ),
  );
  $value = variable_get('heartbeat_activity_grouping_seconds', 7200);
  $form['hb_fields']['heartbeat_activity_grouping_seconds'] = array(
    '#title' => t('Maximum gap (in seconds)'),
    '#type' => 'textfield',
    '#size' => 40,
    '#default_value' => $value,
    '#description' => t('Currently set ') . _heartbeat_activity_get_time($value) . '.<br />' . t('Maximum gap for the same activity to be grouped together and before an identical activity can be logged again'),
    '#prefix' => '<div id="heartbeat-tabs-2">',
    '#suffix' => '</div>',
    '#ahah' => array(
      'path' => 'heartbeat/ahah/heartbeat_activity_grouping_seconds',
      'wrapper' => 'heartbeat-tabs-2',
      'event' => 'change',
      'method' => 'replace',
      'effect' => 'fade',
    ),
  );
  $form['hb_fields']['heartbeat_activity_grouping_how_many'] = array(
    '#title' => 'Maximum number of messages to group',
    '#type' => 'textfield',
    '#size' => 20,
    '#default_value' => variable_get('heartbeat_activity_grouping_how_many', 5),
    '#description' => 'Maximum number of items that can be grouped. This can be overruled for each heartbeat message specific.',
  );
  $form['hb_fields']['heartbeat_block_items_max'] = array(
    '#title' => 'Maximum rows that are fetched from database',
    '#type' => 'textfield',
    '#size' => 20,
    '#default_value' => variable_get('heartbeat_block_items_max', 100),
    '#description' => 'This is for performance reasons. Limiting the messages is calculated after grouping',
  );

  /**
   * TODO Make a variable that holds all HeartbeatAccessStates
   * so public, private, connected and custom states can be set
   * separatly.
   */
  $form['hb_fields']['heartbeat_block_public_items_max'] = array(
    '#title' => 'Maximum items in the public heartbeat',
    '#type' => 'textfield',
    '#size' => 20,
    '#default_value' => variable_get('heartbeat_block_public_items_max', 25),
  );
  $form['hb_fields']['heartbeat_block_private_items_max'] = array(
    '#title' => 'Maximum items in the private heartbeat',
    '#type' => 'textfield',
    '#size' => 20,
    '#default_value' => variable_get('heartbeat_block_private_items_max', 25),
  );
  $form = system_settings_form($form);
  $form['#submit'][] = 'heartbeat_activity_admin_settings_submit';
  return $form;
}