You are here

function user_node_import_options in Node import 6

Implementation of hook_node_import_options().

File

supported/user.inc, line 152
Support file for the core user module.

Code

function user_node_import_options($type, $options, $fields, $map) {
  $form = array();
  if ($type === 'user') {
    $options = array(
      'never' => t('Treat records without password as an error'),
      'always' => t('Generate password for each record (even if set in the file)'),
      'empty' => t('Generate password for records with empty password'),
    );
    $default = isset($map['pass']) && strlen($map['pass']) > 0 ? 'empty' : 'never';
    $form['generate_pass'] = array(
      '#type' => 'radios',
      '#title' => t('Password'),
      '#options' => $options,
      '#default_value' => isset($options['generate_pass']) ? $options['generate_pass'] : $default,
    );
  }
  return $form;
}