You are here

public static function ImageWidgetHelper::getSettingsForm in Lightning Media 8.3

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

Returns the form for an image widget's Lightning Media-specific settings.

Parameters

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

Return value

array The settings form elements.

1 call to ImageWidgetHelper::getSettingsForm()
lightning_media_field_widget_third_party_settings_form in ./lightning_media.module
Implements hook_field_widget_third_party_settings_form().

File

src/ImageWidgetHelper.php, line 41

Class

ImageWidgetHelper
Contains helper functions for manipulating image field widgets.

Namespace

Drupal\lightning_media

Code

public static function getSettingsForm(ImageWidget $widget) {
  $settings = static::getSettings($widget);
  return [
    'file_links' => [
      '#type' => 'checkbox',
      '#title' => t('Show links to uploaded files'),
      '#default_value' => $settings['file_links'],
    ],
    'remove_button' => [
      '#type' => 'checkbox',
      '#title' => t('Show Remove button'),
      '#default_value' => $settings['remove_button'],
    ],
  ];
}