You are here

function bean_block_info in Bean (for Drupal 7) 7

Implements hook_block_info().

2 string references to 'bean_block_info'
bean_bean_cache_clear in ./bean.module
Implements hook_bean_cache_clear().
bean_cache_clear_block in ./bean.module
Clear out cache_block table

File

./bean.module, line 856
Block Entity

Code

function bean_block_info() {
  $blocks =& drupal_static(__FUNCTION__, array());
  if (!empty($blocks)) {
    return $blocks;
  }
  $cache = cache_get('bean_block_info', 'cache');
  if ($cache) {
    $blocks = $cache->data;
    return $blocks;
  }
  $blocks = array();
  $beans = bean_get_all_beans();
  foreach ($beans as $bean) {
    $blocks[$bean->delta] = array(
      'info' => $bean
        ->adminTitle(),
      'cache' => $bean
        ->getInfo('cache_level'),
    );
  }
  cache_set('bean_block_info', $blocks, 'cache');
  return $blocks;
}