Commit 9b6caf53 authored by alexpott's avatar alexpott

Issue #1986988 by tim.plunkett: Add a dedicated @CKEditorPlugin annotation.

parent f140bcee
<?php
/**
* @file
* Contains Drupal\ckeditor\Annotation\CKEditorPlugin.
*/
namespace Drupal\ckeditor\Annotation;
use Drupal\Component\Annotation\Plugin;
/**
* Defines a CKEditorPlugin annotation object.
*
* @Annotation
*/
class CKEditorPlugin extends Plugin {
/**
* The plugin ID.
*
* @var string
*/
public $id;
/**
* The human-readable name of the CKEditor plugin.
*
* @ingroup plugin_translatable
*
* @var \Drupal\Core\Annotation\Translation
*/
public $label;
/**
* The name of the module providing the CKEditor plugin.
*
* @var string
*/
public $module;
}
......@@ -29,7 +29,8 @@ class CKEditorPluginManager extends PluginManagerBase {
* keyed by the corresponding namespace to look for plugin implementations,
*/
public function __construct(\Traversable $namespaces) {
$this->discovery = new AnnotatedClassDiscovery('CKEditorPlugin', $namespaces);
$annotation_namespaces = array('Drupal\ckeditor\Annotation' => $namespaces['Drupal\ckeditor']);
$this->discovery = new AnnotatedClassDiscovery('CKEditorPlugin', $namespaces, $annotation_namespaces, 'Drupal\ckeditor\Annotation\CKEditorPlugin');
$this->discovery = new AlterDecorator($this->discovery, 'ckeditor_plugin_info');
$this->discovery = new CacheDecorator($this->discovery, 'ckeditor_plugin');
$this->factory = new DefaultFactory($this->discovery);
......
......@@ -9,14 +9,14 @@
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Annotation\Plugin;
use Drupal\ckeditor\Annotation\CKEditorPlugin;
use Drupal\Core\Annotation\Translation;
use Drupal\editor\Plugin\Core\Entity\Editor;
/**
* Defines the "internal" plugin (i.e. core plugins part of our CKEditor build).
*
* @Plugin(
* @CKEditorPlugin(
* id = "internal",
* label = @Translation("CKEditor core"),
* module = "ckeditor"
......
......@@ -10,14 +10,14 @@
use Drupal\ckeditor\CKEditorPluginBase;
use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
use Drupal\Component\Utility\NestedArray;
use Drupal\Component\Annotation\Plugin;
use Drupal\ckeditor\Annotation\CKEditorPlugin;
use Drupal\Core\Annotation\Translation;
use Drupal\editor\Plugin\Core\Entity\Editor;
/**
* Defines the "stylescombo" plugin.
*
* @Plugin(
* @CKEditorPlugin(
* id = "stylescombo",
* label = @Translation("Styles dropdown"),
* module = "ckeditor"
......
......@@ -9,7 +9,7 @@
use Drupal\ckeditor\CKEditorPluginInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\ckeditor\Annotation\CKEditorPlugin;
use Drupal\Core\Annotation\Translation;
use Drupal\editor\Plugin\Core\Entity\Editor;
......@@ -25,7 +25,7 @@
* @see MetaButton
* @see MetaContextualAndButton
*
* @Plugin(
* @CKEditorPlugin(
* id = "llama",
* label = @Translation("Llama"),
* module = "ckeditor_test"
......
......@@ -9,13 +9,13 @@
use Drupal\ckeditor\CKEditorPluginButtonsInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\ckeditor\Annotation\CKEditorPlugin;
use Drupal\Core\Annotation\Translation;
/**
* Defines a "LlamaButton" plugin, with a toolbar builder-enabled "llama" feature.
*
* @Plugin(
* @CKEditorPlugin(
* id = "llama_button",
* label = @Translation("Llama Button"),
* module = "ckeditor_test"
......
......@@ -9,14 +9,14 @@
use Drupal\ckeditor\CKEditorPluginContextualInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\ckeditor\Annotation\CKEditorPlugin;
use Drupal\Core\Annotation\Translation;
use Drupal\editor\Plugin\Core\Entity\Editor;
/**
* Defines a "Llama" plugin, with a contextually enabled "llama" feature.
*
* @Plugin(
* @CKEditorPlugin(
* id = "llama_contextual",
* label = @Translation("Contextual Llama"),
* module = "ckeditor_test"
......
......@@ -11,7 +11,7 @@
use Drupal\ckeditor\CKEditorPluginContextualInterface;
use Drupal\ckeditor\CKEditorPluginConfigurableInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Annotation\Plugin;
use Drupal\ckeditor\Annotation\CKEditorPlugin;
use Drupal\Core\Annotation\Translation;
use Drupal\editor\Plugin\Core\Entity\Editor;
......@@ -19,7 +19,7 @@
* Defines a "LlamaContextualAndbutton" plugin, with a contextually OR toolbar
* builder-enabled "llama" feature.
*
* @Plugin(
* @CKEditorPlugin(
* id = "llama_contextual_and_button",
* label = @Translation("Contextual Llama With Button"),
* module = "ckeditor_test"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment