You are here

function mailchimp_signup_block_info in Mailchimp 7.5

Same name and namespace in other branches
  1. 7.3 modules/mailchimp_signup/mailchimp_signup.module \mailchimp_signup_block_info()
  2. 7.4 modules/mailchimp_signup/mailchimp_signup.module \mailchimp_signup_block_info()

Implements hook_block_info().

File

modules/mailchimp_signup/mailchimp_signup.module, line 106
Mailchimp Signup module. Allows creation of signup forms integrated with Mailchimp.

Code

function mailchimp_signup_block_info() {
  $blocks = array();
  $signups = mailchimp_signup_load_multiple();
  foreach ($signups as $signup) {
    if (intval($signup->mode) == MAILCHIMP_SIGNUP_BLOCK || intval($signup->mode) == MAILCHIMP_SIGNUP_BOTH) {
      $blocks[$signup
        ->identifier()] = array(
        'info' => t('Mailchimp Subscription Form: @name', array(
          '@name' => $signup
            ->label(),
        )),
        'cache' => DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE,
      );
    }
  }
  return $blocks;
}