You are here

function mailchimp_block_info in Mailchimp 7

Implements hook_block_info.

File

./mailchimp.module, line 928
Mailchimp module.

Code

function mailchimp_block_info() {
  $blocks = array();
  $all_lists = variable_get('mailchimp_lists', NULL);
  if (is_array($all_lists)) {
    foreach ($all_lists as $key => $list) {

      // exclude required lists
      if ($list->listtype !== MAILCHIMP_LISTTYPE_REQUIRED) {
        $blocks[$list->id] = array(
          'info' => t('Mailchimp Subscription Form: @name', array(
            '@name' => $list->name,
          )),
          'cache' => DRUPAL_CACHE_PER_USER,
        );
      }
    }
  }
  return $blocks;
}