You are here

function mail_safety_admin_settings_form in Mail Safety 7

Same name and namespace in other branches
  1. 7.2 mail_safety.admin.inc \mail_safety_admin_settings_form()

Form constructor for the Mail Safety settings form.

1 string reference to 'mail_safety_admin_settings_form'
mail_safety_menu in ./mail_safety.module
Implements hook_menu().

File

./mail_safety.admin.inc, line 12
Admin functionality for Mail Safety

Code

function mail_safety_admin_settings_form() {
  $form = array();
  $form['mail_safety_enabled'] = array(
    '#title' => t('Stop outgoing mails'),
    '#type' => 'checkbox',
    '#description' => t('When Mail Safety is enabled it will stop all outgoing emails from being sent and will send them to either the dashboard and/or the defaut mail address instead.'),
    '#default_value' => variable_get('mail_safety_enabled', FALSE),
  );
  $form['mail_safety_send_mail_to_dashboard'] = array(
    '#title' => t('Send mail to dashboard'),
    '#type' => 'checkbox',
    '#description' => t('If enabled, all mails will be sent to the dashboard'),
    '#default_value' => variable_get('mail_safety_send_mail_to_dashboard', TRUE),
  );
  $form['mail_safety_send_mail_to_default_mail'] = array(
    '#title' => t('Send mail to default mail'),
    '#type' => 'checkbox',
    '#description' => t('If enabled, all mails will be sent to the the default mail address'),
    '#default_value' => variable_get('mail_safety_send_mail_to_default_mail', TRUE),
  );
  $form['mail_safety_default_mail_address'] = array(
    '#title' => t('Default mail address'),
    '#type' => 'textfield',
    '#description' => t('The default email address that outgoing e-mails will be rerouted to if enabled.'),
    '#default_value' => variable_get('mail_safety_default_mail_address', ''),
  );
  $form['mail_safety_mail_expire'] = array(
    '#title' => t('Remove stored mails older than the given age.'),
    '#type' => 'select',
    '#options' => array(
      0 => t('Never'),
    ) + drupal_map_assoc(array(
      3600,
      86400,
      604800,
      1209600,
      2419200,
    ), 'format_interval'),
    '#description' => t('Requires a correctly configured <a href="@cron">cron maintenance task</a>.', array(
      '@cron' => url('admin/reports/status'),
    )),
    '#default_value' => variable_get('mail_safety_mail_expire', 0),
  );
  return system_settings_form($form);
}