You are here

function constant_contact_setup in Constant Contact 6.3

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

Displays the module setup page in the admin

1 string reference to 'constant_contact_setup'
constant_contact_menu in ./constant_contact.module
Adds an admin menu for the Cnstant Contact module

File

./admin.system.inc, line 270

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_auth_res'] = array(
    '#type' => 'markup',
    '#value' => '<div class="cc_auth_res">&nbsp;</div>',
  );
  $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['#redirect'] = 'admin/settings/constant_contact/intro';
  return system_settings_form($form);
}