You are here

public function LearningPathAchievementController::mapStatusToTemplateClasses in Opigno Learning path 3.x

Matching a status to a class for template rendering.

4 calls to LearningPathAchievementController::mapStatusToTemplateClasses()
LearningPathAchievementController::build_course_steps in src/Controller/LearningPathAchievementController.php
Returns course steps renderable array.
LearningPathAchievementController::trainingStepIltBuild in src/Controller/LearningPathAchievementController.php
Prepare render array for ILT step.
LearningPathAchievementController::trainingStepMeetingBuild in src/Controller/LearningPathAchievementController.php
Prepare render array for Meeting step.
LearningPathAchievementController::trainingStepModuleBuild in src/Controller/LearningPathAchievementController.php
If step is module prepares a render array of content.

File

src/Controller/LearningPathAchievementController.php, line 605

Class

LearningPathAchievementController
Class LearningPathAchievementController.

Namespace

Drupal\opigno_learning_path\Controller

Code

public function mapStatusToTemplateClasses($status) : array {
  $steps_status = [
    'pending' => [
      'class' => 'in progress',
      'title' => $this
        ->t('Pending'),
    ],
    'failed' => [
      'class' => 'failed',
      'title' => $this
        ->t('Failed'),
    ],
    'passed' => [
      'class' => 'passed',
      'title' => $this
        ->t('Passed'),
    ],
  ];
  return $steps_status[$status] ?? $steps_status['pending'];
}