You are here

function social_album_preprocess_views_view in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/social_album.module \social_album_preprocess_views_view()
  2. 10.0.x modules/social_features/social_album/social_album.module \social_album_preprocess_views_view()
  3. 10.2.x modules/social_features/social_album/social_album.module \social_album_preprocess_views_view()

Implements hook_preprocess_HOOK().

File

modules/social_features/social_album/social_album.module, line 120
The Social Album module.

Code

function social_album_preprocess_views_view(&$variables) {

  /** @var \Drupal\views\ViewExecutable $view */
  $view = $variables['view'];
  if ($view
    ->id() === 'albums') {
    $library = [
      'embed_album_overview' => 'social_album/social_album_post',
      'page_albums_overview' => 'social_album/social_album_teaser',
      'page_group_albums_overview' => 'social_album/social_album_teaser',
    ];
    if (isset($library[$view->current_display])) {
      $variables['#attached']['library'][] = $library[$view->current_display];
    }
  }
}