You are here

function fieldable_panels_panes_ctools_access_get in Fieldable Panels Panes (FPP) 7

Implement CTools access form caching callback: get.

File

./fieldable_panels_panes.module, line 777
Maintains an entity that appears as panel pane content.

Code

function fieldable_panels_panes_ctools_access_get($argument) {
  if (!fieldable_panels_panes_check_access_update($argument)) {
    return;
  }
  list($op, $fpid) = explode(':', $argument);
  $entity = fieldable_panels_panes_load($fpid);

  // First, see if there's a cache:
  ctools_include('object-cache');
  $access = ctools_object_cache_get('fieldable_panels_panes', $argument);
  if (!$access) {
    $access = $entity->{$op . '_access'};
  }
  $context = fieldable_panels_panes_get_base_context($entity);
  return array(
    $access,
    $context,
  );
}