private function LearningPathAchievementController::trainingStepIltBuild in Opigno Learning path 3.x
Prepare render array for ILT step.
1 call to LearningPathAchievementController::trainingStepIltBuild()
- LearningPathAchievementController::trainingStepContentBuild in src/
Controller/ LearningPathAchievementController.php - Prepares a render array of content.
File
- src/
Controller/ LearningPathAchievementController.php, line 1259
Class
- LearningPathAchievementController
- Class LearningPathAchievementController.
Namespace
Drupal\opigno_learning_path\ControllerCode
private function trainingStepIltBuild($step, $group, $user, $latest_cert_date) {
// If the user is not a member of the meeting.
/** @var \Drupal\opigno_ilt\Entity\ILT $ilt */
$ilt = \Drupal::entityTypeManager()
->getStorage('opigno_ilt')
->load($step['id']);
if (!$ilt instanceof ILT) {
return [];
}
if (!($valid_unix = strtotime($ilt
->getStartDate()))) {
return [];
}
$date = $valid_unix ? $this->dateFormatter
->format($valid_unix, 'custom', 'm/d/Y') : '';
return [
'#theme' => 'opigno_learning_path_training_ilt',
'#date' => $date,
'#status' => $this
->mapStatusToTemplateClasses($step['status']),
'#attended' => $step["attempted"] ? $this
->t('Yes') : $this
->t('No'),
'#step' => $step,
'#place' => $ilt
->getPlace(),
'#approved' => [
'value' => $step["presence"],
'percent' => $step["progress"],
],
];
}