You are here

function entityreference_prepopulate_node_prepopulate_content_type_render in Entityreference prepopulate 7

Render callback.

File

plugins/content_types/node_prepopulate.inc, line 20

Code

function entityreference_prepopulate_node_prepopulate_content_type_render($subtype, $conf, $args, $context) {
  if (empty($context->data)) {
    return;
  }
  $node = $context->data;
  $links = entityreference_prepopulate_create_node_links('node', $node->nid, $conf['field_name'], NULL, !empty($conf['types']) ? $conf['types'] : NULL);
  if (!$links) {
    return;
  }
  $module = 'entityreference_prepopulate';
  $block = new stdClass();
  $block->module = $module;
  $block->title = t('Content create links');
  $block->content = $links;
  return $block;
}