protected function JuiceboxDisplayStyle::defineOptions in Juicebox HTML5 Responsive Image Galleries 8.2
Same name and namespace in other branches
- 8.3 src/Plugin/views/style/JuiceboxDisplayStyle.php \Drupal\juicebox\Plugin\views\style\JuiceboxDisplayStyle::defineOptions()
Information about options for all kinds of purposes will be held here.
'option_name' => array(
- 'default' => default value,
- 'contains' => (optional) array of items this contains, with its own
defaults, etc. If contains is set, the default will be ignored and
assumed to be array().
),
Return value
array Returns the options of this handler/plugin.
Overrides StylePluginBase::defineOptions
File
- src/
Plugin/ views/ style/ JuiceboxDisplayStyle.php, line 117
Class
- JuiceboxDisplayStyle
- Plugin implementation of the 'juicebox' display style.
Namespace
Drupal\juicebox\Plugin\views\styleCode
protected function defineOptions() {
$options = parent::defineOptions();
$library = $this->juicebox
->getLibrary();
$base_settings = $this->juicebox
->confBaseOptions();
// Structure the base settings in the "default" format that views wants.
foreach ($base_settings as $setting => $value) {
$base_settings_default[$setting] = [
'default' => $value,
];
}
$options = array_merge($base_settings_default, [
'image_field' => [
'default' => '',
],
// If the library supports multi-size we can default to that for the main
// image, otherwise use the "medium" style.
'image_field_style' => [
'default' => !empty($library['version']) && !in_array('juicebox_multisize_image_style', $library['disallowed_conf']) ? 'juicebox_multisize' : 'juicebox_medium',
],
'thumb_field' => [
'default' => '',
],
'thumb_field_style' => [
'default' => 'juicebox_square_thumb',
],
'title_field' => [
'default' => '',
],
'caption_field' => [
'default' => '',
],
'show_title' => [
'default' => 0,
],
]);
return $options;
}