You are here

function sharedblocks_block_view in Shared Blocks 7

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

Implements hook_block_view().

File

./sharedblocks.module, line 109

Code

function sharedblocks_block_view($delta) {

  // Look up details for this block.
  $block = db_select('sharedblocks', 'sb')
    ->fields('sb', array(
    'block_data',
  ))
    ->condition('name', $delta)
    ->execute()
    ->fetchField();
  if (!empty($block)) {
    $block = unserialize($block);
  }

  // Return the unserialized block data.
  return $block;
}