You are here

protected function DropzoneJsEbWidget::handleWidgetContext in DropzoneJS 8.2

1 call to DropzoneJsEbWidget::handleWidgetContext()
MediaEntityDropzoneJsEbWidget::handleWidgetContext in modules/eb_widget/src/Plugin/EntityBrowser/Widget/MediaEntityDropzoneJsEbWidget.php
1 method overrides DropzoneJsEbWidget::handleWidgetContext()
MediaEntityDropzoneJsEbWidget::handleWidgetContext in modules/eb_widget/src/Plugin/EntityBrowser/Widget/MediaEntityDropzoneJsEbWidget.php

File

modules/eb_widget/src/Plugin/EntityBrowser/Widget/DropzoneJsEbWidget.php, line 609

Class

DropzoneJsEbWidget
Provides an Entity Browser widget that uploads new files.

Namespace

Drupal\dropzonejs_eb_widget\Plugin\EntityBrowser\Widget

Code

protected function handleWidgetContext($widget_context) {
  parent::handleWidgetContext($widget_context);
  $validators = isset($widget_context['upload_validators']) ? $widget_context['upload_validators'] : [];
  if (isset($validators['file_validate_size'])) {
    $this->configuration['max_filesize'] = $validators['file_validate_size'][0];
  }
  if (isset($validators['file_validate_extensions'])) {
    $this->configuration['extensions'] = $validators['file_validate_extensions'][0];
  }
}