You are here

public function TMGMTI18nStringDefaultSourceUIController::overviewRow in Translation Management Tool 7

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 TMGMTI18nStringDefaultSourceUIController::overviewRow()
TMGMTI18nStringDefaultSourceUIController::overviewForm in sources/i18n_string/tmgmt_i18n_string.ui.inc

File

sources/i18n_string/tmgmt_i18n_string.ui.inc, line 219
Provides the I18nString source controller.

Class

TMGMTI18nStringDefaultSourceUIController
Class TMGMTI18nStringDefaultSourceUIController

Code

public function overviewRow($type, $data) {

  // Set the default item key, assume it's the first.
  $item_title = reset($data['object']);
  $type_label = i18n_object_info($type, 'title');
  $row = array(
    'id' => $data['id'],
    'title' => $item_title
      ->get_string() ? t('@title (@id)', array(
      '@title' => $item_title
        ->get_string(),
      '@id' => $data['id'],
    )) : $data['id'],
    'type' => empty($type_label) ? t('Unknown') : $type_label,
  );
  foreach (language_list() as $langcode => $language) {
    $langcode = str_replace('-', '', $langcode);
    $row['langcode-' . $langcode] = theme('tmgmt_ui_translation_language_status_single', array(
      'translation_status' => $data['translation_statuses'][$langcode],
      'job_item' => isset($data['current_job_items'][$langcode]) ? $data['current_job_items'][$langcode] : NULL,
    ));
  }
  return $row;
}