function theme_salesforce_api_fieldmap_edit_form_table in Salesforce Suite 7
Same name and namespace in other branches
- 5.2 salesforce_api/salesforce_api.admin.inc \theme_salesforce_api_fieldmap_edit_form_table()
- 6.2 salesforce_api/salesforce_api.admin.inc \theme_salesforce_api_fieldmap_edit_form_table()
- 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 479 - 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($variables) {
$form = $variables['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(
drupal_render($form['rows'][$element]['target']),
array(
'data' => drupal_render($form['rows'][$element]['source']),
'class' => 'source-cell',
),
);
}
// Add a message if no rows were found.
if (empty($rows)) {
$rows[] = array(
array(
'data' => t('There are no fields of this type to 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', array(
'header' => $header,
'rows' => $rows,
'attributes' => $attributes,
'caption' => $caption,
));
}