function uif_plus_get_field_info in User Import Framework Plus 7
Create array of field info of supported fields and uif plus data for the later process of import
Parameters
type $header:
Return value
boolean
1 call to uif_plus_get_field_info()
- uif_plus_update_user in ./
uif_plus.module - Common function for updating users based on types of fields as provided by contrib modules.
File
- ./
uif_plus.module, line 400 - Advanced user import from a CSV file.
Code
function uif_plus_get_field_info($header) {
$field_info = array();
$instance_fields = uif_plus_profile2_fields();
$supported_fields = uif_get_supported_fields();
foreach ($header as $label) {
switch (TRUE) {
case count($instance_fields) && isset($instance_fields[$label]):
$data = uif_field_info_field($label);
$supported = uif_is_supported_field($data['type']);
$field_info[$label] = array(
'type' => 'entity',
'supported' => $supported,
'data' => $data,
);
if ($supported) {
$field_info[$label]['import'] = $supported_fields[$data['type']];
}
break;
case $label == 'picture':
$supported = uif_is_supported_field($label);
$users_table = drupal_get_schema('users');
$field_info[$label] = array(
'type' => 'core',
'supported' => $supported,
'data' => $users_table['fields'][$label],
);
if ($supported) {
$field_info[$label]['import'] = $supported_fields[$label];
}
break;
case in_array($label, array(
'groups',
'addressfield',
)):
$supported = uif_is_supported_field($label);
$field_info[$label] = array(
'type' => 'custom',
'supported' => $supported,
'data' => $label,
);
if ($supported) {
$field_info[$label]['import'] = $supported_fields[$label];
}
break;
default:
$field_info[$label] = array(
'type' => 'unknown',
'supported' => FALSE,
);
break;
}
}
return $field_info;
}