You are here

public function ContentEntitySourcePluginUi::overviewFormHeader in Translation Management Tool 8

Gets overview form header.

Return value

array Header array definition as expected by theme_tablesort().

File

sources/content/src/ContentEntitySourcePluginUi.php, line 111

Class

ContentEntitySourcePluginUi
Content entity source plugin UI.

Namespace

Drupal\tmgmt_content

Code

public function overviewFormHeader($type) {
  $entity_type = \Drupal::entityTypeManager()
    ->getDefinition($type);
  $header = array(
    'title' => array(
      'data' => $this
        ->t('Title (in source language)'),
    ),
  );

  // Show the bundle if there is more than one for this entity type.
  if (count($this
    ->getTranslatableBundles($type)) > 1) {
    $header['bundle'] = array(
      'data' => $this
        ->t('@entity_name type', array(
        '@entity_name' => $entity_type
          ->getLabel(),
      )),
    );
  }
  $header += $this
    ->getLanguageHeader();
  return $header;
}