Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ckeditor-3358962
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Issue forks
ckeditor-3358962
Commits
de9cbc10
Commit
de9cbc10
authored
12 years ago
by
dczepierga
Browse files
Options
Downloads
Patches
Plain Diff
[
#1870270
] by dczepierga: Disable plugins which not exists and are stored in ckeditor profiles
parent
29b4e0bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.txt
+1
-0
1 addition, 0 deletions
CHANGELOG.txt
includes/ckeditor.admin.inc
+38
-0
38 additions, 0 deletions
includes/ckeditor.admin.inc
with
39 additions
and
0 deletions
CHANGELOG.txt
+
1
−
0
View file @
de9cbc10
...
...
@@ -2,6 +2,7 @@
New stable release 7.x-1.x
Bug fixes:
[#1870270] by dczepierga: Disable plugins which not exists and are stored in ckeditor profiles
[#1864760] by dczepierga: Wrong path to plugins stored in database
[#1868416] by dczepierga: Move skin selection option to CKEditor Global Profile
[#1866654] by dczepierga: Remove "Skin" and "Toolbar state on startup" options from user profile
...
...
This diff is collapsed.
Click to expand it.
includes/ckeditor.admin.inc
+
38
−
0
View file @
de9cbc10
...
...
@@ -101,8 +101,34 @@ function ckeditor_profile_overview() {
if
(
$profiles
)
{
$access_ckeditor_roles
=
user_roles
(
FALSE
,
'access ckeditor'
);
$header
=
array
(
t
(
'Profile'
),
t
(
'Input format'
),
t
(
'Operations'
));
$plugins
=
ckeditor_load_plugins
();
$disabled_plugins
=
array
();
foreach
(
$profiles
as
$p
)
{
if
(
$p
->
name
!==
"CKEditor Global Profile"
)
{
if
(
isset
(
$p
->
settings
[
'loadPlugins'
])
&&
is_array
(
$p
->
settings
[
'loadPlugins'
])
&&
count
(
$p
->
settings
[
'loadPlugins'
])
>
0
)
{
$changed
=
FALSE
;
foreach
(
$p
->
settings
[
'loadPlugins'
]
as
$plugin_name
=>
$plugin_settings
)
{
if
(
!
array_key_exists
(
$plugin_name
,
$plugins
))
{
if
(
isset
(
$plugin_settings
[
'active'
])
&&
$plugin_settings
[
'active'
]
==
0
)
{
continue
;
}
if
(
!
isset
(
$disabled_plugins
[
$p
->
name
]))
{
$disabled_plugins
[
$p
->
name
]
=
array
();
}
$p
->
settings
[
'loadPlugins'
][
$plugin_name
][
'active'
]
=
0
;
$disabled_plugins
[
$p
->
name
][]
=
$plugin_name
;
$changed
=
TRUE
;
}
}
if
(
$changed
===
TRUE
)
{
db_update
(
'ckeditor_settings'
)
->
fields
(
array
(
'settings'
=>
serialize
(
$p
->
settings
)
))
->
condition
(
'name'
,
$p
->
name
,
'='
)
->
execute
();
}
}
$rows
[]
=
array
(
array
(
'data'
=>
$p
->
name
,
'valign'
=>
'top'
),
array
(
'data'
=>
implode
(
"<br />
\n
"
,
$p
->
input_formats
)),
...
...
@@ -116,6 +142,18 @@ function ckeditor_profile_overview() {
);
}
}
if
(
count
(
$disabled_plugins
)
>
0
)
{
$msg
=
t
(
"The following plugins could not be found and were automatically disabled in CKEditor profiles:"
);
foreach
(
$disabled_plugins
as
$profile_name
=>
$profile_plugins
)
{
$msg
.
=
"<br/><br/>"
;
$msg
.
=
t
(
"<b>Profile</b>: %profile_name"
,
array
(
"%profile_name"
=>
$profile_name
));
$msg
.
=
"<br/>"
;
$msg
.
=
t
(
"<b>Plugins</b>: %profile_plugins"
,
array
(
"%profile_plugins"
=>
implode
(
', '
,
$profile_plugins
)));
}
drupal_set_message
(
$msg
,
'warning'
);
}
$output
.
=
'<h3>'
.
t
(
'Profiles'
)
.
'</h3>'
;
$output
.
=
theme
(
'table'
,
array
(
"header"
=>
$header
,
"rows"
=>
$rows
));
$output
.
=
'<p>'
.
l
(
t
(
'Create a new profile'
),
'admin/config/content/ckeditor/add'
)
.
'</p>'
;
...
...
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