interface CKEditorPluginContextualInterface

Defines an interface for contextually enabled CKEditor plugins.

Contextually enabled CKEditor plugins can be enabled via an explicit setting, or enable themselves based on the configuration of another setting, such as enabling based on a particular button being present in the toolbar.

If a contextually enabled CKEditor plugin must also be configurable (e.g. in the case where it must be enabled based on an explicit setting), then one must also implement the CKEditorPluginConfigurableInterface interface.

Hierarchy

Expanded class hierarchy of CKEditorPluginContextualInterface

All classes that implement CKEditorPluginContextualInterface

See also

CKEditorPluginConfigurableInterface

2 files declare their use of CKEditorPluginContextualInterface
LlamaContextual.php in drupal/core/modules/ckeditor/tests/modules/lib/Drupal/ckeditor_test/Plugin/CKEditorPlugin/LlamaContextual.php
Contains \Drupal\ckeditor_test\Plugin\CKEditorPlugin\LlamaContextual.
LlamaContextualAndButton.php in drupal/core/modules/ckeditor/tests/modules/lib/Drupal/ckeditor_test/Plugin/CKEditorPlugin/LlamaContextualAndButton.php
Contains \Drupal\ckeditor_test\Plugin\CKEditorPlugin\LlamaContextualAndButton.

File

drupal/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginContextualInterface.php, line 25
Contains \Drupal\ckeditor\CKEditorPluginContextualInterface.

Namespace

Drupal\ckeditor
View source
interface CKEditorPluginContextualInterface extends CKEditorPluginInterface {

  /**
   * Checks if this plugin should be enabled based on the editor configuration.
   *
   * The editor's settings can be found in $editor->settings.
   *
   * @param \Drupal\editor\Plugin\Core\Entity\Editor $editor
   *   A configured text editor object.
   *
   * @return bool
   */
  public function isEnabled(Editor $editor);

}

Members

Namesort descending Modifiers Type Description Overrides
CKEditorPluginContextualInterface::isEnabled public function Checks if this plugin should be enabled based on the editor configuration. 2
CKEditorPluginInterface::getConfig public function Returns the additions to CKEDITOR.config for a specific CKEditor instance. 3
CKEditorPluginInterface::getFile public function Returns the Drupal root-relative file path to the plugin JavaScript file. 3
CKEditorPluginInterface::isInternal public function Indicates if this plugin is part of the optimized CKEditor build. 2
PluginInspectionInterface::getPluginDefinition public function Returns the definition of the plugin implementation. 1
PluginInspectionInterface::getPluginId public function Returns the plugin_id of the plugin instance. 1