You are here

protected function UserActivity::_getHeader in Visitors 8.2

Returns a table header configuration.

Return value

array A render array representing the table header info.

1 call to UserActivity::_getHeader()
UserActivity::display in src/Controller/Report/UserActivity.php
Returns a user activity page.

File

src/Controller/Report/UserActivity.php, line 82
Contains Drupal\visitors\Controller\Report\UserActivity.

Class

UserActivity

Namespace

Drupal\visitors\Controller\Report

Code

protected function _getHeader() {
  $headers = array(
    '#' => array(
      'data' => t('#'),
    ),
    'u.name' => array(
      'data' => t('User'),
      'field' => 'u.name',
      'specifier' => 'u.name',
      'class' => array(
        RESPONSIVE_PRIORITY_LOW,
      ),
    ),
    'hits' => array(
      'data' => t('Hits'),
      'field' => 'hits',
      'specifier' => 'hits',
      'class' => array(
        RESPONSIVE_PRIORITY_LOW,
      ),
      'sort' => 'desc',
    ),
    'nodes' => array(
      'data' => t('Nodes'),
      'field' => 'nodes',
      'specifier' => 'nodes',
      'class' => array(
        RESPONSIVE_PRIORITY_LOW,
      ),
    ),
  );
  if (\Drupal::moduleHandler()
    ->moduleExists('comment')) {
    $headers['comments'] = array(
      'data' => t('Comments'),
      'field' => 'comments',
      'specifier' => 'comments',
      'class' => array(
        RESPONSIVE_PRIORITY_LOW,
      ),
    );
  }
  return $headers;
}