You are here

function _salesforce_mapping_get_drupal_type_options in Salesforce Suite 7.3

Helper to generate a list of fieldtypes for Drupal fields.

Parameters

bool $include_select: Choice to choose a select option or not. If TRUE, the first item will be "-- Select --". If FALSE, the first item will be the first item of the retreived fields. Defaults to TRUE.

Return value

array An array of values keyed by machine name of the fieldmap type with the label as the value, formatted to be appropriate as a value for #options.

1 call to _salesforce_mapping_get_drupal_type_options()
salesforce_mapping_form in modules/salesforce_mapping/includes/salesforce_mapping.admin.inc
Return a form for a Salesforce mapping entity.

File

modules/salesforce_mapping/includes/salesforce_mapping.admin.inc, line 1134
Configuration page for creating and modifying a mapping.

Code

function _salesforce_mapping_get_drupal_type_options($include_select = TRUE) {
  $types = salesforce_mapping_get_fieldmap_types();
  $drupal_type_options = array();
  if ($include_select) {
    $drupal_type_options[''] = '- ' . t('Select Drupal field type') . ' -';
  }
  foreach ($types as $key => $fieldmap_type) {
    $drupal_type_options[$key] = $fieldmap_type['label'];
  }
  return $drupal_type_options;
}