You are here

function radioactivity_admin_general_form in Radioactivity 6

Same name and namespace in other branches
  1. 5 radioactivity.module \radioactivity_admin_general_form()
  2. 7.2 radioactivity-admin-ui.inc \radioactivity_admin_general_form()
  3. 7 radioactivity-admin-ui.inc \radioactivity_admin_general_form()

@file Radioactivity core admin UI.

1 string reference to 'radioactivity_admin_general_form'
radioactivity_menu in ./radioactivity.module

File

./radioactivity-admin-ui.inc, line 7
Radioactivity core admin UI.

Code

function radioactivity_admin_general_form() {
  $form = array();
  $form['radioactivity_decay_granularity'] = array(
    '#type' => 'textfield',
    '#title' => t('Decay granularity (in seconds)'),
    '#description' => t('This setting determines how often at most the radioactivity is decreased by the decay formula. ' . 'The shorter the time, the more accurate the modeling will be, but the more database ' . 'activity is required. The default (10 minutes) should be good starting point.'),
    '#size' => 10,
    '#required' => TRUE,
    '#default_value' => _radioactivity_get_decay_granularity(),
  );
  $form['memcached'] = array(
    '#type' => 'fieldset',
    '#tree' => FALSE,
    '#title' => t('Memcached acceleration'),
  );
  $memcached_ok = FALSE;
  $mc_status = radioactivity_determine_memcached_availability();
  $memcached_ok = $mc_status > 0;
  $memcached_availability_text = _radioactivity_get_memcached_availability_string($mc_status);
  $form['memcached']['availability'] = array(
    '#type' => 'item',
    '#title' => t('Memcached status'),
    '#value' => $memcached_availability_text,
  );
  if ($memcached_ok) {
    $form['memcached']['radioactivity_memcached_enable'] = array(
      '#type' => 'checkbox',
      '#title' => t('Memcached acceleration'),
      '#description' => t('If this option is enabled, energy additions are deferred by saving an ' . 'entry with minimal information to memcached bin <em>radioactivity</em>. ' . 'These entries are batch processed in cron runs.'),
      '#default_value' => radioactivity_get_memcached_enable(),
    );
    $form['memcached']['radioactivity_memcached_expiration'] = array(
      '#type' => 'textfield',
      '#title' => t('Memcached entry expiration time (in seconds)'),
      '#description' => t('Expiration time for memcached entries used by radioactivity. This should be at least twice as long as your maximum ' . 'cron interval.'),
      '#size' => 10,
      '#required' => TRUE,
      '#default_value' => radioactivity_get_memcached_expiration(),
    );
  }
  return system_settings_form($form);
}