You are here

public function JuiceboxGallery::__construct in Juicebox HTML5 Responsive Image Galleries 8.3

Same name and namespace in other branches
  1. 8.2 src/JuiceboxGallery.php \Drupal\juicebox\JuiceboxGallery::__construct()

Constructor.

Parameters

string $id: A unique string id that can represent this gallery.

array $settings: Configuration data to be used by this gallery object. These options relate to any "output" processing applied to the raw gallery variables upon rendering.

  • filter_markup: Optional boolean indicating whether-or-not to filter all image title and caption values for syntactic compatibility with Juicebox. This designates a gallery-wide default and can still be overriden on an image-by-image basis. Defaults to TRUE.
  • process_attributes: Optional boolean to activate legacy attribute name support for underscore-separated and dash-separated attributes (e.g., convert image_url to imageURL). Defaults to FALSE.

File

src/JuiceboxGallery.php, line 58

Class

JuiceboxGallery
Class to generate the script and markup for a Juicebox gallery.

Namespace

Drupal\juicebox

Code

public function __construct($id = '', array $settings = []) {

  // Set the ID.
  $this->id = $id;

  // Ensure some default settings are specified.
  $settings += [
    'filter_markup' => TRUE,
    'process_attributes' => FALSE,
  ];
  $this->settings = $settings;
}