You are here

function theme_uif_preview_one_user in User Import Framework 6

Same name and namespace in other branches
  1. 7 uif.admin.inc \theme_uif_preview_one_user()

Theme preview of a single user.

1 theme call to theme_uif_preview_one_user()
theme_uif_preview_users in ./uif.admin.inc
Theme preview of all users.

File

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

Code

function theme_uif_preview_one_user($user_data) {
  $rows = array();
  foreach ($user_data as $field => $value) {
    $rows[] = array(
      $field,
      $value,
    );
  }
  $user_exists = db_result(db_query("SELECT count(*) FROM {users} WHERE mail='%s'", $user_data['email']));
  $annotation = $user_exists ? t('update') : t('create');
  $heading = $user_data['email'] . ' (' . $annotation . ')';
  return '<h3>' . $heading . '</h3>' . theme('table', NULL, $rows);
}