Loading modules/o365_sharepoint_field/src/Plugin/CKEditorPlugin/SharePoint.php +37 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,10 @@ namespace Drupal\o365_sharepoint_field\Plugin\CKEditorPlugin; use Drupal\ckeditor\CKEditorPluginBase; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\editor\Entity\Editor; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Defines the "SharePoint File Search" plugin, with a CKEditor. Loading @@ -14,13 +17,45 @@ use Drupal\editor\Entity\Editor; * module = "o365_sharepoint_field" * ) */ class SharePoint extends CKEditorPluginBase { class SharePoint extends CKEditorPluginBase implements ContainerFactoryPluginInterface { /** * The path to the module. * * @var string */ protected $modulePath = ''; /** * @param array $configuration * The configuration. * @param string $plugin_id * The plugin id. * @param string $plugin_definition * The plugin definition. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleExtensionList $moduleExtensionList) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->modulePath = $moduleExtensionList->getPath('o365_sharepoint_field'); } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('extension.list.module'), ); } /** * {@inheritdoc} */ public function getFile() { return drupal_get_path('module', 'o365_sharepoint_field') . '/js/plugins/sharepoint/plugin.js'; return $this->modulePath . '/js/plugins/sharepoint/plugin.js'; } /** Loading Loading
modules/o365_sharepoint_field/src/Plugin/CKEditorPlugin/SharePoint.php +37 −2 Original line number Diff line number Diff line Loading @@ -3,7 +3,10 @@ namespace Drupal\o365_sharepoint_field\Plugin\CKEditorPlugin; use Drupal\ckeditor\CKEditorPluginBase; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Plugin\ContainerFactoryPluginInterface; use Drupal\editor\Entity\Editor; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Defines the "SharePoint File Search" plugin, with a CKEditor. Loading @@ -14,13 +17,45 @@ use Drupal\editor\Entity\Editor; * module = "o365_sharepoint_field" * ) */ class SharePoint extends CKEditorPluginBase { class SharePoint extends CKEditorPluginBase implements ContainerFactoryPluginInterface { /** * The path to the module. * * @var string */ protected $modulePath = ''; /** * @param array $configuration * The configuration. * @param string $plugin_id * The plugin id. * @param string $plugin_definition * The plugin definition. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleExtensionList $moduleExtensionList) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->modulePath = $moduleExtensionList->getPath('o365_sharepoint_field'); } /** * {@inheritdoc} */ public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) { return new static( $configuration, $plugin_id, $plugin_definition, $container->get('extension.list.module'), ); } /** * {@inheritdoc} */ public function getFile() { return drupal_get_path('module', 'o365_sharepoint_field') . '/js/plugins/sharepoint/plugin.js'; return $this->modulePath . '/js/plugins/sharepoint/plugin.js'; } /** Loading