You are here

function theme_blockreference_formatter_without_title in Block reference 7

Same name and namespace in other branches
  1. 6 blockreference.module \theme_blockreference_formatter_without_title()
  2. 7.2 blockreference.module \theme_blockreference_formatter_without_title()

Theme function for 'without_title' blockreference field formatter.

File

./blockreference.module, line 793
Defines a field type for referencing a block from a node.

Code

function theme_blockreference_formatter_without_title($variables) {
  $element = $variables['element'];
  $output = '';
  $block = blockreference_formatter_get_block($element);
  if ($block) {
    $bid = $block->module . '_' . $block->delta;
    if ($block_content = _block_render_blocks(array(
      $block,
    ))) {
      $rendered_block = reset($block_content);
      $rendered_block->subject = '';
      $build = _block_get_renderable_array($block_content);
      $build[$bid]['#blockreference_element'] = $element;
      $output = drupal_render($build);
    }
  }
  return $output;
}