/** * {@inheritdoc} */ public static function defaultSettings() { // This is a static method so we can't use the injected JuiceboxFormatter // service. Instead we must get our own from the container. $juicebox = \Drupal::service('juicebox.formatter'); $library = $juicebox->getLibrary(); return array('image_style' => !empty($library['version']) && !in_array('juicebox_multisize_image_style', $library['disallowed_conf']) ? 'juicebox_multisize' : 'juicebox_medium', 'thumb_style' => 'juicebox_square_thumb', 'caption_source' => '', 'title_source' => '') + $juicebox->confBaseOptions() + parent::defaultSettings(); }
/** * {@inheritdoc} */ public static function defaultSettings() { $settings = parent::defaultSettings(); $settings['image_style'] = NULL; return $settings; }
/** * {@inheritdoc} */ public static function defaultSettings() { return array('responsive_image_mapping' => '', 'fallback_image_style' => '', 'image_link' => '') + parent::defaultSettings(); }
/** * {@inheritdoc} */ public static function defaultSettings() { return array('image_style' => '') + parent::defaultSettings(); }
/** * {@inheritdoc} */ public static function defaultSettings() { return array('colorbox_node_style' => '', 'colorbox_node_style_first' => '', 'colorbox_image_style' => '', 'colorbox_gallery' => 'post', 'colorbox_gallery_custom' => '', 'colorbox_caption' => 'auto', 'colorbox_caption_custom' => '') + parent::defaultSettings(); }
/** * {@inheritdoc} */ public static function defaultSettings() { return array( 'image_style' => '', 'image_link_style' => '', 'image_link_class' => '', 'image_link_rel' => '', 'image_link_image_class' => '', ) + parent::defaultSettings(); }
/** * {@inheritdoc} */ public function onDependencyRemoval(array $dependencies) { $changed = parent::onDependencyRemoval($dependencies); $style_id = $this->getSetting('image_style'); /** @var \Drupal\image\ImageStyleInterface $style */ if ($style_id && ($style = ImageStyle::load($style_id))) { if (!empty($dependencies[$style->getConfigDependencyKey()][$style->getConfigDependencyName()])) { $replacement_id = $this->imageStyleStorage->getReplacementId($style_id); // If a valid replacement has been provided in the storage, replace the // image style with the replacement and signal that the formatter plugin // settings were updated. if ($replacement_id && ImageStyle::load($replacement_id)) { $this->setSetting('image_style', $replacement_id); $changed = TRUE; } } } return $changed; }
/** * {@inheritdoc} */ public static function defaultSettings() { return array('sizes' => '', 'image_styles' => array(), 'fallback_image_style' => '', 'image_link' => '') + parent::defaultSettings(); }
/** * {@inheritdoc} */ public static function defaultSettings() { return array( 'url_type' => '', 'image_style' => '', 'image_link' => '', ) + parent::defaultSettings(); }
/** * {@inheritdoc} */ public static function defaultSettings() { return array('image_style' => '', 'autoplay' => TRUE, 'autoplayinterval' => 3000, 'arrownavigator' => TRUE, 'bulletnavigator' => TRUE, 'caption' => FALSE) + parent::defaultSettings(); }
/** * {@inheritdoc} */ public function view(FieldItemListInterface $items, $langcode = NULL) { $elements = parent::view($items, $langcode); $gallery_type = $this->getSetting('gallery_type'); $elements['#attributes']['class'][] = 'mfp-field'; $elements['#attributes']['class'][] = 'mfp-' . Html::cleanCssIdentifier($gallery_type); return $elements; }
/** * {@inheritdoc} */ public function calculateDependencies() { $dependencies = parent::calculateDependencies(); $style_id = $this->getSetting('responsive_image_style'); /** @var \Drupal\responsive_image\ResponsiveImageStyleInterface $style */ if ($style_id && ($style = ResponsiveImageStyle::load($style_id))) { // Add the responsive image style as dependency. $dependencies[$style->getConfigDependencyKey()][] = $style->getConfigDependencyName(); } return $dependencies; }