You are here

user_csv_import.module in User CSV import 2.0.x

Same filename and directory in other branches
  1. 8 user_csv_import.module
  2. 1.0.x user_csv_import.module

Import users into Drupal from CSV file upload.

File

user_csv_import.module
View source
<?php

/**
 * @file
 * Import users into Drupal from CSV file upload.
 */
use Drupal\Core\Routing\RouteMatchInterface;

/**
 * Implements hook_help().
 */
function user_csv_import_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {
    case 'help.page.user_csv_import':
      $output = '';
      $output .= '<h3>' . t('About') . '</h3>';
      $output .= '<p>' . t('This module allows uploading CSV files from where extract the data and create new user account with the information contained in the file. In addition, it allows selecting which fields will be filled with the information extracted.') . '</p>';
      return $output;
  }
}

/**
 * Implements hook_form_alter().
 */
function user_csv_import_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'user_csv_import_form') {
    $form['#attached']['library'][] = 'user_csv_import/user_csv_import.admin_upload';
  }
}

Functions