function LlamaContextualAndButton::isEnabled
Same name in other branches
- 8.9.x core/modules/ckeditor/tests/modules/src/Plugin/CKEditorPlugin/LlamaContextualAndButton.php \Drupal\ckeditor_test\Plugin\CKEditorPlugin\LlamaContextualAndButton::isEnabled()
Overrides CKEditorPluginContextualInterface::isEnabled
File
-
core/
modules/ ckeditor/ tests/ modules/ src/ Plugin/ CKEditorPlugin/ LlamaContextualAndButton.php, line 24
Class
- LlamaContextualAndButton
- Defines a "LlamaContextualAndButton" plugin, with a "llama" feature.
Namespace
Drupal\ckeditor_test\Plugin\CKEditorPluginCode
public function isEnabled(Editor $editor) {
// Automatically enable this plugin if the Strike 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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.