You are here

function views_plugin_access_role::summary_title in Views (for Drupal 7) 6.3

Same name and namespace in other branches
  1. 6.2 plugins/views_plugin_access_role.inc \views_plugin_access_role::summary_title()
  2. 7.3 plugins/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

plugins/views_plugin_access_role.inc, line 15

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');
  }
  else {
    if ($count > 1) {
      return t('Multiple roles');
    }
    else {
      $rids = views_ui_get_roles();
      $rid = reset($this->options['role']);
      return $rids[$rid];
    }
  }
}