You are here

function bean_block_view in Bean (for Drupal 7) 7

Implements hook_block_view().

File

./bean.module, line 886
Block Entity

Code

function bean_block_view($delta = '') {
  $return = array();
  $bean = bean_load_delta($delta);
  if (entity_access('view', 'bean', $bean) && $bean) {
    $content = $bean
      ->view($bean->view_mode);
    if (!is_array($content)) {
      $content = array(
        '#markup' => $content,
      );
    }
    $return = array(
      'content' => $content,
      'subject' => isset($bean->title) ? filter_xss($bean->title, $allowed_tags = array(
        'em',
        'strong',
        'i',
        'b',
      )) : '',
    );
  }
  return $return;
}