You are here

function invite_block in Invite 6.2

Same name and namespace in other branches
  1. 5.2 invite.module \invite_block()
  2. 5 invite.module \invite_block()

Implementation of hook_block().

File

./invite.module, line 593
Allows your users to send and track invitations to join your site.

Code

function invite_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    $blocks[0] = array(
      'info' => t('Invite a friend'),
      'cache' => BLOCK_CACHE_PER_ROLE,
    );
    return $blocks;
  }
  elseif ($op == 'view') {
    $block = array();
    switch ($delta) {
      case 0:
        if (user_access('send invitations')) {
          $block = array(
            'subject' => t('Invite a friend'),
            'content' => drupal_get_form('invite_form', 'block'),
          );
        }
        break;
    }
    return $block;
  }
}