class LlamaContextual
Defines a "Llama" plugin, with a contextually enabled "llama" feature.
Plugin annotation
@CKEditorPlugin(
id = "llama_contextual",
label = @Translation("Contextual Llama")
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\ckeditor_test\Plugin\CKEditorPlugin\Llama extends \Drupal\ckeditor\CKEditorPluginInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait implements \Drupal\Component\Plugin\PluginBase
- class \Drupal\ckeditor_test\Plugin\CKEditorPlugin\LlamaContextual extends \Drupal\ckeditor\CKEditorPluginContextualInterface implements \Drupal\ckeditor_test\Plugin\CKEditorPlugin\Llama
- class \Drupal\ckeditor_test\Plugin\CKEditorPlugin\Llama extends \Drupal\ckeditor\CKEditorPluginInterface, \Drupal\Core\Plugin\ContainerFactoryPluginInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait implements \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of LlamaContextual
File
-
core/
modules/ ckeditor/ tests/ modules/ src/ Plugin/ CKEditorPlugin/ LlamaContextual.php, line 16
Namespace
Drupal\ckeditor_test\Plugin\CKEditorPluginView source
class LlamaContextual extends Llama implements CKEditorPluginContextualInterface {
/**
* {@inheritdoc}
*/
public function isEnabled(Editor $editor) {
// Automatically enable this plugin if the Underline button is enabled.
$settings = $editor->getSettings();
foreach ($settings['toolbar']['rows'] as $row) {
foreach ($row as $group) {
if (in_array('Strike', $group['items'])) {
return TRUE;
}
}
}
return FALSE;
}
/**
* {@inheritdoc}
*/
public function getFile() {
return $this->moduleList
->getPath('ckeditor_test') . '/js/llama_contextual.js';
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.