You are here

public static function ImagePopupFieldFormatter::defaultSettings in Simple Image Popup 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php \Drupal\image_popup\Plugin\Field\FieldFormatter\ImagePopupFieldFormatter::defaultSettings()

Defines the default settings for this plugin.

Return value

array A list of default settings, keyed by the setting name.

Overrides PluginSettingsBase::defaultSettings

File

src/Plugin/Field/FieldFormatter/ImagePopupFieldFormatter.php, line 141

Class

ImagePopupFieldFormatter
Plugin implementation of the 'image_popup_field_formatter' formatter.

Namespace

Drupal\image_popup\Plugin\Field\FieldFormatter

Code

public static function defaultSettings() {
  $settings = [
    'image_style' => '',
    'image_style_popup' => '',
    'image_link' => '',
  ] + parent::defaultSettings();
  foreach ([
    'image',
    'image_popup',
  ] as $base) {
    foreach ([
      'title',
      'alt',
    ] as $type) {
      $settings["{$base}_{$type}_source"] = 'static';
      $settings["{$base}_{$type}_static"] = '';
      $settings["{$base}_{$type}_field"] = NULL;
    }
  }
  return $settings;
}