function 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 4906

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");
        foreach ($result as $obj) {
            $roles[$obj->rid] = $obj->name;
        }
    }
    return $roles;
}