Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uw_cfg_common
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WCMS
uw_cfg_common
Commits
e38555a4
Commit
e38555a4
authored
4 years ago
by
Eric Bremner
Committed by
Chris Shantz
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
ISTWCMS-4501: fixing ckeditor dialog to use libraries
parent
436c3050
No related branches found
No related tags found
1 merge request
!53
Feature/istwcms 4501 ebremner ckeditor libraries
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Plugin/CKEditorPlugin/DialogPlugin.php
+36
-2
36 additions, 2 deletions
src/Plugin/CKEditorPlugin/DialogPlugin.php
with
36 additions
and
2 deletions
src/Plugin/CKEditorPlugin/DialogPlugin.php
+
36
−
2
View file @
e38555a4
...
...
@@ -3,7 +3,10 @@
namespace
Drupal\uw_cfg_common\Plugin\CKEditorPlugin
;
use
Drupal\ckeditor\CKEditorPluginBase
;
use
Drupal\Core\Asset\LibrariesDirectoryFileFinder
;
use
Drupal\Core\Plugin\ContainerFactoryPluginInterface
;
use
Drupal\editor\Entity\Editor
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
/**
* Defines the "dialog" plugin.
...
...
@@ -13,7 +16,38 @@ use Drupal\editor\Entity\Editor;
* label = @Translation("Dialog")
* )
*/
class
DialogPlugin
extends
CKEditorPluginBase
{
class
DialogPlugin
extends
CKEditorPluginBase
implements
ContainerFactoryPluginInterface
{
/**
* Library file finder.
*
* @var \Drupal\Core\Asset\LibrariesDirectoryFileFinder
*/
protected
$libFileFinder
;
/**
* Constructs a BlockComponentRenderArray object.
*
* @param array $configuration
* A configuration array containing information about the plugin instance.
* @param string $plugin_id
* The plugin ID for the plugin instance.
* @param mixed $plugin_definition
* The plugin implementation definition.
* @param \Drupal\Core\Asset\LibrariesDirectoryFileFinder $libFileFinder
* The library file finder.
*/
public
function
__construct
(
array
$configuration
,
$plugin_id
,
$plugin_definition
,
LibrariesDirectoryFileFinder
$libFileFinder
)
{
parent
::
__construct
(
$configuration
,
$plugin_id
,
$plugin_definition
);
$this
->
libFileFinder
=
$libFileFinder
;
}
/**
* {@inheritdoc}
*/
public
static
function
create
(
ContainerInterface
$container
,
array
$configuration
,
$plugin_id
,
$plugin_definition
)
{
return
new
static
(
$configuration
,
$plugin_id
,
$plugin_definition
,
$container
->
get
(
'library.libraries_directory_file_finder'
));
}
/**
* {@inheritdoc}
...
...
@@ -33,7 +67,7 @@ class DialogPlugin extends CKEditorPluginBase {
* {@inheritdoc}
*/
public
function
getFile
()
{
return
drupal_get_path
(
'profile'
,
'uw_base_profile'
)
.
'/libraries/
ckeditor-dialog/plugin.js'
;
return
$this
->
libFileFinder
->
find
(
'
ckeditor-dialog
'
)
.
'
/plugin.js'
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment