Révision 5a7e6170
Ajouté par Florent Torregrosa il y a environ 10 ans
drupal7/sites/all/modules/panels/plugins/cache/simple.inc | ||
---|---|---|
25 | 25 |
*/ |
26 | 26 |
function panels_simple_cache_get_cache($conf, $display, $args, $contexts, $pane = NULL) { |
27 | 27 |
$cid = panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane); |
28 |
$cache = cache_get($cid, 'cache'); |
|
28 |
$cache = cache_get($cid, 'cache_panels');
|
|
29 | 29 |
if (!$cache) { |
30 | 30 |
return FALSE; |
31 | 31 |
} |
... | ... | |
42 | 42 |
*/ |
43 | 43 |
function panels_simple_cache_set_cache($conf, $content, $display, $args, $contexts, $pane = NULL) { |
44 | 44 |
$cid = panels_simple_cache_get_id($conf, $display, $args, $contexts, $pane); |
45 |
cache_set($cid, $content); |
|
45 |
cache_set($cid, $content, 'cache_panels');
|
|
46 | 46 |
} |
47 | 47 |
|
48 | 48 |
/** |
... | ... | |
53 | 53 |
function panels_simple_cache_clear_cache($display) { |
54 | 54 |
$cid = 'panels_simple_cache'; |
55 | 55 |
|
56 |
// This is used in case this is an in-code display, which means did will be something like 'new-1'. |
|
57 |
if (isset($display->owner) && isset($display->owner->id)) { |
|
58 |
$cid .= ':' . $display->owner->id; |
|
56 |
// If the panel is stored in the database it'll have a numeric did value. |
|
57 |
if (is_numeric($display->did)) { |
|
58 |
$cid .= ':' . $display->did; |
|
59 |
} |
|
60 |
// Exported panels won't have a numeric did but may have a usable cache_key. |
|
61 |
elseif (!empty($display->cache_key)) { |
|
62 |
$cid .= ':' . str_replace('panel_context:', '', $display->cache_key); |
|
63 |
} |
|
64 |
// Alternatively use the css_id. |
|
65 |
elseif (!empty($display->css_id)) { |
|
66 |
$cid .= ':' . $display->css_id; |
|
67 |
} |
|
68 |
// Failover to just appending the did, which may be the completely unusable |
|
69 |
// string 'new'. |
|
70 |
else { |
|
71 |
$cid .= ':' . $display->did; |
|
59 | 72 |
} |
60 |
$cid .= ':' . $display->did; |
|
61 | 73 |
|
62 |
cache_clear_all($cid, 'cache', TRUE); |
|
74 |
cache_clear_all($cid, 'cache_panels', TRUE);
|
|
63 | 75 |
} |
64 | 76 |
|
65 | 77 |
/** |
Formats disponibles : Unified diff
Update :