You are here

function sparkpost_requeue_admin_settings in Sparkpost email 7

Same name and namespace in other branches
  1. 7.2 modules/sparkpost_requeue/sparkpost_requeue.admin.inc \sparkpost_requeue_admin_settings()

Menu callback for the admin settings form.

1 string reference to 'sparkpost_requeue_admin_settings'
sparkpost_requeue_menu in modules/sparkpost_requeue/sparkpost_requeue.module
Implements hook_menu().

File

modules/sparkpost_requeue/sparkpost_requeue.admin.inc, line 11
Admin settings for sparkpost requeue.

Code

function sparkpost_requeue_admin_settings() {
  $form['sparkpost_requeue_enable'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable sparkpost requeue'),
    '#default_value' => variable_get('sparkpost_requeue_enable', FALSE),
  );
  $form['sparkpost_requeue_max_retries'] = array(
    '#type' => 'textfield',
    '#title' => t('Max number of retries of a message'),
    '#default_value' => variable_get('sparkpost_requeue_max_retries', 10),
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
    '#states' => array(
      'invisible' => array(
        ':input[name="sparkpost_requeue_enable"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  $form['sparkpost_requeue_minimum_time'] = array(
    '#type' => 'textfield',
    '#title' => t('Minimum time between retries in seconds.'),
    '#default_value' => variable_get('sparkpost_requeue_minimum_time', 300),
    '#element_validate' => array(
      'element_validate_integer_positive',
    ),
    '#states' => array(
      'invisible' => array(
        ':input[name="sparkpost_requeue_enable"]' => array(
          'checked' => FALSE,
        ),
      ),
    ),
  );
  return system_settings_form($form);
}