function views_ui_get_roles in Views (for Drupal 7) 6.2
Same name and namespace in other branches
- 6.3 includes/admin.inc \views_ui_get_roles()
- 7.3 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
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;
}