You are here

public function TMGMTEntitySourceUIController::overviewFormHeader in Translation Management Tool 7

Gets overview form header.

Return value

array Header array definition as expected by theme_tablesort().

1 call to TMGMTEntitySourceUIController::overviewFormHeader()
TMGMTEntitySourceUIController::overviewForm in sources/entity/ui/tmgmt_entity_ui.ui.inc

File

sources/entity/ui/tmgmt_entity_ui.ui.inc, line 16

Class

TMGMTEntitySourceUIController
Generic entity ui controller class for source plugin.

Code

public function overviewFormHeader($type) {
  $languages = array();
  foreach (language_list() as $langcode => $language) {
    $languages['langcode-' . $langcode] = array(
      'data' => check_plain($language->name),
    );
  }
  $entity_info = entity_get_info($type);
  $header = array(
    'title' => array(
      'data' => t('Title (in source language)'),
    ),
  );

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