You are here

function fieldblock_block_info in Field as Block 7

Implements hook_block_info().

File

./fieldblock.module, line 92
Allow fields to be rendered in blocks.

Code

function fieldblock_block_info() {
  $blocks = array();
  $fieldblocks = fieldblock_get_block_list();
  foreach ($fieldblocks as $fieldblock_id => $description) {
    $blocks[$fieldblock_id] = array(
      'info' => $description,
      // The block can not be cached, because the content of it (ie. the content
      // of the field displayed in it) may vary based on whatever criteria the
      // fieldblock.module is unaware of. Eg. the same field might be displayed
      // differently for different users, for different roles, for different
      // pages, etc.
      'cache' => DRUPAL_NO_CACHE,
    );
  }
  return $blocks;
}