Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

webform_admin_settings

Definition

webform_admin_settings()
contributions/webform/webform.module, line 1012

Description

Menu callback for admin/webform/settings.

Code

<?php
function webform_admin_settings() {
  $form['components'] = array(
    '#type' => 'fieldset',
    '#title' => t('Available components'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#description' => t('These are the available field types for your installation of 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_address']  = array(
    '#type' => 'textfield',
    '#title' => t("From address"),
    '#default_value' => variable_get('webform_default_from_address', variable_get('site_mail', ini_get('sendmail_from'))),
    '#description' => t('The default sender address for emailed webform results; often the e-mail address of the maintainer of your forms.'),
  );

  $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('The default sender name which is used along with the default from address.'),
  );

  $form['email']['webform_default_subject']  = array(
    '#type' => 'textfield',
    '#title' => t("Default subject"),
    '#default_value' => variable_get('webform_default_subject', t('Form submission from: [title]')),
    '#description' => t('The default subject line of any e-mailed results.'),
  );

  $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 to "Log submissions" to log all submissions in the watchdog. Set to "Full debug" to print debug info on submission.')
  );
  return system_settings_form($form);
}
?>