You are here

function salesforce_api_fieldmap_admin in Salesforce Suite 7.2

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

Displays an admin table for fieldmaps.

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

File

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

Code

function salesforce_api_fieldmap_admin() {

  // Define the header for the admin table.
  $header = array(
    t('Drupal object'),
    t('Salesforce object'),
    t('Automatic'),
    t('Description'),
    array(
      'data' => t('Operations'),
      'colspan' => 4,
    ),
  );
  $rows = $default_maps = $new_default_maps = array();
  $content = '';
  $maps = salesforce_api_salesforce_fieldmap_load_all();
  foreach ($maps as $map) {
    $rows[] = _salesforce_api_field_admin_format_row($map);
  }

  // Add a message if no objects have been mapped.
  if (count($rows) == 0) {
    $rows[] = array(
      array(
        'data' => t('You have not yet defined any fieldmaps.'),
        'colspan' => 7,
      ),
    );
  }
  return theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
}