You are here

function panels_node_panels_cache_get in Panels 7.3

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;

File

panels_node/panels_node.module, line 432
panels_node.module

Code

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->allowed_layouts = panels_common_get_allowed_layouts('panels_node');
  }
  return $cache;
}