You are here

function campaignmonitor_block in Campaign Monitor 5.2

Same name and namespace in other branches
  1. 5 campaignmonitor.module \campaignmonitor_block()
  2. 6.3 campaignmonitor.module \campaignmonitor_block()
  3. 6 campaignmonitor.module \campaignmonitor_block()
  4. 6.2 campaignmonitor.module \campaignmonitor_block()

Implementation of hook_block()

File

./campaignmonitor.module, line 97

Code

function campaignmonitor_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    $blocks[0] = array(
      'info' => t('Newsletter block to allow signup to newsletter for all.'),
      'weight' => 0,
      'enabled' => 0,
      'region' => 'left',
    );
    return $blocks;
  }
  else {
    if ($op == 'configure' && $delta == 0) {

      /* $form['items'] = array(
           '#type' => 'select',
           '#title' => t('Number of items'),
           '#default_value' => variable_get('XXX_block_items', 0),
           '#options' => array('1', '2', '3'),
         );
         return $form;*/
    }
    else {
      if ($op == 'save' && $delta == 0) {

        /* variable_set('XXX_block_items', $edit['items']);*/
      }
      else {
        if ($op == 'view') {
          switch ($delta) {
            case 0:
              $block = array(
                'subject' => t('Join Newsletter'),
                'content' => campaignmonitor_signup_block(),
              );
              break;
          }
          return $block;
        }
      }
    }
  }
}