You are here

public function BlazyManagerBase::getLightboxes in Blazy 7

Same name and namespace in other branches
  1. 8.2 src/BlazyManagerBase.php \Drupal\blazy\BlazyManagerBase::getLightboxes()
  2. 8 src/BlazyManagerBase.php \Drupal\blazy\BlazyManagerBase::getLightboxes()

Gets the supported lightboxes.

Return value

array The supported lightboxes.

Overrides BlazyManagerInterface::getLightboxes

1 call to BlazyManagerBase::getLightboxes()
BlazyFormatter::buildSettings in src/BlazyFormatter.php

File

src/BlazyManagerBase.php, line 214

Class

BlazyManagerBase
Implements BlazyManagerInterface.

Namespace

Drupal\blazy

Code

public function getLightboxes() {
  $lightboxes = [];
  foreach ([
    'colorbox',
    'photobox',
  ] as $lightbox) {
    if (function_exists($lightbox . '_theme')) {
      $lightboxes[] = $lightbox;
    }
  }
  if (is_file(libraries_get_path('photobox') . '/photobox/jquery.photobox.js')) {
    $lightboxes[] = 'photobox';
  }
  drupal_alter('blazy_lightboxes', $lightboxes);
  return array_unique($lightboxes);
}