You are here

function uc_addresses_settings_form in Ubercart Addresses 7

Same name and namespace in other branches
  1. 5.2 uc_addresses.module \uc_addresses_settings_form()
  2. 5 uc_addresses.module \uc_addresses_settings_form()
  3. 6.2 uc_addresses.admin.inc \uc_addresses_settings_form()
  4. 6 uc_addresses.admin.inc \uc_addresses_settings_form()

Module settings form.

1 string reference to 'uc_addresses_settings_form'
uc_addresses_menu in ./uc_addresses.module
Implements hook_menu().

File

./uc_addresses.admin.inc, line 15
Admin settings for Ubercart Addresses.

Code

function uc_addresses_settings_form($form, &$form_state) {
  $form['uc_addresses'] = array(
    '#type' => 'fieldset',
    '#title' => t('Ubercart Addresses settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['uc_addresses']['uc_addresses_use_address_name'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use address nicknames'),
    '#description' => t('When checked, users can optionally give an address a name (e.g. "work", "mary", "joe").'),
    '#default_value' => variable_get('uc_addresses_use_address_name', TRUE),
  );
  $form['uc_addresses']['uc_addresses_use_default_billing'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default billing addresses'),
    '#description' => t('Note that addresses marked as default billing cannot be deleted.'),
    '#default_value' => variable_get('uc_addresses_use_default_billing', TRUE),
  );
  $form['uc_addresses']['uc_addresses_use_default_shipping'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use default shipping addresses'),
    '#description' => t('Note that addresses marked as default shipping cannot be deleted.'),
    '#default_value' => variable_get('uc_addresses_use_default_shipping', TRUE),
  );
  $form['checkout'] = array(
    '#type' => 'fieldset',
    '#title' => t('Checkout settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['checkout']['uc_addresses_default_billing_address'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically fill in the billing address with the user\'s default billing address.'),
    '#description' => t('Note that %use-default-setting must be activated for this setting to have effect.', array(
      '%use-default-setting' => $form['uc_addresses']['uc_addresses_use_default_billing']['#title'],
    )),
    '#default_value' => variable_get('uc_addresses_default_billing_address', TRUE),
  );
  $form['checkout']['uc_addresses_default_shipping_address'] = array(
    '#type' => 'checkbox',
    '#title' => t('Automatically fill in the delivery address with the user\'s default shipping address.'),
    '#description' => t('Note that %use-default-setting must be activated for this setting to have effect.', array(
      '%use-default-setting' => $form['uc_addresses']['uc_addresses_use_default_shipping']['#title'],
    )),
    '#default_value' => variable_get('uc_addresses_default_shipping_address', TRUE),
  );
  $form['user'] = array(
    '#type' => 'fieldset',
    '#title' => t('User settings'),
    '#collapsible' => FALSE,
    '#collapsed' => FALSE,
  );
  $form['user']['uc_addresses_require_address'] = array(
    '#type' => 'checkbox',
    '#title' => t('Require that an address be entered during registration'),
    '#default_value' => variable_get('uc_addresses_require_address', TRUE),
  );
  $form['user']['uc_addresses_require_address_admin'] = array(
    '#type' => 'checkbox',
    '#title' => t('Require admins to enter an address upon user creation'),
    '#description' => t('When checked, users with the permission %administer-users need to enter an address when they create a new user.', array(
      '%administer-users' => t('administer users'),
    )),
    '#default_value' => variable_get('uc_addresses_require_address_admin', TRUE),
  );
  return system_settings_form($form);
}