Defines a "Llama" plugin, with a contextually enabled "llama" feature.
@CKEditorPlugin(
id = "llama_contextual",
label = @Translation("Contextual Llama")
)
Expanded class hierarchy of LlamaContextual
class LlamaContextual extends Llama implements CKEditorPluginContextualInterface {
/**
* Implements \Drupal\ckeditor\Plugin\CKEditorPluginContextualInterface::isEnabled().
*/
function isEnabled(Editor $editor) {
// Automatically enable this plugin if the Underline button is enabled.
foreach ($editor->settings['toolbar']['buttons'] as $row) {
if (in_array('Strike', $row)) {
return TRUE;
}
}
return FALSE;
}
/**
* Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getFile().
*/
function getFile() {
return drupal_get_path('module', 'ckeditor_test') . '/js/llama_contextual.js';
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Llama:: |
public | function |
Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getButtons(). Overrides CKEditorPluginInterface:: |
|
Llama:: |
function |
Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::isInternal(). Overrides CKEditorPluginInterface:: |
||
LlamaContextual:: |
function |
Implements \Drupal\ckeditor\Plugin\CKEditorPluginInterface::getFile(). Overrides Llama:: |
||
LlamaContextual:: |
function |
Implements \Drupal\ckeditor\Plugin\CKEditorPluginContextualInterface::isEnabled(). Overrides CKEditorPluginContextualInterface:: |
||
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
public | function |
Returns the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Constructs a Drupal\Component\Plugin\PluginBase object. | 17 |