You are here

background_batch.admin.inc in Background Process 7.2

Pages for background batch.

@todo Implement proper error page instead of just 404.

File

background_batch/background_batch.admin.inc
View source
<?php

/**
 * @file
 *
 * Pages for background batch.
 *
 * @todo Implement proper error page instead of just 404.
 */

/**
 * System settings page.
 */
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);
}

Functions

Namesort descending Description
background_batch_settings_form System settings page.