diff --git a/core/modules/edit/edit.services.yml b/core/modules/edit/edit.services.yml index 91c37b1..46c8608 100644 --- a/core/modules/edit/edit.services.yml +++ b/core/modules/edit/edit.services.yml @@ -1,6 +1,6 @@ services: plugin.manager.edit.editor: - class: Drupal\edit\Plugin\EditorManager + class: Drupal\edit\Plugin\InPlaceEditorManager arguments: ['@container.namespaces'] access_check.edit.entity_field: class: Drupal\edit\Access\EditEntityFieldAccessCheck diff --git a/core/modules/edit/lib/Drupal/edit/Annotation/InPlaceEditor.php b/core/modules/edit/lib/Drupal/edit/Annotation/InPlaceEditor.php new file mode 100644 index 0000000..e7a5edf --- /dev/null +++ b/core/modules/edit/lib/Drupal/edit/Annotation/InPlaceEditor.php @@ -0,0 +1,41 @@ +discovery = new AnnotatedClassDiscovery('edit/editor', $namespaces); + $annotation_namespaces = array('Drupal\edit\Annotation' => $namespaces['Drupal\edit']); + $this->discovery = new AnnotatedClassDiscovery('InPlaceEditor', $namespaces, $annotation_namespaces, 'Drupal\edit\Annotation\InPlaceEditor'); $this->discovery = new ProcessDecorator($this->discovery, array($this, 'processDefinition')); $this->discovery = new AlterDecorator($this->discovery, 'edit_editor'); $this->discovery = new CacheDecorator($this->discovery, 'edit:editor'); diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php index 767c570..432c2be 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php @@ -7,7 +7,7 @@ namespace Drupal\edit\Tests; -use Drupal\edit\Plugin\EditorManager; +use Drupal\edit\Plugin\InPlaceEditorManager; use Drupal\edit\EditorSelector; /** diff --git a/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php b/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php index 1394285..556c2a0 100644 --- a/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php +++ b/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php @@ -9,7 +9,7 @@ use Drupal\edit\EditorSelector; use Drupal\edit\MetadataGenerator; -use Drupal\edit\Plugin\EditorManager; +use Drupal\edit\Plugin\InPlaceEditorManager; use Drupal\edit_test\MockEditEntityFieldAccessCheck; /** diff --git a/core/modules/edit/tests/modules/lib/Drupal/edit_test/Plugin/edit/editor/WysiwygEditor.php b/core/modules/edit/tests/modules/lib/Drupal/edit_test/Plugin/InPlaceEditor/WysiwygEditor.php similarity index 89% rename from core/modules/edit/tests/modules/lib/Drupal/edit_test/Plugin/edit/editor/WysiwygEditor.php rename to core/modules/edit/tests/modules/lib/Drupal/edit_test/Plugin/InPlaceEditor/WysiwygEditor.php index 16aa4a8..c0e3e4e 100644 --- a/core/modules/edit/tests/modules/lib/Drupal/edit_test/Plugin/edit/editor/WysiwygEditor.php +++ b/core/modules/edit/tests/modules/lib/Drupal/edit_test/Plugin/InPlaceEditor/WysiwygEditor.php @@ -2,19 +2,19 @@ /** * @file - * Contains \Drupal\edit_test\Plugin\edit\editor\WysiwygEditor. + * Contains \Drupal\edit_test\Plugin\InPlaceEditor\WysiwygEditor. */ -namespace Drupal\edit_test\Plugin\edit\editor; +namespace Drupal\edit_test\Plugin\InPlaceEditor; use Drupal\edit\EditorBase; -use Drupal\Component\Annotation\Plugin; +use Drupal\edit\Annotation\InPlaceEditor; use Drupal\field\Plugin\Core\Entity\FieldInstance; /** * Defines the wysiwyg editor. * - * @Plugin( + * @InPlaceEditor( * id = "wysiwyg", * alternativeTo = {"direct"}, * module = "edit_test" diff --git a/core/modules/editor/editor.services.yml b/core/modules/editor/editor.services.yml index db19922..686935c 100644 --- a/core/modules/editor/editor.services.yml +++ b/core/modules/editor/editor.services.yml @@ -1,4 +1,4 @@ services: plugin.manager.editor: - class: Drupal\editor\Plugin\EditorManager + class: Drupal\editor\Plugin\InPlaceEditorManager arguments: ['@container.namespaces'] diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php index b94d259..e1585be 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\editor\Plugin\EditorManager. + * Contains \Drupal\editor\Plugin\InPlaceEditorManager. */ namespace Drupal\editor\Plugin; diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/edit/editor/Editor.php b/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php similarity index 94% rename from core/modules/editor/lib/Drupal/editor/Plugin/edit/editor/Editor.php rename to core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php index 8e6311c..0a056fb 100644 --- a/core/modules/editor/lib/Drupal/editor/Plugin/edit/editor/Editor.php +++ b/core/modules/editor/lib/Drupal/editor/Plugin/InPlaceEditor/Editor.php @@ -2,13 +2,13 @@ /** * @file - * Contains \Drupal\editor\Plugin\edit\editor\Editor. + * Contains \Drupal\editor\Plugin\InPlaceEditor\Editor. */ -namespace Drupal\editor\Plugin\edit\editor; +namespace Drupal\editor\Plugin\InPlaceEditor; use Drupal\Component\Plugin\PluginBase; -use Drupal\Component\Annotation\Plugin; +use Drupal\edit\Annotation\InPlaceEditor; use Drupal\Core\Annotation\Translation; use Drupal\edit\EditPluginInterface; use Drupal\field\Plugin\Core\Entity\FieldInstance; @@ -16,7 +16,7 @@ /** * Defines the formatted text editor. * - * @Plugin( + * @InPlaceEditor( * id = "editor", * alternativeTo = {"direct"}, * module = "editor" diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php index 6e8e36f..4ebb921 100644 --- a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php +++ b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationTest.php @@ -9,7 +9,7 @@ use Drupal\edit\EditorSelector; use Drupal\edit\MetadataGenerator; -use Drupal\edit\Plugin\EditorManager; +use Drupal\edit\Plugin\InPlaceEditorManager; use Drupal\edit\Tests\EditTestBase; use Drupal\edit_test\MockEditEntityFieldAccessCheck; use Drupal\editor\EditorController; @@ -122,7 +122,7 @@ protected function getSelectedEditor($items, $field_name, $view_mode = 'default' * format compatibility. */ function testEditorSelection() { - $this->editorManager = new EditorManager($this->container->get('container.namespaces')); + $this->editorManager = new InPlaceEditorManager($this->container->get('container.namespaces')); $this->editorSelector = new EditorSelector($this->editorManager); // Pretend there is an entity with these items for the field. @@ -146,7 +146,7 @@ function testEditorSelection() { * Tests (custom) metadata when the formatted text editor is used. */ function testMetadata() { - $this->editorManager = new EditorManager($this->container->get('container.namespaces')); + $this->editorManager = new InPlaceEditorManager($this->container->get('container.namespaces')); $this->accessChecker = new MockEditEntityFieldAccessCheck(); $this->editorSelector = new EditorSelector($this->editorManager); $this->metadataGenerator = new MetadataGenerator($this->accessChecker, $this->editorSelector, $this->editorManager);