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