You are here

protected function InsertImageWidgetUtility::hasInsertLinkedEffect in Insert 8

Checks whether an image style has the effect that images shall link to their originals when inserting using the Insert button.

Parameters

string $styleName:

Return value

bool

1 call to InsertImageWidgetUtility::hasInsertLinkedEffect()
InsertImageWidgetUtility::aggregateVariables in src/Utility/InsertImageWidgetUtility.php
@inheritdoc

File

src/Utility/InsertImageWidgetUtility.php, line 250

Class

InsertImageWidgetUtility

Namespace

Drupal\insert\Utility

Code

protected function hasInsertLinkedEffect($styleName) {
  $style = ImageStyle::load($styleName);
  if ($style === null) {
    return FALSE;
  }
  foreach ($style
    ->getEffects()
    ->getConfiguration() as $effect) {
    if ($effect['id'] === 'insert_image_linked') {
      return TRUE;
    }
  }
  return FALSE;
}