You are here

function webform_admin_settings in Webform 5

Same name and namespace in other branches
  1. 5.2 webform.module \webform_admin_settings()
  2. 6.3 includes/webform.admin.inc \webform_admin_settings()
  3. 6.2 webform.module \webform_admin_settings()
  4. 7.4 includes/webform.admin.inc \webform_admin_settings()
  5. 7.3 includes/webform.admin.inc \webform_admin_settings()

Menu callback for admin/webform/settings.

1 string reference to 'webform_admin_settings'
webform_menu in ./webform.module
Implementation of hook_menu().

File

./webform.module, line 309

Code

function webform_admin_settings() {
  $form['components'] = array(
    '#type' => 'fieldset',
    '#title' => t('Available Components'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#description' => t('Below is a list of supported field types available for webform. You may disable any of these components by unchecking its corresponding box. Only checked components will be available in existing or new webforms.'),
  );

  // Add each component to the form:
  $component_types = _webform_load_components(TRUE);
  foreach ($component_types as $component_name => $component_trans_name) {
    $form['components']['webform_enable_' . $component_name] = array(
      '#title' => $component_trans_name,
      '#description' => module_invoke('webform', 'help', 'admin/settings/webform#' . $component_name . '_description'),
      '#type' => 'checkbox',
      '#checked_value' => 1,
      '#default_value' => variable_get('webform_enable_' . $component_name, 1),
    );
  }
  $form['email'] = array(
    '#type' => 'fieldset',
    '#title' => t('Default E-mail Values'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['email']['webform_default_from_email'] = array(
    '#type' => 'textfield',
    '#title' => t("From e-mail address"),
    '#default_value' => variable_get('webform_default_from_email', variable_get('site_mail', ini_get('sendmail_from'))),
    '#description' => t('Default sender address. This may be the E-mail address of the maintainer of your forms. This is also used for Reply-To, Return-Path and Errors-To.'),
  );
  $form['email']['webform_default_from_name'] = array(
    '#type' => 'textfield',
    '#title' => t("From Name"),
    '#default_value' => variable_get('webform_default_from_name', variable_get('site_name', '')),
    '#description' => t('Default sender name which is displayed together with the E-mail address.'),
  );
  $form['email']['webform_default_subject'] = array(
    '#type' => 'textfield',
    '#title' => t("Default Subject"),
    '#default_value' => variable_get('webform_default_subject', t('Form submission from: ')),
    '#description' => t('Default Subject. If not other stated in the form configuration this is appended to your form title. If you have e.g. defined "Your " (note the space) as a default subject and a form titled with "Order" the e-mail subject will be "Your Order".'),
  );
  $form['advanced'] = array(
    '#type' => 'fieldset',
    '#title' => t('Advanced Options'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );
  $form['advanced']['webform_use_cookies'] = array(
    '#type' => 'checkbox',
    '#checked_value' => 1,
    '#title' => t("Allow Cookies for Tracking Submissions"),
    '#default_value' => variable_get("webform_use_cookies", 0),
    '#description' => t('<a href="http://www.wikipedia.org/wiki/HTTP_cookie">Cookies</a> can be used to help prevent the same user from repeatedly submitting a webform. This feature is not needed for limiting submissions per user, though it can increase accuracy in some situations. Besides cookies, webform also uses IP addresses and site usernames to prevent repeated submissions.'),
  );
  $form['advanced']['webform_debug'] = array(
    '#type' => 'select',
    '#title' => t("Webforms Debug"),
    '#default_value' => variable_get("webform_debug", 0),
    '#options' => array(
      0 => t("OFF"),
      1 => t("Log submissions"),
      2 => t("Full debug"),
    ),
    '#description' => t('Set this option to "Log submissions" to log all submissions in the watchdog. Set it to "Full debug" to print debug info on submission. You probably want to leave this option on "OFF".'),
  );
  return system_settings_form($form);
}