You are here

function hook_juicebox_classes_alter in Juicebox HTML5 Responsive Image Galleries 8.2

Same name and namespace in other branches
  1. 8.3 juicebox.api.php \hook_juicebox_classes_alter()
  2. 7.2 juicebox.api.php \hook_juicebox_classes_alter()

Allow modules to alter the class used to instantiate a Juicebox gallery.

Parameters

string $class: The class to use (must implement Drupal\juicebox\JuiceboxGalleryInterface) when creating a new Juicebox gallery.

array $library: Juicebox javascript library data as provided through Libraries API. Provided for context.

File

./juicebox.api.php, line 43
Hooks provided by the Juicebox module.

Code

function hook_juicebox_classes_alter(&$class, array $library) {

  // Swap out the gallery dependency object because some future Juicebox
  // javascript library requires different embed or XML output.
  if (!empty($library['version']) && $library['version'] == 'Pro 12.3') {
    $class = 'FutureJuiceboxGallery';
  }
}