You are here

public function Progress::getProgressBuildModulePage in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 src/Progress.php \Drupal\opigno_learning_path\Progress::getProgressBuildModulePage()

Get get progress for module page.

@opigno_deprecated

Parameters

int $group_id: Group ID.

int $uid: User ID.

int $latest_cert_date: Latest certification date.

Return value

array Renderable array.

1 call to Progress::getProgressBuildModulePage()
Progress::getProgressBuild in src/Progress.php
Get get progress bar it self.

File

src/Progress.php, line 455

Class

Progress
Class JoinService.

Namespace

Drupal\opigno_learning_path

Code

public function getProgressBuildModulePage($group_id, $account_id, $latest_cert_date) {
  $home_link = Link::createFromRoute(Markup::create($this
    ->t('home') . '<i class="icon-home-2"></i>'), 'entity.group.canonical', [
    'group' => $group_id,
  ], [
    'attributes' => [
      'class' => [
        'w-100',
      ],
    ],
  ])
    ->toRenderable();
  $home_link = render($home_link);
  $progress = $this
    ->getProgressRound($group_id, $account_id);
  $build = [
    '#theme' => 'block__opigno_module_learning_path_progress_block',
    'content' => [
      // 'home_link' => $home_link,
      'progress' => $progress,
      'fullpage' => FALSE,
    ],
    '#configuration' => [
      'id' => 'opigno_module_learning_path_progress_block',
      'label' => 'Learning path progress',
      'provider' => 'opigno_module',
      'label_display' => '0',
    ],
    '#plugin_id' => 'opigno_module_learning_path_progress_block',
    '#base_plugin_id' => 'opigno_module_learning_path_progress_block',
    '#derivative_plugin_id' => NULL,
  ];
  return $build;
}