3 namespace Drupal\ckeditor;
6 * Defines an interface for CKEditor plugins with buttons.
8 * This allows a CKEditor plugin to define which buttons it provides, so that
9 * users can configure a CKEditor toolbar instance via the toolbar builder UI.
10 * If at least one button that this plugin provides is added to the toolbar via
11 * the toolbar builder UI, then this plugin will be enabled automatically.
13 * If a CKEditor plugin implements this interface, it can still also implement
14 * CKEditorPluginContextualInterface if it wants a button to conditionally be
15 * added as well. The downside of conditionally adding buttons is that the user
16 * cannot see these buttons in the toolbar builder UI.
18 * @see \Drupal\ckeditor\CKEditorPluginInterface
19 * @see \Drupal\ckeditor\CKEditorPluginContextualInterface
20 * @see \Drupal\ckeditor\CKEditorPluginConfigurableInterface
21 * @see \Drupal\ckeditor\CKEditorPluginCssInterface
22 * @see \Drupal\ckeditor\CKEditorPluginBase
23 * @see \Drupal\ckeditor\CKEditorPluginManager
24 * @see \Drupal\ckeditor\Annotation\CKEditorPlugin
27 interface CKEditorPluginButtonsInterface extends CKEditorPluginInterface {
30 * Returns the buttons that this plugin provides, along with metadata.
32 * The metadata is used by the CKEditor module to generate a visual CKEditor
36 * An array of buttons that are provided by this plugin. This will
37 * only be used in the administrative section for assembling the toolbar.
38 * Each button should be keyed by its CKEditor button name (you can look up
39 * the button name up in the plugin.js file), and should contain an array of
40 * button properties, including:
41 * - label: A human-readable, translated button name.
42 * - image: An image for the button to be used in the toolbar.
43 * - image_rtl: If the image needs to have a right-to-left version, specify
44 * an alternative file that will be used in RTL editors.
45 * - image_alternative: If this button does not render as an image, specify
46 * an HTML string representing the contents of this button.
47 * - image_alternative_rtl: Similar to image_alternative, but a
48 * right-to-left version.
49 * - attributes: An array of HTML attributes which should be added to this
50 * button when rendering the button in the administrative section for
51 * assembling the toolbar.
52 * - multiple: Boolean value indicating if this button may be added multiple
53 * times to the toolbar. This typically is only applicable for dividers
54 * and group indicators.
56 public function getButtons();