You are here

function select_registration_roles_all_roles in Select registration roles 8

Get all Roles.

Return value

array $all_roles

1 call to select_registration_roles_all_roles()
SelectRegistrationConfigForm::buildForm in src/Form/SelectRegistrationConfigForm.php
Form constructor.

File

./select_registration_roles.module, line 6

Code

function select_registration_roles_all_roles($membersonly = TRUE) {
  $roles = user_roles($membersonly);
  $all_roles = array();
  unset($roles[DRUPAL_AUTHENTICATED_RID]);
  foreach ($roles as $role_id => $role) {
    $all_roles[$role_id] = $role
      ->label();
  }
  return $all_roles;
}