Imce.php in IMCE 8.2
File
src/Plugin/CKEditorPlugin/Imce.php
View source
<?php
namespace Drupal\imce\Plugin\CKEditorPlugin;
use Drupal\editor\Entity\Editor;
use Drupal\ckeditor\CKEditorPluginBase;
class Imce extends CKEditorPluginBase {
public function getDependencies(Editor $editor) {
return [
'drupalimage',
'drupalimagecaption',
];
}
public function getFile() {
return drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/imce.ckeditor.js';
}
public function getButtons() {
return [
'ImceImage' => [
'label' => $this
->t('Insert images using Imce File Manager'),
'image' => $this
->imageIcon(),
],
'ImceLink' => [
'label' => $this
->t('Insert file links using Imce File Manager'),
'image' => $this
->linkIcon(),
],
];
}
public function getConfig(Editor $editor) {
return [
'ImceImageIcon' => file_create_url($this
->imageIcon()),
'ImceLinkIcon' => file_create_url($this
->linkIcon()),
];
}
public function imageIcon() {
return drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/icons/imceimage.png';
}
public function linkIcon() {
return drupal_get_path('module', 'imce') . '/js/plugins/ckeditor/icons/imcelink.png';
}
}
Classes
Name |
Description |
Imce |
Defines Imce plugin for CKEditor. |