You are here

function views_block_load in Views Hacks 6

Same name and namespace in other branches
  1. 7 views_block/views_block.module \views_block_load()
1 string reference to 'views_block_load'
views_block_views_bulk_operations_object_info in views_block/views_block.module
Implementation of hook_views_bulk_operations_object_info().

File

views_block/views_block.module, line 26

Code

function views_block_load($bid) {
  $block = db_fetch_object(db_query("SELECT * FROM {blocks} b LEFT JOIN {boxes} box ON b.bid = box.bid WHERE b.bid=%d", $bid));
  if ($block) {
    if ($block->module != 'block') {
      $blocks = module_invoke($block->module, 'block', 'list');
      $block->info = $blocks[$block->delta]['info'];
    }
    if (empty($block->info)) {
      $block->info = '(' . t('none') . ')';
    }
    return $block;
  }
  return NULL;
}