You are here

function workflow_get_roles in Workflow 5

Same name and namespace in other branches
  1. 5.2 workflow.module \workflow_get_roles()
  2. 6.2 workflow.module \workflow_get_roles()
  3. 6 workflow.module \workflow_get_roles()
  4. 7.2 workflow.module \workflow_get_roles()

Function to get a list of roles. Used kind of often.

3 calls to workflow_get_roles()
theme_workflow_edit_form in ./workflow.module
workflow_edit_form in ./workflow.module
workflow_transition_grid_form in ./workflow.module
Build the grid of transitions for defining a workflow.

File

./workflow.module, line 1792

Code

function workflow_get_roles() {
  static $roles = NULL;
  if (!$roles) {
    $result = db_query('SELECT * FROM {role} ORDER BY name');
    $roles = array(
      'author' => 'author',
    );
    while ($data = db_fetch_object($result)) {
      $roles[$data->rid] = $data->name;
    }
  }
  return $roles;
}