You are here

function mailhandler_admin_settings in Mailhandler 6

Same name and namespace in other branches
  1. 7 mailhandler.admin.inc \mailhandler_admin_settings()

Return the settings page for mailhandler

1 string reference to 'mailhandler_admin_settings'
mailhandler_menu in ./mailhandler.module
Implementation of hook_menu().

File

./mailhandler.admin.inc, line 364
Administrator pages for the Mailhandler module.

Code

function mailhandler_admin_settings() {
  $form['mailhandler_default_type'] = array(
    '#type' => 'radios',
    '#title' => t('Default content type'),
    '#description' => t('If an incoming message does not specify a particular content type, then use this type as a default.'),
    '#options' => node_get_types('names'),
    '#default_value' => mailhandler_default_type(),
  );
  $form['mailhandler_max_retrieval'] = array(
    '#type' => 'textfield',
    '#title' => t('Cron maximum message retrieval'),
    '#description' => t('To prevent timeout errors from large mailboxes you can limit the maximum number of messages that will be processed during each cron run. This is a global setting and applies to all mailboxes. A value of zero means that no limit will be applied. Some trial and error may be needed to find the optimum setting.'),
    '#default_value' => variable_get('mailhandler_max_retrieval', 0),
  );
  $form['mailhandler_default_encoding'] = array(
    '#type' => 'textfield',
    '#title' => t('Default character encoding'),
    '#description' => t('The default character encoding to use when an incoming message does not define an encoding.'),
    '#default_value' => variable_get('mailhandler_default_encoding', 'UTF-8'),
  );
  $form['mailhandler_watchdog_level'] = array(
    '#title' => t('Recorded events severity'),
    '#type' => 'select',
    '#options' => watchdog_severity_levels(),
    '#description' => t('Mailhandler will record messages to the selected facility for levels including Emergency up to the selected value here. For more information about the meaning of each category visit !link.', array(
      '!link' => l('severity levels defined in RFC 3164, section 4.1.1', 'http://www.faqs.org/rfcs/rfc3164.html'),
    )),
    '#default_value' => variable_get('mailhandler_watchdog_level', WATCHDOG_INFO),
  );
  $form['#validate'][] = 'mailhandler_admin_settings_validate';
  return system_settings_form($form);
}