You are here

function opigno_dashboard_page_attachments in Opigno dashboard 8

Implements hook_page_attachments().

File

./opigno_dashboard.module, line 144
Contains opigno_dashboard.module.

Code

function opigno_dashboard_page_attachments(array &$page) {

  // Add dashboard libaries.
  $route_name = \Drupal::routeMatch()
    ->getRouteName();
  if ($route_name == 'view.frontpage.page_1' || $route_name == 'opigno_dashboard.dashboard_admin_default_settings') {
    $page['#attached']['library'][] = 'opigno_dashboard/ng_app';
    $manage_dashboard_access = Drupal::currentUser()
      ->hasPermission('opigno dashboard layout access');
    $page['#attached']['drupalSettings']['manageDashboardAccess'] = $manage_dashboard_access;
  }
}