You are here

protected function PmDashboardController::getDashboardLinks in Drupal PM (Project Management) 4.x

Get links for dashboard.

1 call to PmDashboardController::getDashboardLinks()
PmDashboardController::dashboard in src/Controller/PmDashboardController.php
Dashboard.

File

src/Controller/PmDashboardController.php, line 83

Class

PmDashboardController
Dashboard Controller.

Namespace

Drupal\pm\Controller

Code

protected function getDashboardLinks() {
  $items = $this->dashboardItemsManager
    ->getDefinitions();
  $output = [];
  foreach ($items as $item) {
    if ($this->pathValidator
      ->isValid($item['link']['path'])) {
      $item['link']['url'] = Url::fromUri('internal:' . $item['link']['path']);
      $group_label = $item['group'] ?? '';
      $output[$group_label]['label'] = $group_label;
      $output[$group_label]['items'][] = $item;
    }
  }
  ksort($output);
  return $output;
}