You are here

function node_view_count_get_user_roles in Node view count 7

Same name and namespace in other branches
  1. 7.3 includes/pages/nodeviewcount.admin.inc \node_view_count_get_user_roles()
  2. 7.2 includes/pages/nodeviewcount.admin.inc \node_view_count_get_user_roles()

Get user roles options.

Return value

array Associative array of user roles.

1 call to node_view_count_get_user_roles()
nodeviewcount_admin_settings_form in includes/pages/nodeviewcount.admin.inc
Nodeviewcount admin form.

File

includes/pages/nodeviewcount.admin.inc, line 135

Code

function node_view_count_get_user_roles() {
  $options = array();

  //Excluded user roles.
  $excluded_user_roles = variable_get('nodeviewcount_excluded_user_roles', array());

  // All user roles on site.
  $user_roles = user_roles();
  foreach ($user_roles as $key => $user_role) {
    if (empty($excluded_user_roles[$key])) {
      $options[$key] = $user_role;
    }
  }
  return $options;
}