NodeListBuilder::buildHeader

public NodeListBuilder::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

core/modules/node/src/NodeListBuilder.php, line 69

Class

NodeListBuilder
Defines a class to build a listing of node entities.

Namespace

Drupal\node

Code

public function buildHeader() {
  // Enable language column and filter if multiple languages are added.
  $header = array(
    'title' => $this->t('Title'),
    'type' => array(
      'data' => $this->t('Content type'),
      'class' => array(RESPONSIVE_PRIORITY_MEDIUM),
    ),
    'author' => array(
      'data' => $this->t('Author'),
      'class' => array(RESPONSIVE_PRIORITY_LOW),
    ),
    'status' => $this->t('Status'),
    'changed' => array(
      'data' => $this->t('Updated'),
      'class' => array(RESPONSIVE_PRIORITY_LOW),
    ),
  );
  if (\Drupal::languageManager()->isMultilingual()) {
    $header['language_name'] = array(
      'data' => $this->t('Language'),
      'class' => array(RESPONSIVE_PRIORITY_LOW),
    );
  }
  return $header + parent::buildHeader();
}
doc_Drupal
2016-10-29 09:30:59
Comments
Leave a Comment

Please login to continue.