You are here

public function RateWidgetListBuilder::buildHeader in Rate 8.2

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/RateWidgetListBuilder.php, line 18

Class

RateWidgetListBuilder
Defines a class to build a listing of rate widget entities.

Namespace

Drupal\rate

Code

public function buildHeader() {
  $header['label'] = $this
    ->t('Name');
  $header['id'] = [
    'data' => $this
      ->t('Machine name'),
    'class' => [
      RESPONSIVE_PRIORITY_LOW,
    ],
  ];
  $header['template'] = [
    'data' => $this
      ->t('Template'),
  ];
  $header['value_type'] = [
    'data' => $this
      ->t('Value type'),
    'class' => [
      RESPONSIVE_PRIORITY_MEDIUM,
    ],
  ];
  $header['entity_types'] = [
    'data' => $this
      ->t('Entities'),
    'class' => [
      RESPONSIVE_PRIORITY_LOW,
    ],
  ];
  $comment_module_enabled = \Drupal::service('module_handler')
    ->moduleExists('comment');
  $comment_header = $comment_module_enabled ? $this
    ->t('Comment') : $this
    ->t('Comment (disabled)');
  $header['comment_types'] = [
    'data' => $comment_header,
    'class' => [
      RESPONSIVE_PRIORITY_LOW,
    ],
  ];
  return $header + parent::buildHeader();
}