You are here

public function EditorAdvancedImage::checkImageEnable in Editor Advanced Image 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/CKEditorPlugin/EditorAdvancedImage.php \Drupal\editor_advanced_image\Plugin\CKEditorPlugin\EditorAdvancedImage::checkImageEnable()

Check if a DrupalImage exists in the given toolbar row.

Parameters

array $toolbar: A CKeditor toolbar row containing Ckeditor plugin items.

Return value

bool Does the DrupalImage has been placed in the CKeditor.

1 call to EditorAdvancedImage::checkImageEnable()
EditorAdvancedImage::isEnabled in src/Plugin/CKEditorPlugin/EditorAdvancedImage.php
Checks if this plugin should be enabled based on the editor configuration.

File

src/Plugin/CKEditorPlugin/EditorAdvancedImage.php, line 109

Class

EditorAdvancedImage
Defines the "editoradvancedimage" plugin.

Namespace

Drupal\editor_advanced_image\Plugin\CKEditorPlugin

Code

public function checkImageEnable(array $toolbar) {
  foreach ($toolbar as $items) {
    foreach ($items['items'] as $item) {
      if ('DrupalImage' === $item) {
        return TRUE;
      }
    }
  }
  return FALSE;
}