function lingotek_views_handler_target_status::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_target_status.inc, line 24 - A handler to supply target statuses.
Class
- lingotek_views_handler_target_status
- @file A handler to supply target statuses.
Code
function render($values) {
$value = $this
->get_value($values);
$entity_type = NULL;
$entity_id = NULL;
$target_text = '';
global $language;
$entity_type = $this->view->base_table;
if ($entity_type == 'node') {
$entity_type = 'node';
$entity_id = $values->nid;
$entity = node_load($entity_id);
}
if (!user_access('manage projects') && !user_access('translation')) {
return;
//do not show if the user does not have correct permissions
}
$target_statuses = LingotekSync::getAllTargetStatusForEntity($entity_type, $value);
foreach ($target_statuses as $locale => $status) {
$target_text .= $locale . ':' . $status . ' ';
}
return $target_text;
}