You are here

function background_batch_settings_form in Background Process 7.2

Same name and namespace in other branches
  1. 6 background_batch/background_batch.pages.inc \background_batch_settings_form()
  2. 7 background_batch/background_batch.pages.inc \background_batch_settings_form()

System settings page.

1 string reference to 'background_batch_settings_form'
background_batch_menu in background_batch/background_batch.module
Implements hook_menu().

File

background_batch/background_batch.admin.inc, line 15
Pages for background batch.

Code

function background_batch_settings_form() {
  $form = array();
  $form['background_batch_enabled'] = array(
    '#type' => 'checkbox',
    '#default_value' => variable_get('background_batch_enabled', BACKGROUND_BATCH_ENABLED),
    '#title' => 'Enable Background Batch',
    '#description' => t('When checked, Background Batch takes over all batch jobs.'),
  );
  $form['background_batch_delay'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('background_batch_delay', BACKGROUND_BATCH_DELAY),
    '#title' => 'Delay',
    '#description' => t('Time in seconds for progress refresh'),
  );
  $form['background_batch_process_lifespan'] = array(
    '#type' => 'textfield',
    '#default_value' => variable_get('background_batch_process_lifespan', BACKGROUND_BATCH_PROCESS_LIFESPAN),
    '#title' => 'Process lifespan',
    '#description' => t('Time in seconds for progress lifespan'),
  );
  $form['background_batch_show_eta'] = array(
    '#type' => 'checkbox',
    '#default_value' => variable_get('background_batch_show_eta', BACKGROUND_BATCH_PROCESS_ETA),
    '#title' => 'Show ETA of batch process',
    '#description' => t('Whether ETA (estimated time of arrival) information should be shown'),
  );
  $options = background_process_get_service_groups();
  foreach ($options as $key => &$value) {
    $value = (empty($value['description']) ? $key : $value['description']) . ' (' . join(',', $value['hosts']) . ')';
  }
  $form['background_batch_default_service_group'] = array(
    '#type' => 'select',
    '#title' => t('Default service group'),
    '#description' => t('The default service group to use.'),
    '#options' => $options,
    '#default_value' => variable_get('background_batch_default_service_group', variable_get('background_process_default_service_group', 'default')),
  );
  return system_settings_form($form);
}