You are here

function photos_preprocess_photos_default in Album Photos 8.4

Same name and namespace in other branches
  1. 8.5 photos.module \photos_preprocess_photos_default()
  2. 6.0.x photos.module \photos_preprocess_photos_default()

Implements hook_preprocess_HOOK().

File

./photos.module, line 1382
Implementation of photos.module.

Code

function photos_preprocess_photos_default(&$variables) {

  // Prepare content.
  $user_albums = [];
  $content = $variables['content'];
  if (isset($content['user'])) {
    $user_images = [
      '#markup' => $content['user']['image'],
    ];
    $variables['user_images'] = \Drupal::service('renderer')
      ->render($user_images);
    $user_albums = [
      '#markup' => $content['user']['album'],
    ];
  }
  $variables['user_albums'] = \Drupal::service('renderer')
    ->render($user_albums);
  $site_images = [
    '#markup' => $content['site']['image'],
  ];
  $variables['site_images'] = \Drupal::service('renderer')
    ->render($site_images);
  $site_albums = [
    '#markup' => $content['site']['album'],
  ];
  $variables['site_albums'] = \Drupal::service('renderer')
    ->render($site_albums);
}