public function LingotekJobManagementController::listJobs in Lingotek Translation 4.0.x
Same name and namespace in other branches
- 8.2 src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.0.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.1.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.2.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.3.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.4.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.5.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.6.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.7.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
- 3.8.x src/Controller/LingotekJobManagementController.php \Drupal\lingotek\Controller\LingotekJobManagementController::listJobs()
List of all the Translation Jobs.
1 string reference to 'LingotekJobManagementController::listJobs'
File
- src/
Controller/ LingotekJobManagementController.php, line 15
Class
- LingotekJobManagementController
- Form for bulk management of content.
Namespace
Drupal\lingotek\ControllerCode
public function listJobs() {
$jobs = [];
$jobs += $this
->getAllContentJobs($jobs);
$jobs += $this
->getAllConfigJobs($jobs);
$rows = array_map(function ($item) {
return [
'id' => $item['id'],
'tagged' => $this
->t('@content content items, @config config items', [
'@content' => $item['content'],
'@config' => $item['config'],
]),
'link' => [
'data' => [
'#type' => 'link',
'#title' => 'View translation job',
'#url' => Url::fromRoute('lingotek.translation_job_info', [
'job_id' => $item['id'],
]),
'#attributes' => [
'title' => t('View translation job'),
],
],
],
];
}, $jobs);
$table = [
'#type' => 'table',
'#header' => [
'id' => $this
->t('Job ID'),
'tagged' => $this
->t('Elements'),
'link' => '',
],
'#rows' => $rows,
'#empty' => $this
->t('There are no translation jobs. Use the Content or Config tabs to assign them.'),
];
return $table;
}