You are here

function salesforce_admin_settings in Salesforce Suite 5

NO LONGER: Implementation of hook_settings(). CHANGEME!!! 4.7 to 5.x conversion: is now admin settings form function and not hook_settings implementation

1 string reference to 'salesforce_admin_settings'
salesforce_menu in ./salesforce.module
Implementation of hook_menu().

File

./salesforce.module, line 98
Original Creator, Maintainer & Developer: Steve McKenzie (http://drupal.org/user/45890) Drupal and Salesforce.com (mainly only working with contacts / leads but can be extended to do anything the salesforce API version 6 can do) Current…

Code

function salesforce_admin_settings() {
  drupal_set_title(t('SalesForce.com Settings'));
  _salesforce_settings();
  $form['salesforce_account'] = array(
    '#type' => 'fieldset',
    '#title' => t('SalesForce.com Account'),
    '#collapsible' => true,
    '#description' => t('this information is required for this module to work'),
  );
  $form['salesforce_account']['salesforce_user'] = array(
    '#type' => 'textfield',
    '#title' => t('Username'),
    '#default_value' => variable_get('salesforce_user', NULL),
    '#required' => true,
  );

  // TODO: need to encrypt / decrypt this
  if (!variable_get('salesforce_password', NULL)) {
    $form['salesforce_account']['salesforce_password'] = array(
      '#type' => 'password',
      '#title' => t('Password'),
      '#default_value' => variable_get('salesforce_password', NULL),
      '#required' => true,
    );
  }
  else {
    $form['salesforce_account']['salesforce_password_delete'] = array(
      '#prefix' => t('<strong>***** (TODO: setup like this until a better password saving feature can be implemented)</strong>'),
      '#type' => 'checkbox',
      '#title' => t('Delete Password'),
      '#default_value' => variable_get('salesforce_password_delete', false),
    );
  }
  $form['salesforce_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Additional Options'),
    '#collapsible' => true,
  );
  $form['salesforce_options']['salesforce_leads_create_forms'] = array(
    '#type' => 'textarea',
    '#title' => t('Create Leads on form processes'),
    '#description' => t('a new line for each form_id (drupal 5.0 will make this feature much easier as I will be able to generate a select box with the names of the forms)'),
    '#default_value' => SALESFORCE_LEADS_CREATE_FORMS,
  );
  $form['salesforce_options']['salesforce_events_create_forms'] = array(
    '#type' => 'textarea',
    '#title' => t('Create Events on form processes'),
    '#description' => t('a new line for each form_id | message (drupal 5.0 will make this feature much easier as I will be able to generate a select box with the names of the forms)'),
    '#default_value' => SALESFORCE_EVENTS_CREATE_FORMS,
  );

  //  4.7 to 5.x conversion:
  //  return $form;
  return system_settings_form($form);
}