public function LocaleSourcePluginUi::overviewRow

Builds a table row for overview form.

Parameters

string $type: i18n type.

array $data: Data needed to build the list row.

Return value

array

1 call to LocaleSourcePluginUi::overviewRow()
LocaleSourcePluginUi::overviewForm in sources/locale/src/LocaleSourcePluginUi.php
Builds the overview form for the source entities.

File

sources/locale/src/LocaleSourcePluginUi.php, line 254

Class

LocaleSourcePluginUi
Locale source plugin UI.

Namespace

Drupal\tmgmt_locale

Code

public function overviewRow($type, $data) {

  // Set the default item key, assume it's the first.
  $source = $data['object'];
  $row = array(
    'id' => $data['id'],
    'source' => $source->source,
    'context' => $source->context,
  );
  foreach (\Drupal::languageManager()
    ->getLanguages() as $langcode => $language) {
    $build = $this
      ->buildTranslationStatus($data['translation_statuses'][$langcode], isset($data['current_job_items'][$langcode]) ? $data['current_job_items'][$langcode] : NULL);
    $row['langcode-' . $langcode] = \Drupal::service('renderer')
      ->render($build);
  }
  return $row;
}