You are here

public function TmgmtSmartlingDashboardLink::render in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/views/field/TmgmtSmartlingDashboardLink.php \Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink::render()
  2. 8 src/Plugin/views/field/TmgmtSmartlingDashboardLink.php \Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink::render()
  3. 8.2 src/Plugin/views/field/TmgmtSmartlingDashboardLink.php \Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink::render()

inheritdoc}

Overrides FieldPluginBase::render

File

src/Plugin/views/field/TmgmtSmartlingDashboardLink.php, line 36
Definition of Drupal\tmgmt_smartling\Plugin\views\field\TmgmtSmartlingDashboardLink

Class

TmgmtSmartlingDashboardLink
Field handler to flag the node type.

Namespace

Drupal\tmgmt_smartling\Plugin\views\field

Code

public function render(ResultRow $values) {
  $job = $values->_entity;
  $translator = $job
    ->hasTranslator() ? $job
    ->getTranslatorPlugin() : null;
  if (empty($translator) || !$translator instanceof SmartlingTranslator) {
    return '';
  }
  $proj_id = $job
    ->getTranslator()
    ->getSetting('project_id');
  $file_name = $translator
    ->getFileName($job);
  return [
    '#theme' => 'smartling_dashboard_link',
    '#proj_id' => $proj_id,
    '#file_name' => $file_name,
  ];
}