You are here

function theme_salesforce_api_fieldmap_edit_form_table in Salesforce Suite 6.2

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

Themes the field associations on a fieldmap edit form into a table.

1 theme call to theme_salesforce_api_fieldmap_edit_form_table()
salesforce_api_fieldmap_edit_form in salesforce_api/salesforce_api.admin.inc
Displays the edit form for adding field associations to a fieldmap.

File

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

Code

function theme_salesforce_api_fieldmap_edit_form_table($form) {

  // Build the header array.
  $header = array();
  foreach (element_children($form['header']) as $element) {
    $header[] = drupal_render($form['header'][$element]);
  }

  // Build the rows array.
  $rows = array();
  foreach (element_children($form['rows']) as $element) {
    $rows[] = array(
      array(
        'data' => drupal_render($form['rows'][$element]['target']),
        'class' => 'target-cell',
      ),
      array(
        'data' => drupal_render($form['rows'][$element]['source']),
        'class' => 'source-cell',
      ),
      drupal_render($form['rows'][$element]['remove']),
    );
  }

  // Add a message if no rows were found.
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No fields set.'),
        'colspan' => 2,
      ),
    );
  }

  // Build the attributes array.
  $attributes = array();

  // Build the caption.
  $caption = NULL;
  if (isset($form['caption'])) {
    $caption = drupal_render($form['caption']);
  }
  return theme('table', $header, $rows, $attributes, $caption);
}