function views_ui_get_roles

Same name in other branches
  1. 7.x-3.x includes/admin.inc \views_ui_get_roles()

Get a list of roles in the system.

2 calls to views_ui_get_roles()
views_plugin_access_role::options_form in plugins/views_plugin_access_role.inc
Provide the default form for setting options.
views_plugin_access_role::summary_title in plugins/views_plugin_access_role.inc
Return a string to display as the clickable title for the access control.

File

includes/admin.inc, line 3605

Code

function views_ui_get_roles() {
    static $roles = NULL;
    if (!isset($roles)) {
        $roles = array();
        $result = db_query("SELECT r.rid, r.name FROM {role} r ORDER BY r.name");
        while ($obj = db_fetch_object($result)) {
            $roles[$obj->rid] = $obj->name;
        }
    }
    return $roles;
}