You are here

public function Role::summaryTitle in Views (for Drupal 7) 8.3

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

Overrides AccessPluginBase::summaryTitle

File

lib/Views/user/Plugin/views/access/Role.php, line 40
Definition of Views\user\Plugin\views\access\Role.

Class

Role
Access plugin that provides role-based access control.

Namespace

Views\user\Plugin\views\access

Code

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