You are here

function fieldable_panels_panes_block_view in Fieldable Panels Panes (FPP) 7

Implements hook_block_view().

File

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

Code

function fieldable_panels_panes_block_view($delta = '') {
  $block = array();

  // Get array of exposed FPP bundles.
  $bundles = fieldable_panels_panes_exposed_bundles();
  if (variable_get('fpp_blocks_expose', FALSE) == TRUE) {
    $entity = fieldable_panels_panes_load($delta);
    $bundle = $entity->bundle;
    $block['subject'] = '';
    $block['content'] = '';

    // Render block if its FPP bundle is exposed and block is reusable.
    if ((array_key_exists($bundle, $bundles) || empty($bundles)) && $entity->reusable == TRUE) {
      $content = fieldable_panels_panes_view($entity);
      $block['subject'] = check_plain($entity->title);
      $block['content'] = $content;
    }
  }
  return $block;
}