function _biblio_admin_build_user_select in Bibliography Module 7
Same name and namespace in other branches
- 5 biblio.module \_biblio_admin_build_user_select()
- 6.2 includes/biblio.import.export.inc \_biblio_admin_build_user_select()
- 6 biblio.import.export.inc \_biblio_admin_build_user_select()
- 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 includes/
biblio.import.export.inc - Return a form used to import files into biblio.
File
- includes/
biblio.import.export.inc, line 38 - 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);
foreach ($result as $user) {
$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;
}