You are here

function popup_announcement_block_info in Pop-up announcement 7

Implements hook_block_info().

File

./popup_announcement.module, line 55
Primarily Drupal hooks and custom functions for creating block with pop-up announcement.

Code

function popup_announcement_block_info() {
  $blocks = array();
  $pa = new Popup_announcement_block();
  $bs = $pa
    ->get_blocks();
  if (!empty($bs)) {
    foreach ($bs as $bid => $b) {
      $blocks['popup_announcement_' . $bid] = array(
        'info' => $b['name'] == FALSE ? 'Popup announcement ' . $bid : $b['name'],
        'status' => TRUE,
        'region' => 'content',
        'weight' => 0,
        'visibility' => BLOCK_VISIBILITY_LISTED,
        'pages' => '<front>',
        'cache' => DRUPAL_NO_CACHE,
      );
    }
  }
  return $blocks;
}