You are here

function uif_uif_supported_fields in User Import Framework 7

Implementation of hook_uif_supported_fields().

Provide out-of-box supported fields.

File

./uif.admin.inc, line 895
Simple, extensible user import from a CSV file.

Code

function uif_uif_supported_fields() {
  $subs = array(
    '@strtotime_url' => 'http://php.net/manual/en/function.strtotime.php',
    '@tz_url' => url('admin/config/regional/settings'),
    '@mods_url' => url('admin/modules'),
    '@flds_url' => url('admin/config/people/accounts/fields'),
  );
  return array(
    'mail' => array(
      'type' => 'core',
      'required' => TRUE,
      'description' => t('the user\'s email address'),
    ),
    'name' => array(
      'type' => 'core',
      'description' => t('a name for the user. If not provided, a name is created based on the email.'),
    ),
    'pass' => array(
      'type' => 'core',
      'description' => t('a password for the user. If not provided, a password is generated.'),
    ),
    'roles' => array(
      'type' => 'core',
      'description' => t('roles for the user as delimited text, e.g. "admin|editor" (without quotes).'),
    ),
    'created' => array(
      'type' => 'core',
      'description' => t('the creation date for the user in <a href="@strtotime_url">strtotime()</a> format.', $subs),
      'parser' => 'uif_get_strtotime_value',
    ),
    'access' => array(
      'type' => 'core',
      'description' => t('the last access date for the user in <a href="@strtotime_url">strtotime()</a> format.', $subs),
      'parser' => 'uif_get_strtotime_value',
    ),
    'login' => array(
      'type' => 'core',
      'description' => t('the last login date for the user in <a href="@strtotime_url">strtotime()</a> format.', $subs),
      'parser' => 'uif_get_strtotime_value',
    ),
    'status' => array(
      'type' => 'core',
      'description' => t('the account status (1 = active (default) 0 = blocked).'),
    ),
    'timezone' => array(
      'type' => 'core',
      'description' => t('the time zone to use for this user. You should <a href="@tz_url">let users set their time zone</a> if you import this.', $subs),
    ),
    'language' => array(
      'type' => 'core',
      'description' => t('the language to use for this user. You should <a href="@mods_url">enable the locale module</a> if you import this.', $subs),
    ),
    'uid' => array(
      'type' => 'core',
      'description' => t('the uid of the user (experts only; use mail as unique key, not uid)'),
    ),
    'list_boolean' => array(
      'type' => 'entity',
      'label' => t('Boolean'),
      'description' => t('true/false. Use 0 for false, 1 for true.'),
    ),
    'number_float' => array(
      'type' => 'entity',
      'label' => t('Float'),
      'description' => t('floating point number'),
    ),
    'number_decimal' => array(
      'type' => 'entity',
      'label' => t('Decimal'),
      'description' => t('decimal number'),
    ),
    'number_integer' => array(
      'type' => 'entity',
      'label' => t('Integer'),
      'description' => t('integer number'),
    ),
    'list_float' => array(
      'type' => 'entity',
      'label' => t('List (float)'),
      'description' => t('list of floating point values'),
    ),
    'list_integer' => array(
      'type' => 'entity',
      'label' => t('List (integer)'),
      'description' => t('list of integers'),
    ),
    'list_text' => array(
      'type' => 'entity',
      'label' => t('List (text)'),
      'description' => t('list of text values'),
    ),
    'text' => array(
      'type' => 'entity',
      'label' => t('Text'),
      'description' => t('text'),
    ),
    'text_long' => array(
      'type' => 'entity',
      'label' => t('Long text'),
      'description' => t('long text'),
    ),
    'text_with_summary' => array(
      'type' => 'entity',
      'label' => t('Long text and summary'),
      'description' => t('long text and summary'),
    ),
    'taxonomy_term_reference' => array(
      'type' => 'entity',
      'label' => t('Taxonomy term reference'),
      'parser' => 'uif_get_taxonomy_value',
      'key' => 'tid',
      'description' => t('taxonomy term ID or name'),
    ),
  );
}