You are here

function theme_blockreference_formatter_plain in Block reference 6

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

Theme function for 'plain' blockreference field formatter.

File

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

Code

function theme_blockreference_formatter_plain($element) {
  $output = '';
  if (isset($element['#item']['bid'])) {
    $args[] = $element['#item']['bid'];
    $result = db_query(db_rewrite_sql("SELECT b.module, b.delta FROM {blocks} b WHERE b.bid = '%s'", 'blocks', 'bid', $args), $args);
    $block = db_fetch_object($result);
    $info = module_invoke($block->module, 'block', 'list');
    $output = $info[$block->delta]['info'];
  }
  return $output;
}