function workflow_get_roles in Workflow 6
Same name and namespace in other branches
- 5.2 workflow.module \workflow_get_roles()
- 5 workflow.module \workflow_get_roles()
- 6.2 workflow.module \workflow_get_roles()
- 7.2 workflow.module \workflow_get_roles()
Get a list of roles.
Return value
Array of role names keyed by role ID, including the 'author' role.
3 calls to workflow_get_roles()
- theme_workflow_admin_ui_edit_form in workflow_admin_ui/
workflow_admin_ui.module - Theme the workflow editing form.
- workflow_admin_ui_edit_form in workflow_admin_ui/
workflow_admin_ui.module - Menu callback. Edit a workflow's properties.
- workflow_admin_ui_transition_grid_form in workflow_admin_ui/
workflow_admin_ui.module - Form builder. Build the grid of transitions for defining a workflow.
File
- ./
workflow.module, line 1074 - Support workflows made up of arbitrary states.
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] = check_plain($data->name);
}
}
return $roles;
}