You are here

function uif_batch_import_users_finished in User Import Framework 7

Same name and namespace in other branches
  1. 6 uif.admin.inc \uif_batch_import_users_finished()

User import batch completion.

1 string reference to 'uif_batch_import_users_finished'
uif_batch_import_users in ./uif.admin.inc
Batch import all users.

File

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

Code

function uif_batch_import_users_finished($success, $results, $operations) {
  if ($success) {
    global $user;
    if (isset($results['self'])) {
      uif_update_user($results['self'], $user->uid);
      $results['updated']++;
      unset($results['self']);
    }
    $done = t('User import complete.');
    $created = $results['created'] ? ' ' . format_plural($results['created'], 'One user was created.', '@count users were created.') . ' ' : '';
    $updated = $results['updated'] ? ' ' . format_plural($results['updated'], 'One user was updated.', '@count users were updated.') . ' ' : '';
    $more = t('View the <a href="@url">user list</a>.', array(
      '@url' => url('admin/people'),
    ));
    drupal_set_message($done . $created . $updated . $more);
  }
  else {
    drupal_set_message(t('An error occurred and processing did not complete.'), 'error');
  }
}