You are here

function _rolereference_get_roles in Role Reference 5

Return an array of all roles

2 calls to _rolereference_get_roles()
rolereference_field_formatter in ./rolereference.module
Implementation of hook_field_formatter().
rolereference_widget in ./rolereference.module
Implementation of hook_widget().

File

./rolereference.module, line 40
Defines a field type for referencing a role.

Code

function _rolereference_get_roles() {
  $roles_list = array();
  $result = db_query('SELECT rid, name FROM {role} ORDER BY name');
  while ($obj = db_fetch_object($result)) {
    $roles_list[$obj->rid] = t($obj->name);
  }
  return $roles_list;
}