You are here

function views_block_label in Views Hacks 7

1 string reference to 'views_block_label'
views_block_entity_info in views_block/views_block.module
Implements hook_entity_info().

File

views_block/views_block.module, line 95

Code

function views_block_label($entity, $entity_type) {
  if (!is_object($entity)) {
    $entity = views_block_load($entity);
  }
  $block_id = $entity->module . '.' . $entity->delta;
  if ($entity->module != 'block') {
    $block_list = module_invoke($entity->module, 'block', 'list');
    $label = $block_list[$entity->delta]['info'];
  }
  else {
    $label = $entity->info;
  }
  return $block_id . (!empty($label) ? ' (' . $label . ')' : '');
}