You are here

public function SubscriptionListBuilder::buildHeader in Mailing List 8

Builds the header row for the entity listing.

Return value

array A render array structure of header strings.

Overrides EntityListBuilder::buildHeader

See also

\Drupal\Core\Entity\EntityListBuilder::render()

File

src/SubscriptionListBuilder.php, line 80

Class

SubscriptionListBuilder
Defines a class to build a listing of subscriptions.

Namespace

Drupal\mailing_list

Code

public function buildHeader() {
  $header = [
    'title' => [
      'data' => $this
        ->t('Title'),
      'class' => [
        RESPONSIVE_PRIORITY_MEDIUM,
      ],
    ],
    'list' => $this
      ->t('Mailing list'),
    'email' => $this
      ->t('Email'),
  ];
  if ($this->currentUser
    ->hasPermission('administer mailing list subscriptions')) {
    $header += [
      'author' => [
        'data' => $this
          ->t('Author'),
        'class' => [
          RESPONSIVE_PRIORITY_LOW,
        ],
      ],
      'status' => $this
        ->t('Status'),
      'changed' => [
        'data' => $this
          ->t('Updated'),
        'class' => [
          RESPONSIVE_PRIORITY_LOW,
        ],
      ],
    ];
  }
  return $header + parent::buildHeader();
}