You are here

function _biblio_admin_build_user_select in Bibliography Module 6

Same name and namespace in other branches
  1. 5 biblio.module \_biblio_admin_build_user_select()
  2. 6.2 includes/biblio.import.export.inc \_biblio_admin_build_user_select()
  3. 7 includes/biblio.import.export.inc \_biblio_admin_build_user_select()
  4. 7.2 includes/biblio.import.export.inc \_biblio_admin_build_user_select()

Return a form select box populated with all the users of the site.

Parameters

$my_uid: The user id of the person accessing the form so the select box defaults to their userid

Return value

An array which will be used by the form builder to add a select box to a form

1 call to _biblio_admin_build_user_select()
biblio_import_form in ./biblio.import.export.inc
Return a form used to import files into biblio.

File

./biblio.import.export.inc, line 36
Functions that are used to import and export biblio data.

Code

function _biblio_admin_build_user_select($my_uid) {
  $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.mail FROM {users} u  WHERE u.uid != 0 ';
  $result = db_query($sql);
  while ($user = db_fetch_object($result)) {
    $users[$user->uid] = $user->name . " ({$user->mail})";
  }
  asort($users);
  $select = array(
    '#type' => 'select',
    '#title' => t("Set user ID of entries in this file to"),
    '#options' => $users,
    '#default_value' => $my_uid,
    '#disabled' => user_access('administer biblio') ? FALSE : TRUE,
  );
  return $select;
}