interface CKEditor4To5UpgradePluginInterface implements PluginInspectionInterface (View source)

Defines an interface for CKEditor 4 to 5 upgrade plugins.

Methods

string
getPluginId()

Gets the plugin_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

string|null
mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem(string $cke4_button)

Maps a CKEditor 4 button to the CKEditor 5 equivalent, if it exists.

array|null
mapCKEditor4SettingsToCKEditor5Configuration(string $cke4_plugin_id, array $cke4_plugin_settings)

Maps CKEditor 4 settings to the CKEditor 5 equivalent, if needed.

array|null
computeCKEditor5PluginSubsetConfiguration(string $cke5_plugin_id, FilterFormatInterface $text_format)

Computes elements subset configuration for CKEditor 5 plugin.

Details

string getPluginId()

Gets the plugin_id of the plugin instance.

Return Value

string

The plugin_id of the plugin instance.

array getPluginDefinition()

Gets the definition of the plugin implementation.

Return Value

array

The plugin definition, as returned by the discovery object used by the plugin manager.

string|null mapCKEditor4ToolbarButtonToCKEditor5ToolbarItem(string $cke4_button)

Maps a CKEditor 4 button to the CKEditor 5 equivalent, if it exists.

Generated by inspecting all \Drupal\ckeditor\CKEditorPluginButtonsInterface implementations.

Parameters

string $cke4_button

A valid CKEditor 4 button name.

Return Value

string|null

The equivalent CKEditor 5 toolbar item, or NULL if no equivalent exists. In either case, the button name must be added to the annotation.

Exceptions

OutOfBoundsException

See also

CKEditorPluginButtonsInterface
CKEditor4To5Upgrade

array|null mapCKEditor4SettingsToCKEditor5Configuration(string $cke4_plugin_id, array $cke4_plugin_settings)

Maps CKEditor 4 settings to the CKEditor 5 equivalent, if needed.

Not every CKEditor 5 plugin has settings; some CKEditor 5 plugins may have settings that the CKEditor 4 equivalent did not and vice versa. Therefore the complete CKEditor 4 settings are provided, and any CKEditor 5 setting can be set.

Parameters

string $cke4_plugin_id

The CKEditor 4 plugin whose settings need to be mapped.

array $cke4_plugin_settings

The settings for this CKEditor 4 plugin.

Return Value

array|null

NULL if not needed, otherwise an array with a single key-value pair:

  • key: the plugin ID of the equivalent CKEditor 5 plugin
  • value: the equivalent settings In either case, the button name must be added to the annotation.

Exceptions

OutOfBoundsException

See also

CKEditorPluginConfigurableInterface
CKEditor4To5Upgrade

array|null computeCKEditor5PluginSubsetConfiguration(string $cke5_plugin_id, FilterFormatInterface $text_format)

Computes elements subset configuration for CKEditor 5 plugin.

Every CKEditor 5 plugin that implements the elements subset interface must implement this as well, to ensure a smooth upgrade path.

Parameters

string $cke5_plugin_id

The CKEditor 5 plugin whose subset configuration needs to be computed.

FilterFormatInterface $text_format

The text format based on whose restrictions this should be computed.

Return Value

array|null

NULL if not needed, otherwise a configuration array (which can itself be a subset of the default configuration of this CKEditor 5 plugin: perhaps only some of the configuration values determine the subset).

Exceptions

OutOfBoundsException
LogicException

See also

CKEditor5PluginElementsSubsetInterface
CKEditor4To5Upgrade