You are here

public function PhotosImageListBuilder::buildHeader in Album Photos 6.0.x

Same name and namespace in other branches
  1. 8.5 src/PhotosImageListBuilder.php \Drupal\photos\PhotosImageListBuilder::buildHeader()

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/PhotosImageListBuilder.php, line 61

Class

PhotosImageListBuilder
Defines a class to build a listing of photos_image entities.

Namespace

Drupal\photos

Code

public function buildHeader() {

  // Enable language column and filter if multiple languages are added.
  $header = [
    'title' => $this
      ->t('Title'),
    'album' => [
      'data' => $this
        ->t('Album ID'),
      'class' => [
        RESPONSIVE_PRIORITY_MEDIUM,
      ],
    ],
    'author' => [
      'data' => $this
        ->t('Author'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
    'status' => $this
      ->t('Status'),
    'changed' => [
      'data' => $this
        ->t('Updated'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ],
  ];
  if (\Drupal::languageManager()
    ->isMultilingual()) {
    $header['language_name'] = [
      'data' => $this
        ->t('Language'),
      'class' => [
        RESPONSIVE_PRIORITY_LOW,
      ],
    ];
  }
  return $header + parent::buildHeader();
}