You are here

panels_ipe.api.php in Panels 7.3

Same filename and directory in other branches
  1. 8.4 panels_ipe/panels_ipe.api.php
  2. 8.3 panels_ipe/panels_ipe.api.php

Hooks provided by Panels In-Place Editor.

File

panels_ipe/panels_ipe.api.php
View source
<?php

/**
 * @file
 * Hooks provided by Panels In-Place Editor.
 */

/**
 * Allow modules to control access to the Panels IPE.
 *
 * @param panels_display $display
 *   The panels display about to be rendered.
 *
 * @return TRUE|FALSE|NULL
 *   Returns TRUE to allow access, FALSE to deny, or NULL if the module
 *   implementing this hook doesn't care about access for the given display.
 */
function hook_panels_ipe_access(panels_display $display) {

  // We only care about displays with the 'panelizer' context.
  if (!isset($display->context['panelizer'])) {
    return NULL;
  }
  if ($display->context['panelizer']->type[0] == 'entity:node') {

    // Allow or deny IPE access based on node type.
    return $display->context['panelizer']->data->type == 'awesome_page';
  }

  // Otherwise, deny access to everything!
  return FALSE;
}

Functions

Namesort descending Description
hook_panels_ipe_access Allow modules to control access to the Panels IPE.