You are here

function boxes_block_view in Boxes 7.2

Same name and namespace in other branches
  1. 7 boxes.module \boxes_block_view()

Implements hook_block_view().

File

./boxes.module, line 680

Code

function boxes_block_view($delta = '') {
  $return = array();
  $box = boxes_load_delta($delta);
  if (boxes_access('view', $box) && $box) {
    $return = array(
      'content' => $box
        ->view($box->view_mode),
      'subject' => $box->title,
    );
    if (!empty($return['content']) && module_exists('contextual')) {
      $return['content']['#contextual_links']['boxes'] = array(
        'block',
        array(
          $box
            ->identifier(),
        ),
      );
    }
  }
  return $return;
}