You are here

function constant_contact_setup in Constant Contact 7.3

Same name and namespace in other branches
  1. 6.3 admin.system.inc \constant_contact_setup()

Form builder for the module setup form.

1 string reference to 'constant_contact_setup'
constant_contact_menu in ./constant_contact.module
Implements hook_menu().

File

./admin.system.inc, line 220
Main admin functions.

Code

function constant_contact_setup() {
  drupal_add_js(drupal_get_path('module', 'constant_contact') . '/constant_contact.js');
  $form = array();

  // Account settings.
  $form['constant_contact']['account'] = array(
    '#type' => 'fieldset',
    '#title' => t('Account Settings'),
    '#tree' => FALSE,
    '#description' => t('Change your constant contact account username and password'),
  );
  $form['constant_contact']['account']['cc_username'] = array(
    '#id' => 'cc_username',
    '#type' => 'textfield',
    '#title' => t('Username'),
    '#description' => t("The Constant Contact Account Username"),
    '#default_value' => variable_get('cc_username', ''),
    '#size' => 60,
    '#required' => TRUE,
  );
  $form['constant_contact']['account']['cc_password'] = array(
    '#id' => 'cc_password',
    '#type' => 'password',
    '#title' => t('Password'),
    '#description' => t("The Constant Contact Account Password"),
    '#default_value' => variable_get('cc_password', ''),
    '#size' => 60,
    '#required' => TRUE,
  );
  $form['constant_contact']['account']['cc_path'] = array(
    '#id' => 'cc_path',
    '#type' => 'hidden',
    '#value' => drupal_get_path('module', 'constant_contact'),
  );
  $form['constant_contact']['account']['cc_auth'] = array(
    '#id' => 'cc_auth',
    '#type' => 'submit',
    '#value' => t('Check Account Details'),
  );
  $form['constant_contact']['account']['cc_auth_res'] = array(
    '#type' => 'markup',
    '#markup' => '<div class="cc_auth_res">&nbsp;</div>',
  );
  $form['#submit'][] = 'constant_contact_setup_submit';
  $form['#redirect'] = 'admin/config/services/constant_contact/settings';
  return system_settings_form($form);
}