function node_view_count_get_excluded_user_roles in Node view count 7
Same name and namespace in other branches
- 7.3 includes/pages/nodeviewcount.admin.inc \node_view_count_get_excluded_user_roles()
- 7.2 includes/pages/nodeviewcount.admin.inc \node_view_count_get_excluded_user_roles()
Get excluded user roles options.
Return value
array Associative array of user roles.
1 call to node_view_count_get_excluded_user_roles()
- nodeviewcount_admin_settings_form in includes/
pages/ nodeviewcount.admin.inc - Nodeviewcount admin form.
File
- includes/
pages/ nodeviewcount.admin.inc, line 155
Code
function node_view_count_get_excluded_user_roles() {
$options = array();
// Counting user roles.
$counting_user_roles = variable_get('nodeviewcount_user_roles', array());
// All user roles on site.
$user_roles = user_roles();
foreach ($user_roles as $key => $user_role) {
if (empty($counting_user_roles[$key])) {
$options[$key] = $user_role;
}
}
return $options;
}