You are here

function flexiform_add_pane_content_type_render in Flexiform 7

Render the custom content type.

File

plugins/content_types/add_pane.inc, line 97
Plugin to handle attached entity content types

Code

function flexiform_add_pane_content_type_render($subtype, $conf, $panel_args, $context) {
  $flexiform = entity_load_single('flexiform', $subtype);

  // Check flexiform access.
  if (!$flexiform
    ->getDisplay('FlexiformDisplayAddPane')
    ->access()) {
    return;
  }
  $content = $flexiform
    ->getDisplay('FlexiformDisplayAddPane')
    ->build(array(
    'args' => $panel_args,
  ));
  $title = $flexiform
    ->getDisplay('FlexiformDisplayAddPane')
    ->title();

  // Build the content type block.
  $block = new stdClass();
  $block->module = 'flexiform';
  $block->title = $title;
  $block->content = $content;
  $block->delta = $subtype;
  return $block;
}