Skip to content
Snippets Groups Projects
Commit 80e1d41b authored by Fabian de Rijk's avatar Fabian de Rijk
Browse files

Issue #3297744 by Project Update Bot: Automated Drupal 10 compatibility fixes

parent ea135a9a
Branches
Tags
No related merge requests found
......@@ -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.
......@@ -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';
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment