You are here

public function SimpleAccessViewsAccess::summaryTitle in Simple Access 8.3

Returns the summary of the settings in the display.

Overrides AccessPluginBase::summaryTitle

File

src/views/access/SimpleAccessViewsAccess.php, line 55

Class

SimpleAccessViewsAccess
Plugin annotation @ViewsAccess( id = "simple_access_group", title = @Translation("Simple Access Group"), help = @Translation("Will be available to all users.") )

Namespace

Drupal\simple_access\views\access

Code

public function summaryTitle() {
  $count = count($this->options['groups']);
  if ($count < 1) {
    return t('No group(s) selected');
  }
  elseif ($count > 1) {
    return t('Multiple groups');
  }
  else {
    $gids = array_map([
      'simple_access_views_plugin_group',
      '_map_groups',
    ], simple_access_get_groups());
    $gid = array_shift($this->options['groups']);
    return $gids[$gid];
  }
}