Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entity_embed
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
entity_embed
Commits
4f8eefa7
Commit
4f8eefa7
authored
7 years ago
by
Devin Carlson
Committed by
Devin Carlson
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2463407
by Devin Carlson: Support custom CKEditor icons
parent
97b70ced
Branches
7.x-1.x
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entity_embed.ckeditor.inc
+17
-3
17 additions, 3 deletions
entity_embed.ckeditor.inc
with
17 additions
and
3 deletions
entity_embed.ckeditor.inc
+
17
−
3
View file @
4f8eefa7
...
...
@@ -24,11 +24,25 @@ function entity_embed_ckeditor_plugin() {
$buttons
=
array
();
foreach
(
$embed_buttons
as
$embed_button
)
{
// CKEditor only supports icons relative to the plugin path.
// @todo: Figure out how to support custom icons.
$icon
=
'entity.png'
;
$icon_path
=
FALSE
;
// Use a custom icon when available.
if
(
$fid
=
$embed_button
->
button_icon_fid
)
{
if
(
$file
=
file_load
(
$fid
))
{
// We are unable to use _entity_embed_button_image() because CKEditor
// requires a specific format for icon paths.
if
(
$wrapper
=
file_stream_wrapper_get_instance_by_uri
(
$file
->
uri
))
{
$icon
=
file_uri_target
(
$file
->
uri
);
$icon_path
=
base_path
()
.
$wrapper
->
getDirectoryPath
()
.
'/'
;
}
}
}
$buttons
[
$embed_button
->
name
]
=
array
(
'label'
=>
check_plain
(
$embed_button
->
button_label
),
'icon'
=>
'entity.png'
,
'icon'
=>
$icon
,
'icon_path'
=>
$icon_path
,
);
}
...
...
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