.../modules/editor/lib/Drupal/editor/Plugin/EditorBase.php | 3 ++- .../editor/lib/Drupal/editor/Plugin/EditorInterface.php | 6 +++--- .../editor_test/Plugin/editor/editor/UnicornEditor.php | 12 ++++-------- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/EditorBase.php b/core/modules/editor/lib/Drupal/editor/Plugin/EditorBase.php index ef37bd0..00f5e78 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/EditorBase.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/EditorBase.php @@ -24,6 +24,7 @@ * - id: The unique, system-wide identifier of the text editor. Typically named * the same as the editor library. * - label: The human-readable name of the text editor, translated. + * - module: The name of the module providing the plugin. * * A complete sample plugin definition should be defined as in this example: * @@ -31,6 +32,7 @@ * @Plugin( * id = "myeditor", * label = @Translation("My Editor"), + * module = "mymodule" * ) * @endcode */ @@ -60,7 +62,6 @@ public function settingsFormValidate(array $form, array &$form_state) { * Implements \Drupal\editor\Plugin\EditorInterface::settingsFormSubmit(). */ public function settingsFormSubmit(array $form, array &$form_state) { - // Modify $form_state['values'] to adjust saved values. } } diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/EditorInterface.php b/core/modules/editor/lib/Drupal/editor/Plugin/EditorInterface.php index bb33d45..1fcbec3 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/EditorInterface.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/EditorInterface.php @@ -93,14 +93,14 @@ function settingsFormSubmit(array $form, array &$form_state); * @see drupal_process_attached() * @see EditorManager::getAttachments() */ - function attachSettings(Editor $editor); + function getJSSettings(Editor $editor); /** * Returns libraries to be attached. * * Because this is a method, plugins can dynamically choose to attach a * different library for different configurations, instead of being forced to - * always use the same method + * always use the same method. * * @param \Drupal\editor\Plugin\Core\Entity\Editor $editor * A configured text editor object. @@ -112,5 +112,5 @@ function attachSettings(Editor $editor); * @see drupal_process_attached() * @see EditorManager::getAttachments() */ - function attachLibraries(Editor $editor); + function getLibraries(Editor $editor); } diff --git a/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/editor/editor/UnicornEditor.php b/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/editor/editor/UnicornEditor.php index 9148f3c..6a0fbaa 100644 --- a/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/editor/editor/UnicornEditor.php +++ b/core/modules/editor/tests/modules/lib/Drupal/editor_test/Plugin/editor/editor/UnicornEditor.php @@ -18,10 +18,6 @@ * @Plugin( * id = "unicorn", * label = @Translation("Unicorn Editor"), - * library = { - * "module" = "edit_test", - * "name" = "unicorn" - * }, * module = "editor_test" * ) */ @@ -43,9 +39,9 @@ function settingsForm(array $form, array &$form_state, Editor $editor) { } /** - * Implements \Drupal\editor\Plugin\EditorInterface::attachSettings(). + * Implements \Drupal\editor\Plugin\EditorInterface::getJSSettings(). */ - function attachSettings(Editor $editor) { + function getJSSettings(Editor $editor) { $settings = array(); if ($editor->settings['ponies too']) { $settings['ponyModeEnabled'] = TRUE; @@ -54,9 +50,9 @@ function attachSettings(Editor $editor) { } /** - * Implements \Drupal\editor\Plugin\EditorInterface::attachLibraries(). + * Implements \Drupal\editor\Plugin\EditorInterface::getLibraries(). */ - public function attachLibraries(Editor $editor) { + public function getLibraries(Editor $editor) { return array( array('edit_test', 'unicorn'), );