function theme_user_import_errors_display in User Import 7.3
Same name and namespace in other branches
- 8 user_import.module \theme_user_import_errors_display()
- 5.2 user_import.module \theme_user_import_errors_display()
- 5 user_import.module \theme_user_import_errors_display()
- 6.4 user_import.module \theme_user_import_errors_display()
- 6.2 user_import.module \theme_user_import_errors_display()
- 7 user_import.module \theme_user_import_errors_display()
- 7.2 user_import.module \theme_user_import_errors_display()
2 theme calls to theme_user_import_errors_display()
File
- ./
user_import.module, line 452 - Import or update users with data from a comma separated file (csv).
Code
function theme_user_import_errors_display($settings) {
$output = '';
$header[0] = t('Email Address');
$data = $settings['file_lines'];
$total = $settings['total'];
$oldfilename = $settings['import']['oldfilename'];
$field_match = $settings['import']['field_match'];
$error_count = 0;
$field_match = _user_import_unconcatenate_field_match($field_match);
foreach ($data as $data_row) {
$row = array();
foreach ($data_row['data'] as $type => $fields) {
if (!empty($fields)) {
foreach ($fields as $field_id => $field_data) {
foreach ($field_match as $column_info) {
if ($column_info['type'] == $type && $column_info['field_id'] == $field_id) {
if (!empty($column_info['username'])) {
$header[$column_info['username']] = t('Name %sort', array(
'%sort' => $column_info['username'],
));
$row[$column_info['username']] = array(
"data" => $field_data[0],
"align" => "left",
);
}
if ($column_info['field_id'] == 'email') {
$row[0] = array(
"data" => $field_data[0],
"align" => "left",
);
}
}
}
}
}
}
ksort($row);
$row[] = implode('<br />', $data_row['errors']);
$rows[] = $row;
}
$output .= '<p>' . t('<strong>CSV File:</strong> %file', array(
'%file' => $oldfilename,
)) . '<br />';
$output .= t('<strong>Errors:</strong> !total', array(
'!total' => $total,
)) . '</p>';
$header['errors'] = t('Errors');
// Output of table with the paging
$output .= theme('table', array(
"header" => $header,
"rows" => $rows,
"attributes" => array(),
"sticky" => FALSE,
// Table header will be sticky
"caption" => '',
"colgroups" => array(),
"empty" => t("There are no errors."),
)) . theme("pager");
//$output .= theme('table', array('header' => $header, 'rows' => $rows));
return $output;
}