You are here

function mostpopular_block_info in Drupal Most Popular 7

Implements hook_block_info().

Defines each of the most popular blocks.

Each block will render its contents based on user cookies. This allows us to cache the block itself.

File

./mostpopular.module, line 811
The main file for the Most Popular module.

Code

function mostpopular_block_info() {
  $out = array();
  $blocks = mostpopular_blocks();
  foreach ($blocks as $bid => $block) {
    $out[$block->bid] = array(
      'info' => t('Most Popular: @name', array(
        '@name' => !empty($block->name) ? $block->name : $block->bid,
      )),
      'cache' => DRUPAL_CACHE_GLOBAL,
    );
  }
  return $out;
}