function finder_user_get_roles in Finder 6
Same name and namespace in other branches
- 7 modules/finder_user/finder_user.module \finder_user_get_roles()
Get an array of user roles for use in select forms.
1 call to finder_user_get_roles()
- finder_user_form_finder_admin_element_edit_alter in modules/
finder_user/ finder_user.module - Implementation of hook_form_FORM_ID_alter().
File
- modules/
finder_user/ finder_user.module, line 114 - The finder user module.
Code
function finder_user_get_roles() {
$roles = array();
$roles[''] = t('- all -');
// this is the 'select none' option in the form
$user_roles = user_roles();
foreach ($user_roles as $rid => $role) {
$roles[$rid] = $role;
}
if (count($roles) === 1) {
return FALSE;
}
return $roles;
}