You are here

public function InsertImageWidgetUtility::retrieveStyles in Insert 8

@inheritdoc

Return value

array Array with ImageStyle objects for the actual implemented styles and plain arrays for the pseudo styles.

Overrides InsertFileWidgetUtility::retrieveStyles

1 call to InsertImageWidgetUtility::retrieveStyles()
InsertImageWidgetUtility::retrieveInsertStyles in src/Utility/InsertImageWidgetUtility.php
@inheritdoc

File

src/Utility/InsertImageWidgetUtility.php, line 146

Class

InsertImageWidgetUtility

Namespace

Drupal\insert\Utility

Code

public function retrieveStyles() {
  $stylesList = [];
  foreach (ImageStyle::loadMultiple() as $style) {

    /* @var ImageStyle $style */
    $stylesList[$style
      ->getName()] = $style;
  }
  $stylesList += parent::retrieveStyles();
  $stylesList['image'] = [
    'label' => t('Original image'),
    'weight' => -10,
  ];
  return $stylesList;
}