You are here

function lingotek_views_handler_source_status_formatted::render in Lingotek Translation 7.7

Render the field.

Parameters

array $values: The values retrieved from the database.

Overrides views_handler_field::render

File

./lingotek_views_handler_source_status_formatted.inc, line 24
A handler to supply source statuses.

Class

lingotek_views_handler_source_status_formatted
@file A handler to supply source statuses.

Code

function render($values) {
  $value = $this
    ->get_value($values);
  $entity_type = NULL;
  $entity_id = NULL;
  global $language;
  $entity_type = $this->view->base_table;
  if ($entity_type == 'node') {
    $entity_id = $values->nid;
    $entity = node_load($entity_id);
    if ($this->options['relationship'] != 'NONE') {
    }
  }
  if (!user_access('manage projects') && !user_access('translation')) {
    return;

    //do not show if the user does not have correct permissions
  }
  $upload_status = LingotekSync::getUploadStatus($entity_type, $value);
  $upload_status_lowercase = strtolower($upload_status);
  $source_text = '<span class="ltk-source-icon source-' . $upload_status_lowercase . '" title="' . $upload_status . '">' . $entity->language . '</span>';
  return $source_text;
}