1 views_plugin_access_role.inc views_plugin_access_role::summary_title()

Return a string to display as the clickable title for the access control.

Overrides views_plugin_access::summary_title

File

core/modules/views/plugins/views_plugin_access_role.inc, line 21
Definition of views_plugin_access_role.

Class

views_plugin_access_role
Access plugin that provides role-based access control.

Code

function summary_title() {
  $count = count($this->options['role']);
  if ($count < 1) {
    return t('No role(s) selected');
  }
  elseif ($count > 1) {
    return t('Multiple roles');
  }
  else {
    $roles = user_roles();
    $role_name = reset($this->options['role']);
    return check_plain($roles[$role_name]);
  }
}