You are here

protected function LingotekManagementForm::getHeaders in Lingotek Translation 3.4.x

Same name and namespace in other branches
  1. 8.2 src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  2. 4.0.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  3. 3.0.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  4. 3.1.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  5. 3.2.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  6. 3.3.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  7. 3.5.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  8. 3.6.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  9. 3.7.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()
  10. 3.8.x src/Form/LingotekManagementForm.php \Drupal\lingotek\Form\LingotekManagementForm::getHeaders()

Return value

string[]

Overrides LingotekManagementFormBase::getHeaders

File

src/Form/LingotekManagementForm.php, line 27

Class

LingotekManagementForm
Form for bulk management of content.

Namespace

Drupal\lingotek\Form

Code

protected function getHeaders() {
  $entity_type = $this->entityTypeManager
    ->getDefinition($this->entityTypeId);
  $properties = $this->entityFieldManager
    ->getBaseFieldDefinitions($this->entityTypeId);
  $has_bundles = $entity_type
    ->get('bundle_entity_type') != 'bundle';
  if ($has_bundles) {
    $headers['bundle'] = $entity_type
      ->getBundleLabel();
  }
  $headers += [
    'title' => $has_bundles && $entity_type
      ->hasKey('label') ? $properties[$entity_type
      ->getKey('label')]
      ->getLabel() : $entity_type
      ->getLabel(),
    'source' => $this
      ->t('Source'),
    'translations' => $this
      ->t('Translations'),
    'profile' => $this
      ->t('Profile'),
    'job_id' => $this
      ->t('Job ID'),
  ];
  return $headers;
}