You are here

public function LearningPathContentController::modulesIndex in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Controller/LearningPathContentController.php \Drupal\opigno_learning_path\Controller\LearningPathContentController::modulesIndex()

Root page for angular app.

1 string reference to 'LearningPathContentController::modulesIndex'
opigno_learning_path.routing.yml in ./opigno_learning_path.routing.yml
opigno_learning_path.routing.yml

File

src/Controller/LearningPathContentController.php, line 92

Class

LearningPathContentController
Controller for all the actions of the Learning Path content.

Namespace

Drupal\opigno_learning_path\Controller

Code

public function modulesIndex(Group $group, Request $request) {

  // Check if user has uncompleted steps.
  $validation = LearningPathValidator::stepsValidate($group);
  if ($validation instanceof RedirectResponse) {
    return $validation;
  }
  $tempstore = \Drupal::service('tempstore.private')
    ->get('opigno_group_manager');
  $next_link = $this
    ->getNextLink($group);
  return [
    '#theme' => 'opigno_learning_path_modules',
    '#attached' => [
      'library' => [
        'opigno_group_manager/manage_app',
      ],
    ],
    '#base_path' => $request
      ->getBasePath(),
    '#base_href' => $request
      ->getPathInfo(),
    '#learning_path_id' => $group
      ->id(),
    '#module_context' => 'false',
    '#next_link' => isset($next_link) ? render($next_link) : NULL,
    '#user_has_info_card' => $tempstore
      ->get('hide_info_card') ? FALSE : TRUE,
  ];
}