You are here

function salesforce_api_fieldmap_delete_form in Salesforce Suite 7

Same name and namespace in other branches
  1. 5.2 salesforce_api/salesforce_api.admin.inc \salesforce_api_fieldmap_delete_form()
  2. 6.2 salesforce_api/salesforce_api.admin.inc \salesforce_api_fieldmap_delete_form()
  3. 7.2 salesforce_api/salesforce_api.admin.inc \salesforce_api_fieldmap_delete_form()

Displays the confirm form for deleting a fieldmap.

1 string reference to 'salesforce_api_fieldmap_delete_form'
salesforce_api_menu in salesforce_api/salesforce_api.module
Implements hook_menu().

File

salesforce_api/salesforce_api.admin.inc, line 264
Contains the admin page callbacks for the Salesforce module, including forms for general settings and fieldmap administration.

Code

function salesforce_api_fieldmap_delete_form($form, &$form_state, $fieldmap) {

  // Load the fieldmap from the database.
  $map = salesforce_api_fieldmap_load($fieldmap);

  // Return to the admin page if the fieldmap did not exist.
  if (empty($map)) {
    drupal_set_message(t('That fieldmap does not exist.'), 'error');
    drupal_goto(SALESFORCE_PATH_FIELDMAPS);
  }
  $form = array();

  // Add the fieldmap to the form array.
  $form['fieldmap_index'] = array(
    '#type' => 'value',
    '#value' => $fieldmap,
  );

  // Build the description text for this fieldmap.
  $desc = t('Fieldmap @index maps Drupal %entity: %bundle to Salesforce %salesforce objects.', array(
    '@index' => $map['fieldmap'],
    '%entity' => $map['drupal_entity'],
    '%bundle' => $map['drupal_bundle'],
    '%salesforce' => $map['salesforce'],
  ));
  return confirm_form($form, t('Are you sure you want to delete this fieldmap?'), SALESFORCE_PATH_FIELDMAPS, $desc, t('Delete'));
}