1. 8.3.x core/modules/editor/src/Annotation/Editor.php
  2. 8.3.x core/modules/editor/src/Entity/Editor.php
  3. 8.3.x core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
  4. 8.0.x core/modules/editor/src/Entity/Editor.php
  5. 8.0.x core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
  6. 8.0.x core/modules/editor/src/Annotation/Editor.php
  7. 8.1.x core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
  8. 8.1.x core/modules/editor/src/Entity/Editor.php
  9. 8.1.x core/modules/editor/src/Annotation/Editor.php
  10. 8.2.x core/modules/editor/src/Entity/Editor.php
  11. 8.2.x core/modules/editor/src/Annotation/Editor.php
  12. 8.2.x core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
  13. 8.4.x core/modules/editor/src/Plugin/InPlaceEditor/Editor.php
  14. 8.4.x core/modules/editor/src/Annotation/Editor.php
  15. 8.4.x core/modules/editor/src/Entity/Editor.php

Namespace

Drupal\editor\Annotation

File

core/modules/editor/src/Annotation/Editor.php
View source
  1. <?php
  2. namespace Drupal\editor\Annotation;
  3. use Drupal\Component\Annotation\Plugin;
  4. /**
  5. * Defines an Editor annotation object.
  6. *
  7. * Plugin Namespace: Plugin\Editor
  8. *
  9. * Text editor plugin implementations need to define a plugin definition array
  10. * through annotation. These definition arrays may be altered through
  11. * hook_editor_info_alter(). The definition includes the following keys:
  12. *
  13. * - id: The unique, system-wide identifier of the text editor. Typically named
  14. * the same as the editor library.
  15. * - label: The human-readable name of the text editor, translated.
  16. * - supports_content_filtering: Whether the editor supports "allowed content
  17. * only" filtering.
  18. * - supports_inline_editing: Whether the editor supports the inline editing
  19. * provided by the Edit module.
  20. * - is_xss_safe: Whether this text editor is not vulnerable to XSS attacks.
  21. * - supported_element_types: On which form element #types this text editor is
  22. * capable of working.
  23. *
  24. * A complete sample plugin definition should be defined as in this example:
  25. *
  26. * @code
  27. * @Editor(
  28. * id = "myeditor",
  29. * label = @Translation("My Editor"),
  30. * supports_content_filtering = FALSE,
  31. * supports_inline_editing = FALSE,
  32. * is_xss_safe = FALSE,
  33. * supported_element_types = {
  34. * "textarea",
  35. * "textfield",
  36. * }
  37. * )
  38. * @endcode
  39. *
  40. * For a working example, see \Drupal\ckeditor\Plugin\Editor\CKEditor
  41. *
  42. * @see \Drupal\editor\Plugin\EditorPluginInterface
  43. * @see \Drupal\editor\Plugin\EditorBase
  44. * @see \Drupal\editor\Plugin\EditorManager
  45. * @see hook_editor_info_alter()
  46. * @see plugin_api
  47. *
  48. * @Annotation
  49. */
  50. class Editor extends Plugin {
  51. /**
  52. * The plugin ID.
  53. *
  54. * @var string
  55. */
  56. public $id;
  57. /**
  58. * The human-readable name of the editor plugin.
  59. *
  60. * @ingroup plugin_translatable
  61. *
  62. * @var \Drupal\Core\Annotation\Translation
  63. */
  64. public $label;
  65. /**
  66. * Whether the editor supports "allowed content only" filtering.
  67. *
  68. * @var bool
  69. */
  70. public $supports_content_filtering;
  71. /**
  72. * Whether the editor supports the inline editing provided by the Edit module.
  73. *
  74. * @var bool
  75. */
  76. public $supports_inline_editing;
  77. /**
  78. * Whether this text editor is not vulnerable to XSS attacks.
  79. *
  80. * @var bool
  81. */
  82. public $is_xss_safe;
  83. /**
  84. * A list of element types this text editor supports.
  85. *
  86. * @var string[]
  87. */
  88. public $supported_element_types;
  89. }

Classes

Namesort descending Description
Editor Defines an Editor annotation object.