non security modules update
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
name = Panel nodes
|
||||
description = Create nodes that are divided into areas with selectable content.
|
||||
package = "Panels"
|
||||
version = PANELS_VERSION
|
||||
dependencies[] = panels
|
||||
configure = admin/structure/panels
|
||||
core = 7.x
|
||||
files[] = panels_node.module
|
||||
|
||||
; Information added by drupal.org packaging script on 2012-08-18
|
||||
version = "7.x-3.3"
|
||||
; Information added by Drupal.org packaging script on 2015-01-28
|
||||
version = "7.x-3.5"
|
||||
core = "7.x"
|
||||
project = "panels"
|
||||
datestamp = "1345319572"
|
||||
datestamp = "1422472985"
|
||||
|
||||
|
||||
@@ -339,6 +339,7 @@ function panels_node_hook_view($node, $view_mode) {
|
||||
$display->css_id = $node->panels_node['css_id'];
|
||||
// TODO: Find a way to make sure this can't node_view.
|
||||
$display->context = panels_node_get_context($node);
|
||||
$display->cache_key = 'panels_node:' . $node->nid;
|
||||
$renderer = panels_get_renderer($node->panels_node['pipeline'], $display);
|
||||
$node->content['body'] = array(
|
||||
'#markup' => panels_render_display($display, $renderer),
|
||||
@@ -429,3 +430,59 @@ function panels_node_panels_dashboard_blocks(&$vars) {
|
||||
'weight' => -1,
|
||||
);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Callbacks for panel caching.
|
||||
|
||||
/**
|
||||
* Get display edit cache for a panel node being edited.
|
||||
*
|
||||
* The key is the second half of the key in this form:
|
||||
* panels_node:NID;
|
||||
*/
|
||||
function panels_node_panels_cache_get($nid) {
|
||||
ctools_include('object-cache');
|
||||
$cache = ctools_object_cache_get('panels_node_display_cache', $nid);
|
||||
if (empty($cache)) {
|
||||
$cache = new stdClass();
|
||||
$node = node_load($nid);
|
||||
if (empty($node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ctools_include('common', 'panels');
|
||||
$cache->display = panels_load_display($node->panels_node['did']);
|
||||
$cache->display->css_id = $node->panels_node['css_id'];
|
||||
$cache->display->context = panels_node_get_context($node);
|
||||
$cache->display->cache_key = 'panels_node:' . $node->nid;
|
||||
$cache->content_types = panels_common_get_allowed_types('panels_node', $cache->display->context);
|
||||
$cache->allwed_layouts = panels_common_get_allowed_layouts('panels_node');
|
||||
}
|
||||
|
||||
return $cache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a display edit in progress in the panels cache.
|
||||
*/
|
||||
function panels_node_panels_cache_set($nid, $cache) {
|
||||
ctools_include('object-cache');
|
||||
ctools_object_cache_set('panels_node_display_cache', $nid, $cache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear all changes made to a display using the panels cache.
|
||||
*/
|
||||
function panels_node_panels_cache_clear($nid, $cache) {
|
||||
ctools_include('object-cache');
|
||||
ctools_object_cache_clear('panels_node_display_cache', $nid);
|
||||
}
|
||||
|
||||
/**
|
||||
* React to a cache save and save the display and clear cache.
|
||||
*/
|
||||
function panels_node_panels_cache_save($nid, $cache) {
|
||||
panels_save_display($cache->display);
|
||||
ctools_include('object-cache');
|
||||
ctools_object_cache_clear('panels_node_display_cache', $nid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user