You are here

function campaignmonitor_block_list in Campaign Monitor 6.3

Returns a list of blocks in a form suitable for hook_block() when $op == list: A block is returned for each CampaignMonitor list chosen in admin settings

1 call to campaignmonitor_block_list()
campaignmonitor_block in ./campaignmonitor.module
Implementation of hook_block().

File

./campaignmonitor.module, line 202
Module that plugs in Campaign Monitor functionality to your Drupal web site. For Campaign Monitor information see: http://www.campaignmonitor.com/

Code

function campaignmonitor_block_list() {
  $blocks = array();
  $lists = campaignmonitor_get_available_lists();
  foreach ($lists as $list_id => $list) {

    // If list==0 that means that list is not chosen, don't create a block
    if ($list != '0') {
      $blocks[$list_id]['info'] = t('Subscribe to @list_name', array(
        '@list_name' => $list->name,
      ));
    }
  }
  return $blocks;
}