You are here

function fieldable_panels_panes_get_base_context in Fieldable Panels Panes (FPP) 7

Get a "base" context for this pane.

This is used to provide the base context for access control.

4 calls to fieldable_panels_panes_get_base_context()
fieldable_panels_panes_ctools_access_get in ./fieldable_panels_panes.module
Implement CTools access form caching callback: get.
fieldable_panels_panes_entity_edit_access_page in includes/admin.inc
Page callback to edit access control of an entity pane.
fieldable_panels_panes_file_download_access in ./fieldable_panels_panes.module
Implements hook_file_download_access().
PanelsPaneController::access in includes/PanelsPaneController.class.php
Custom method to check access to an FPP object for an operation.

File

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

Code

function fieldable_panels_panes_get_base_context($entity = NULL) {
  ctools_include('context');
  if ($entity) {
    $context = ctools_context_create('entity:fieldable_panels_pane', $entity);
  }
  else {
    $context = ctools_context_create_empty('entity:fieldable_panels_pane');

    // The placeholder is needed to create the form used for the live
    // preview.
    $context->placeholder = array(
      'type' => 'context',
      'conf' => array(
        'name' => 'fieldable_panels_pane',
        'identifier' => t('This entity'),
        'keyword' => 'pane',
        'context_settings' => array(),
      ),
    );
  }
  $context->identifier = t('This entity');
  $context->keyword = 'pane';
  return array(
    'fieldable-pane' => $context,
  );
}