You are here

public static function ImageWidgetHelper::process in Lightning Media 8.3

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

Process callback: does extra processing of an image widget form element.

Parameters

array $element: The form element.

Return value

array The processed form element.

File

src/ImageWidgetHelper.php, line 110

Class

ImageWidgetHelper
Contains helper functions for manipulating image field widgets.

Namespace

Drupal\lightning_media

Code

public static function process(array $element) {
  $settings = $element['#settings'];
  foreach ($element['fids']['#value'] as $fid) {
    $element['file_' . $fid]['#access'] = $settings['file_links'];
  }
  $element['remove_button']['#access'] = $settings['remove_button'];
  return $element;
}