function user_import_add_file_form in User Import 5.2
Same name and namespace in other branches
- 8 user_import.admin.inc \user_import_add_file_form()
- 5 user_import.module \user_import_add_file_form()
- 6.4 user_import.admin.inc \user_import_add_file_form()
- 6.2 user_import.admin.inc \user_import_add_file_form()
- 7 user_import.admin.inc \user_import_add_file_form()
- 7.2 user_import.admin.inc \user_import_add_file_form()
2 calls to user_import_add_file_form()
File
- ./
user_import.module, line 645 - Import users from a comma separated file (csv).
Code
function user_import_add_file_form(&$form, $ftp_files = NULL) {
$form['browser'] = array(
'#type' => 'fieldset',
'#title' => t('Browser Upload'),
'#collapsible' => TRUE,
'#description' => t("Upload a CSV file."),
);
if (function_exists('file_upload_max_size')) {
$file_size = t('Maximum file size: !size MB.', array(
'!size' => file_upload_max_size(),
));
}
$form['browser']['file_upload'] = array(
'#type' => 'file',
'#title' => t('CSV File'),
'#size' => 40,
'#description' => t('Select the CSV file to be imported. ') . $file_size,
);
if (!empty($ftp_files)) {
$form['ftp'] = array(
'#type' => 'fieldset',
'#title' => t('FTP Upload'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#description' => t("Any files uploaded to the 'user_import' directory using FTP can be selected for import here. Useful if the import file is too large for upload via the browser."),
);
$form['ftp']['file_ftp'] = array(
'#type' => 'radios',
'#title' => t('Files'),
'#default_value' => 0,
'#options' => $ftp_files,
);
$form['ftp']['scan'] = array(
'#type' => 'button',
'#value' => t('Check for new files'),
);
}
return;
}