Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ctools
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
drupal.org
ctools
Commits
0baa731a
Commit
0baa731a
authored
15 years ago
by
Earl Miles
Browse files
Options
Downloads
Patches
Plain Diff
#426652: Clear CTools CSS cache during a system cache flush.
parent
c383d5ba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ctools.module
+8
-0
8 additions, 0 deletions
ctools.module
includes/css.inc
+8
-1
8 additions, 1 deletion
includes/css.inc
with
16 additions
and
1 deletion
ctools.module
+
8
−
0
View file @
0baa731a
...
@@ -282,3 +282,11 @@ function ctools_preprocess_node(&$vars) {
...
@@ -282,3 +282,11 @@ function ctools_preprocess_node(&$vars) {
$vars
[
'template_files'
][]
=
'node-panel-'
.
check_plain
(
$vars
[
'node'
]
->
panel_identifier
);
$vars
[
'template_files'
][]
=
'node-panel-'
.
check_plain
(
$vars
[
'node'
]
->
panel_identifier
);
}
}
}
}
/**
* Ensure the CTools CSS cache is flushed whenever hook_flush_caches is invoked.
*/
function
ctools_flush_caches
()
{
ctools_include
(
'css'
);
ctools_css_flush_caches
();
}
This diff is collapsed.
Click to expand it.
includes/css.inc
+
8
−
1
View file @
0baa731a
...
@@ -154,7 +154,7 @@ function ctools_css_cache($css, $filter = TRUE) {
...
@@ -154,7 +154,7 @@ function ctools_css_cache($css, $filter = TRUE) {
file_check_directory
(
$path
,
FILE_CREATE_DIRECTORY
);
file_check_directory
(
$path
,
FILE_CREATE_DIRECTORY
);
}
}
// @todo Is this slow? D
O
es it matter if it is?
// @todo Is this slow? D
o
es it matter if it is?
$filename
=
$path
.
'/'
.
md5
(
$css
)
.
'.css'
;
$filename
=
$path
.
'/'
.
md5
(
$css
)
.
'.css'
;
// This will do renames if the file already exists, ensuring we don't
// This will do renames if the file already exists, ensuring we don't
...
@@ -528,3 +528,10 @@ function ctools_css_filter_default_allowed_values() {
...
@@ -528,3 +528,10 @@ function ctools_css_filter_default_allowed_values() {
);
);
}
}
/**
* Delegated implementation of hook_flush_caches()
*/
function
ctools_css_flush_caches
()
{
file_scan_directory
(
file_create_path
(
'ctools/css'
),
'.*'
,
array
(
'.'
,
'..'
,
'CVS'
),
'file_delete'
,
TRUE
);
db_query
(
"TRUNCATE
{
ctools_css_cache
}
"
);
}
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