You are here

public function TMGMTEntitySourceUIController::overviewRow in Translation Management Tool 7

Builds a table row for overview form.

Parameters

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

Return value

array

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

File

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

Class

TMGMTEntitySourceUIController
Generic entity ui controller class for source plugin.

Code

public function overviewRow($data) {
  $label = $data['entity_label'] ? $data['entity_label'] : t('@type: @id', array(
    '@type' => $data['entity_type'],
    '@id' => $data['entity_id'],
  ));
  $row = array(
    'id' => $data['entity_id'],
    'title' => l($label, $data['entity_uri']),
  );
  if (isset($data['bundle'])) {
    $row['bundle'] = $data['bundle'];
  }
  foreach (language_list() as $langcode => $language) {
    $row['langcode-' . $langcode] = array(
      'data' => 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,
      )),
      'class' => array(
        'langstatus-' . $langcode,
      ),
    );
  }
  return $row;
}