Ejemplo n.º 1
0
 /**
  * Constructs an ImageFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings settings.
  * @param \Drupal\Core\Session\AccountInterface $current_user
  *   The current user.
  * @param \Drupal\Core\Utility\LinkGeneratorInterface $link_generator
  *   The link generator service.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, AccountInterface $current_user, LinkGeneratorInterface $link_generator, EntityStorageInterface $image_style_storage)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->currentUser = $current_user;
     $this->linkGenerator = $link_generator;
     $this->imageStyleStorage = $image_style_storage;
 }
Ejemplo n.º 2
0
 /**
  * Constructor.
  *
  * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
  *   A Drupal entity manager service.
  * @param \Drupal\Core\Utility\LinkGeneratorInterface $translation
  *   A link generator service.
  * @param \Symfony\Component\HttpFoundation\RequestStack $request_stack
  *   The Symfony request stack from which to extract the current request.
  * @param \Drupal\juicebox\JuiceboxFormatterInterface
  *   A Juicebox formatter service.
  */
 public function __construct(array $configuration, $plugin_id, array $plugin_definition, EntityManagerInterface $entity_manager, LinkGeneratorInterface $link_generator, RequestStack $request_stack, JuiceboxFormatterInterface $juicebox)
 {
     parent::__construct($plugin_id, $plugin_definition, $configuration['field_definition'], $configuration['settings'], $configuration['label'], $configuration['view_mode'], $configuration['third_party_settings']);
     $this->entityManager = $entity_manager;
     $this->linkGenerator = $link_generator;
     $this->request = $request_stack->getCurrentRequest();
     $this->juicebox = $juicebox;
 }
 /**
  * Constructs a ResponsiveImageFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings.
  * @param \Drupal\Core\Entity\EntityStorageInterface $responsive_image_mapping_storage
  *   The responsive image mapping storage.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $responsive_image_mapping_storage)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->responsiveImageMappingStorage = $responsive_image_mapping_storage;
 }
Ejemplo n.º 4
0
 /**
  * Constructs an ImageFormatter object.
  *
  * @param string $plugin_id
  *   The plugin_id for the formatter.
  * @param mixed $plugin_definition
  *   The plugin implementation definition.
  * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
  *   The definition of the field to which the formatter is associated.
  * @param array $settings
  *   The formatter settings.
  * @param string $label
  *   The formatter label display setting.
  * @param string $view_mode
  *   The view mode.
  * @param array $third_party_settings
  *   Any third party settings settings.
  * @param \Drupal\colorbox\ElementAttachmentInterface $attachment
  *   Allow the library to be attached to the page.
  */
 public function __construct($plugin_id, $plugin_definition, FieldDefinitionInterface $field_definition, array $settings, $label, $view_mode, array $third_party_settings, EntityStorageInterface $image_style_storage, ElementAttachmentInterface $attachment)
 {
     parent::__construct($plugin_id, $plugin_definition, $field_definition, $settings, $label, $view_mode, $third_party_settings);
     $this->imageStyleStorage = $image_style_storage;
     $this->attachment = $attachment;
 }