You are here

protected static function ImageWidgetHelper::getSettings in Lightning Media 8

Same name and namespace in other branches
  1. 8.4 src/ImageWidgetHelper.php \Drupal\lightning_media\ImageWidgetHelper::getSettings()
  2. 8.2 src/ImageWidgetHelper.php \Drupal\lightning_media\ImageWidgetHelper::getSettings()
  3. 8.3 src/ImageWidgetHelper.php \Drupal\lightning_media\ImageWidgetHelper::getSettings()

Returns normalized Lightning Media-specific settings for the widget.

Parameters

\Drupal\image\Plugin\Field\FieldWidget\ImageWidget $widget: The widget plugin.

Return value

array The normalized settings.

3 calls to ImageWidgetHelper::getSettings()
ImageWidgetHelper::alter in src/ImageWidgetHelper.php
Alters an image widget form element.
ImageWidgetHelper::getSettingsForm in src/ImageWidgetHelper.php
Returns the form for an image widget's Lightning Media-specific settings.
ImageWidgetHelper::summarize in src/ImageWidgetHelper.php
Summarizes an image widget's Lightning Media-specific settings.

File

src/ImageWidgetHelper.php, line 21

Class

ImageWidgetHelper
Contains helper functions for manipulating image field widgets.

Namespace

Drupal\lightning_media

Code

protected static function getSettings(ImageWidget $widget) {
  $settings = $widget
    ->getThirdPartySettings('lightning_media') ?: [];
  $settings += [
    'file_links' => TRUE,
    'remove_button' => TRUE,
  ];
  return $settings;
}