You are here

function field_user_import_form_field_match in User Import 7.3

Same name and namespace in other branches
  1. 8 supported/field.inc \field_user_import_form_field_match()
  2. 7 supported/field.inc \field_user_import_form_field_match()
  3. 7.2 supported/field.inc \field_user_import_form_field_match()

Implementation of hook_user_import_form_field_match().

File

supported/field.inc, line 6

Code

function field_user_import_form_field_match() {
  $options = array();
  $supported_field_types = field_user_import_supported_fields();
  $fields_info = field_info_instances('user', 'user');
  foreach ($fields_info as $field_name => $value) {
    $field_info = field_info_field($field_name);
    $type = $field_info['type'];
    if (isset($supported_field_types[$type])) {
      $options['field'][$field_name] = $value['label'];
    }
    else {
      drupal_set_message(t('Field %field is not supported', array(
        '%field' => $value['label'],
      )), 'warning');
    }
  }
  return $options;
}