LlamaContextual.php in Drupal 8
File
core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextual.php
View source
<?php
namespace Drupal\ckeditor_test\Plugin\CKEditorPlugin;
use Drupal\ckeditor\CKEditorPluginContextualInterface;
use Drupal\editor\Entity\Editor;
class LlamaContextual extends Llama implements CKEditorPluginContextualInterface {
public function isEnabled(Editor $editor) {
$settings = $editor
->getSettings();
foreach ($settings['toolbar']['rows'] as $row) {
foreach ($row as $group) {
if (in_array('Strike', $group['items'])) {
return TRUE;
}
}
}
return FALSE;
}
public function getFile() {
return drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual.js';
}
}
Classes
Name |
Description |
LlamaContextual |
Defines a "Llama" plugin, with a contextually enabled "llama" feature. |