public function JuiceboxGallery::addOption in Juicebox HTML5 Responsive Image Galleries 7.2
Add a new Juicebox configuration option to the gallery.
Parameters
string $option_name: The option name/key to add. camelCase names keys are preferred but underscore-separated (e.g., my_setting) and dash-separated (e.g., my-seting) values are also accepted when 'process_attributes' legacy support is active (i.e. when the 'process_attributes' setting was activated when the gallery was instantiated).
string $option_value: The option value to add.
boolean $override: Whether-or-not to override any values that already exist for the passed name/key.
Return value
boolean Returns TRUE on successful addition and FALSE on failure.
Overrides JuiceboxGalleryInterface::addOption
File
- includes/
JuiceboxGallery.inc, line 158 - A php-only set of methods to create the script and markup components of a Juicebox gallery.
Class
- JuiceboxGallery
- Class to generate the script and markup for a Juicebox gallery.
Code
public function addOption($option_name, $option_value, $override = TRUE) {
// Always use lowercase keys to allow for future lookups.
$option_name = strtolower($option_name);
if (!empty($this->options[$option_name]) && !$override) {
return FALSE;
}
// Add option,
$this->options[$option_name] = $option_value;
return TRUE;
}